From 8cddae8f947c3d4970c32da9e981f95d4036d3ea Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 4 Sep 2015 17:35:58 +0100 Subject: [PATCH] Fix sizing of audio mapping view. Before it would start with a wide column 0 and then resize on the first click. --- ChangeLog | 3 +++ src/wx/audio_mapping_view.cc | 8 ++++++++ src/wx/audio_mapping_view.h | 1 + 3 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3e34e0bfa..aefa39a91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-09-04 Carl Hetherington + * Fix audio mapping view changing size + on first click. + * Version 2.1.52 released. 2015-09-03 Carl Hetherington diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index b7324911b..b031fcd8d 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -135,6 +135,7 @@ AudioMappingView::AudioMappingView (wxWindow* parent) Bind (wxEVT_GRID_CELL_LEFT_CLICK, boost::bind (&AudioMappingView::left_click, this, _1)); Bind (wxEVT_GRID_CELL_RIGHT_CLICK, boost::bind (&AudioMappingView::right_click, this, _1)); _grid->GetGridWindow()->Bind (wxEVT_MOTION, boost::bind (&AudioMappingView::mouse_moved, this, _1)); + Bind (wxEVT_SIZE, boost::bind (&AudioMappingView::sized, this, _1)); _menu = new wxMenu; _menu->Append (ID_off, _("Off")); @@ -324,3 +325,10 @@ AudioMappingView::mouse_moved (wxMouseEvent& ev) ev.Skip (); } + +void +AudioMappingView::sized (wxSizeEvent& ev) +{ + _grid->AutoSize (); + ev.Skip (); +} diff --git a/src/wx/audio_mapping_view.h b/src/wx/audio_mapping_view.h index 4210d7554..05255ed30 100644 --- a/src/wx/audio_mapping_view.h +++ b/src/wx/audio_mapping_view.h @@ -59,6 +59,7 @@ private: void mouse_moved (wxMouseEvent &); void update_cells (); void map_values_changed (); + void sized (wxSizeEvent &); void off (); void full (); -- 2.30.2