diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:14:37 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:14:37 +0200 |
commit | 8bf668665b107469086f16cb8ad23e47d479d2b4 (patch) | |
tree | 66a91ef06a8caa7cd6819dcbe1860693d3eda8d5 /shared/dir_name.h | |
parent | 3.21 (diff) | |
download | FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.tar.gz FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.tar.bz2 FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.zip |
4.0
Diffstat (limited to 'shared/dir_name.h')
-rw-r--r-- | shared/dir_name.h | 52 |
1 files changed, 13 insertions, 39 deletions
diff --git a/shared/dir_name.h b/shared/dir_name.h index 6e783d75..7c7b3bc4 100644 --- a/shared/dir_name.h +++ b/shared/dir_name.h @@ -11,64 +11,38 @@ #include <wx/event.h> #include <wx/sizer.h> #include <wx/filepicker.h> -#include <wx/combobox.h> #include "file_drop.h" - -class wxFileDirPickerEvent; - namespace zen { //handle drag and drop, tooltip, label and manual input, coordinating a wxWindow, wxDirPickerCtrl, and wxComboBox/wxTextCtrl -class DirectoryNameMainDlg : private wxEvtHandler +template <class NameControl> //NameControl may be wxTextCtrl, FolderHistoryBox +class DirectoryName: private wxEvtHandler { public: - DirectoryNameMainDlg(wxWindow& dropWindow1, - wxWindow& dropWindow2, - wxDirPickerCtrl& dirPicker, - wxComboBox& dirName, - wxStaticBoxSizer& staticBox); + DirectoryName(wxWindow& dropWindow, + wxDirPickerCtrl& dirPicker, + NameControl& dirName, + wxStaticBoxSizer* staticBox = NULL, + wxWindow* dropWindow2 = NULL); //optional - virtual ~DirectoryNameMainDlg() {} + ~DirectoryName(); wxString getName() const; void setName(const wxString& dirname); - virtual bool AcceptDrop(const std::vector<wxString>& droppedFiles) = 0; //return true if drop should be processed - private: - void OnFilesDropped(FFSFileDropEvent& event); - void OnWriteDirManually(wxCommandEvent& event); - void OnDirSelected(wxFileDirPickerEvent& event); - - const wxWindow& dropWindow1_; - const wxWindow& dropWindow2_; - wxDirPickerCtrl& dirPicker_; - wxComboBox& dirName_; - wxStaticBoxSizer& staticBox_; -}; + virtual bool acceptDrop(const std::vector<wxString>& droppedFiles) { return true; }; //return true if drop should be processed - -class DirectoryName: private wxEvtHandler -{ -public: - DirectoryName(wxWindow& dropWindow, - wxDirPickerCtrl& dirPicker, - wxTextCtrl& dirName, - wxStaticBoxSizer* staticBox = NULL); //optional - - wxString getName() const; - void setName(const wxString& dirname); - -private: void OnFilesDropped(FFSFileDropEvent& event); void OnWriteDirManually(wxCommandEvent& event); void OnDirSelected(wxFileDirPickerEvent& event); - const wxWindow& dropWindow_; - wxDirPickerCtrl& dirPicker_; - wxTextCtrl& dirName_; + const wxWindow& dropWindow_; + const wxWindow* dropWindow2_; + wxDirPickerCtrl& dirPicker_; + NameControl& dirName_; wxStaticBoxSizer* staticBox_; //optional }; } |