diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-19 19:54:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-19 19:54:35 +0100 |
| commit | a2fd8a4e3750cfa3ff7be305b4052a0699a3ffee (patch) | |
| tree | 6e7b84167711d7623d48779e7af83cdbe8a4fbcb /src/wx/timeline.cc | |
| parent | 114912df4be84f7d8b82833b93d739b117ec8705 (diff) | |
Give content menu on both main control and timeline. Fix silly bug on updating editor panels.
Diffstat (limited to 'src/wx/timeline.cc')
| -rw-r--r-- | src/wx/timeline.cc | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index c7276a081..7227fcffc 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -25,7 +25,6 @@ #include "film_editor.h" #include "timeline.h" #include "wx_util.h" -#include "repeat_dialog.h" using std::list; using std::cout; @@ -320,11 +319,6 @@ private: int _y; }; -enum { - ID_repeat, - ID_remove -}; - Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film) : wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE) , _film_editor (ed) @@ -335,7 +329,7 @@ Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film) , _left_down (false) , _down_view_start (0) , _first_move (false) - , _menu (0) + , _menu (film, this) { #ifndef __WXOSX__ SetDoubleBuffered (true); @@ -348,9 +342,6 @@ Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film) Connect (wxID_ANY, wxEVT_MOTION, wxMouseEventHandler (Timeline::mouse_moved), 0, this); Connect (wxID_ANY, wxEVT_SIZE, wxSizeEventHandler (Timeline::resized), 0, this); - Connect (ID_repeat, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Timeline::repeat), 0, this); - Connect (ID_remove, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Timeline::remove), 0, this); - playlist_changed (); SetMinSize (wxSize (640, tracks() * track_height() + 96)); @@ -572,14 +563,7 @@ Timeline::right_down (wxMouseEvent& ev) cv->set_selected (true); } - if (!_menu) { - _menu = new wxMenu; - _menu->Append (ID_repeat, _("Repeat...")); - _menu->AppendSeparator (); - _menu->Append (ID_remove, _("Remove")); - } - - PopupMenu (_menu, ev.GetPosition ()); + _menu.popup (selected_content (), ev.GetPosition ()); } void @@ -634,42 +618,6 @@ Timeline::clear_selection () } } -void -Timeline::repeat (wxCommandEvent &) -{ - ContentList sel = selected_content (); - if (sel.empty ()) { - return; - } - - RepeatDialog d (this); - d.ShowModal (); - - shared_ptr<const Film> film = _film.lock (); - if (!film) { - return; - } - - film->playlist()->repeat (sel, d.number ()); - d.Destroy (); -} - -void -Timeline::remove (wxCommandEvent &) -{ - ContentList sel = selected_content (); - if (sel.empty ()) { - return; - } - - shared_ptr<const Film> film = _film.lock (); - if (!film) { - return; - } - - film->playlist()->remove (sel); -} - Timeline::ContentViewList Timeline::selected_views () const { |
