Fix sizing of audio mapping view.
authorCarl Hetherington <cth@carlh.net>
Fri, 4 Sep 2015 16:35:58 +0000 (17:35 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 4 Sep 2015 16:35:58 +0000 (17:35 +0100)
Before it would start with a wide column 0 and then
resize on the first click.

ChangeLog
src/wx/audio_mapping_view.cc
src/wx/audio_mapping_view.h

index 3e34e0bfa3d5cfbafaa677bbb1e807563fd54586..aefa39a917ada76dd971d9abcde6ce8669d25976 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-09-04  Carl Hetherington  <cth@carlh.net>
 
+       * Fix audio mapping view changing size
+       on first click.
+
        * Version 2.1.52 released.
 
 2015-09-03  Carl Hetherington  <cth@carlh.net>
index b7324911b48319b38ee0ea4c77437d29faabdc3f..b031fcd8d0c09a5b172f51ccbc645f07ea83c44d 100644 (file)
@@ -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 ();
+}
index 4210d755493de61d39e54a8f7756e8a2cb5102e0..05255ed307950612ddceb658cc7bd2004e1f64e8 100644 (file)
@@ -59,6 +59,7 @@ private:
        void mouse_moved (wxMouseEvent &);
        void update_cells ();
        void map_values_changed ();
+       void sized (wxSizeEvent &);
 
        void off ();
        void full ();