From 9e065519743ff8eac63207552a97314febca24c7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 4 Jul 2018 11:18:21 +0100 Subject: [PATCH] Fix tool crash; try to fix linked scrolling. --- src/wx/timeline.cc | 4 +++- src/wx/timeline_dialog.cc | 7 +++---- src/wx/timeline_dialog.h | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 017d27dfb..ba528c007 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -808,7 +808,9 @@ void Timeline::scrolled (wxScrollWinEvent& ev) { if (ev.GetOrientation() == wxVERTICAL) { - _labels_canvas->Scroll (0, ev.GetPosition ()); + int x, y; + _main_canvas->GetViewState (&x, &y); + _labels_canvas->Scroll (0, y); } ev.Skip (); } diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 6f3fbae37..d2194f5c7 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -61,7 +61,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film) wxBitmap snap (bitmap_path("snap"), wxBITMAP_TYPE_PNG); wxBitmap sequence (bitmap_path("sequence"), wxBITMAP_TYPE_PNG); - _toolbar = new wxToolBar (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL | wxTB_TEXT); + _toolbar = new wxToolBar (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL); _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")); @@ -96,7 +96,6 @@ wxString TimelineDialog::bitmap_path (string name) { boost::filesystem::path p = shared_path() / String::compose("%1.png", name); - cout << "Loading " << p.string() << "\n"; return std_to_wx (p.string()); } @@ -125,11 +124,11 @@ TimelineDialog::tool_clicked (wxCommandEvent& ev) Timeline::Tool t = (Timeline::Tool) ev.GetId(); _timeline.tool_clicked (t); if (t == Timeline::SNAP) { - _timeline.set_snap (_snap->IsToggled()); + _timeline.set_snap (_toolbar->GetToolState ((int) t)); } else if (t == Timeline::SEQUENCE) { shared_ptr film = _film.lock (); if (film) { - film->set_sequence (_sequence->IsToggled()); + film->set_sequence (_toolbar->GetToolState ((int) t)); } } } diff --git a/src/wx/timeline_dialog.h b/src/wx/timeline_dialog.h index e9156b89e..b7aaba14d 100644 --- a/src/wx/timeline_dialog.h +++ b/src/wx/timeline_dialog.h @@ -40,7 +40,5 @@ private: boost::weak_ptr _film; Timeline _timeline; wxToolBar* _toolbar; - wxToolBarToolBase* _snap; - wxToolBarToolBase* _sequence; boost::signals2::scoped_connection _film_changed_connection; }; -- 2.30.2