summaryrefslogtreecommitdiff
path: root/lib/dir_name.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:16 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:16 +0200
commitbd6336c629841c6db3a6ca53a936d629d34db53b (patch)
tree3721ef997864108df175ce677a8a7d4342a6f1d2 /lib/dir_name.h
parent4.0 (diff)
downloadFreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.gz
FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.bz2
FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.zip
4.1
Diffstat (limited to 'lib/dir_name.h')
-rw-r--r--lib/dir_name.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/dir_name.h b/lib/dir_name.h
new file mode 100644
index 00000000..43f2015d
--- /dev/null
+++ b/lib/dir_name.h
@@ -0,0 +1,51 @@
+// **************************************************************************
+// * This file is part of the FreeFileSync project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
+// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) *
+// **************************************************************************
+
+#ifndef DRAGANDDROP_H_INCLUDED
+#define DRAGANDDROP_H_INCLUDED
+
+#include <vector>
+#include <wx/event.h>
+#include <wx/sizer.h>
+#include <wx/filepicker.h>
+#include <wx+/file_drop.h>
+
+namespace zen
+{
+//handle drag and drop, tooltip, label and manual input, coordinating a wxWindow, wxDirPickerCtrl, and wxComboBox/wxTextCtrl
+
+template <class NameControl> //NameControl may be wxTextCtrl, FolderHistoryBox
+class DirectoryName: private wxEvtHandler
+{
+public:
+ DirectoryName(wxWindow& dropWindow,
+ wxDirPickerCtrl& dirPicker,
+ NameControl& dirName,
+ wxStaticBoxSizer* staticBox = NULL,
+ wxWindow* dropWindow2 = NULL); //optional
+
+ ~DirectoryName();
+
+ wxString getName() const;
+ void setName(const wxString& dirname);
+
+private:
+ virtual bool acceptDrop(const std::vector<wxString>& droppedFiles) { return true; }; //return true if drop should be processed
+
+ void OnFilesDropped(FFSFileDropEvent& event);
+ void OnWriteDirManually(wxCommandEvent& event);
+ void OnDirSelected(wxFileDirPickerEvent& event);
+
+ const wxWindow& dropWindow_;
+ const wxWindow* dropWindow2_;
+ wxDirPickerCtrl& dirPicker_;
+ NameControl& dirName_;
+ wxStaticBoxSizer* staticBox_; //optional
+};
+}
+
+
+#endif // DRAGANDDROP_H_INCLUDED
bgstack15