Toolbar and scrolling tweaks.
authorCarl Hetherington <cth@carlh.net>
Wed, 4 Jul 2018 09:58:01 +0000 (10:58 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 4 Jul 2018 09:58:01 +0000 (10:58 +0100)
src/wx/timeline.cc
src/wx/timeline_dialog.cc

index 8524db6038086d446b09987da7ac8a33dfaaa252..017d27dfb4812fc1c6bb7c582e714bbe8daf8d01 100644 (file)
@@ -96,7 +96,13 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film)
        _main_canvas->Bind   (wxEVT_RIGHT_DOWN, boost::bind (&Timeline::right_down,   this, _1));
        _main_canvas->Bind   (wxEVT_MOTION,     boost::bind (&Timeline::mouse_moved,  this, _1));
        _main_canvas->Bind   (wxEVT_SIZE,       boost::bind (&Timeline::resized,      this));
-       _main_canvas->Bind   (wxEVT_SCROLLWIN_THUMBTRACK,  boost::bind (&Timeline::scrolled,     this, _1));
+       _main_canvas->Bind   (wxEVT_SCROLLWIN_TOP,        boost::bind (&Timeline::scrolled,     this, _1));
+       _main_canvas->Bind   (wxEVT_SCROLLWIN_BOTTOM,     boost::bind (&Timeline::scrolled,     this, _1));
+       _main_canvas->Bind   (wxEVT_SCROLLWIN_LINEUP,     boost::bind (&Timeline::scrolled,     this, _1));
+       _main_canvas->Bind   (wxEVT_SCROLLWIN_LINEDOWN,   boost::bind (&Timeline::scrolled,     this, _1));
+       _main_canvas->Bind   (wxEVT_SCROLLWIN_PAGEUP,     boost::bind (&Timeline::scrolled,     this, _1));
+       _main_canvas->Bind   (wxEVT_SCROLLWIN_PAGEDOWN,   boost::bind (&Timeline::scrolled,     this, _1));
+       _main_canvas->Bind   (wxEVT_SCROLLWIN_THUMBTRACK, boost::bind (&Timeline::scrolled,     this, _1));
 
        film_changed (Film::CONTENT);
 
index b487bdb819cbdc953749d2a00eaccc2ad0e7c793..6f3fbae37f3e2e730f3fbfecfed68f4692b608c2 100644 (file)
@@ -61,14 +61,14 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film)
        wxBitmap snap (bitmap_path("snap"), wxBITMAP_TYPE_PNG);
        wxBitmap sequence (bitmap_path("sequence"), wxBITMAP_TYPE_PNG);
 
-       cout << "select OK: " << select.IsOk() << "\n";
-
-       _toolbar = new wxToolBar (this, wxID_ANY);
+       _toolbar = new wxToolBar (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL | wxTB_TEXT);
+       _toolbar->SetMargins (4, 4);
        _toolbar->AddRadioTool ((int) Timeline::SELECT, _("Select"), select, wxNullBitmap, _("Select and move content"));
        _toolbar->AddRadioTool ((int) Timeline::ZOOM, _("Zoom"), zoom, wxNullBitmap, _("Zoom in / out"));
        _toolbar->AddTool ((int) Timeline::ZOOM_ALL, _("Zoom all"), zoom_all, _("Zoom out to whole film"));
        _toolbar->AddCheckTool ((int) Timeline::SNAP, _("Snap"), snap, wxNullBitmap, _("Snap"));
        _toolbar->AddCheckTool ((int) Timeline::SEQUENCE, _("Sequence"), sequence, wxNullBitmap, _("Keep video and subtitles in sequence"));
+       _toolbar->Realize ();
 
        _toolbar->Bind (wxEVT_TOOL, bind (&TimelineDialog::tool_clicked, this, _1));