diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-08-31 17:31:38 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-08-31 17:31:38 +0100 |
| commit | 22b9f3b2090d8bdfe52cda1e69d3acbe874f1ce5 (patch) | |
| tree | 7c2dea8be25068bbc17474c14a3fba5413b8f20b /src/wx/content_panel.cc | |
| parent | 2d24bc7aaed800415bce4fffe06f261d5e9e464a (diff) | |
| parent | 3c7e1840081639ea5dc537c94baa13972a1987fd (diff) | |
Merge master.
Diffstat (limited to 'src/wx/content_panel.cc')
| -rw-r--r-- | src/wx/content_panel.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index b752a0e5f..991080e59 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -100,6 +100,7 @@ ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr<Film> f) _content->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&ContentPanel::selection_changed, this)); _content->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind (&ContentPanel::selection_changed, this)); _content->Bind (wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, boost::bind (&ContentPanel::right_click, this, _1)); + _content->Bind (wxEVT_DROP_FILES, boost::bind (&ContentPanel::files_dropped, this, _1)); _add_file->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::add_file_clicked, this)); _add_folder->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::add_folder_clicked, this)); _remove->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::remove_clicked, this)); @@ -456,3 +457,15 @@ ContentPanel::setup () } } +void +ContentPanel::files_dropped (wxDropFilesEvent& event) +{ + if (!_film) { + return; + } + + wxString* paths = event.GetFiles (); + for (int i = 0; i < event.GetNumberOfFiles(); i++) { + _film->examine_and_add_content (content_factory (_film, wx_to_std (paths[i]))); + } +} |
