summaryrefslogtreecommitdiff
path: root/wx+/file_drop.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:22:18 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:22:18 +0200
commitbcc5cc28c6dc5178e8f4fd0cc521034ae5def388 (patch)
treebacc60d27b435d32172f97643576c5e4e953177d /wx+/file_drop.h
parent5.9 (diff)
downloadFreeFileSync-bcc5cc28c6dc5178e8f4fd0cc521034ae5def388.tar.gz
FreeFileSync-bcc5cc28c6dc5178e8f4fd0cc521034ae5def388.tar.bz2
FreeFileSync-bcc5cc28c6dc5178e8f4fd0cc521034ae5def388.zip
5.10
Diffstat (limited to 'wx+/file_drop.h')
-rw-r--r--wx+/file_drop.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/wx+/file_drop.h b/wx+/file_drop.h
index 22a6542c..7b6020ac 100644
--- a/wx+/file_drop.h
+++ b/wx+/file_drop.h
@@ -13,6 +13,8 @@
namespace zen
{
//register simple file drop event (without issue of freezing dialogs and without wxFileDropTarget overdesign)
+//CAVEAT: a drop target window must not be directly or indirectly contained within a wxStaticBoxSizer until the following wxGTK bug
+//is fixed. According to wxWidgets release cycles this is expected to be: never http://trac.wxwidgets.org/ticket/2763
//1. setup a window to emit EVENT_DROP_FILE
void setupFileDrop(wxWindow& wnd);
@@ -39,7 +41,8 @@ void setupFileDrop(wxWindow& wnd);
-
+namespace impl
+{
inline
wxEventType createNewEventType()
{
@@ -47,9 +50,11 @@ wxEventType createNewEventType()
static wxEventType dummy = wxNewEventType();
return dummy;
}
+}
+
//define new event type
-const wxEventType EVENT_DROP_FILE = createNewEventType();
+const wxEventType EVENT_DROP_FILE = impl::createNewEventType();
class FileDropEvent : public wxCommandEvent
{
@@ -78,6 +83,8 @@ typedef void (wxEvtHandler::*FileDropEventFunction)(FileDropEvent&);
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(FileDropEventFunction, &func)
+namespace impl
+{
class WindowDropTarget : public wxFileDropTarget
{
public:
@@ -99,12 +106,13 @@ private:
wxWindow& dropWindow_;
};
+}
inline
void setupFileDrop(wxWindow& wnd)
{
- wnd.SetDropTarget(new WindowDropTarget(wnd)); //takes ownership
+ wnd.SetDropTarget(new impl::WindowDropTarget(wnd)); //takes ownership
}
}
bgstack15