X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Faudio_mapping_view.cc;h=8d39a40ff91c7de810f6a70854e922d0da694df2;hp=b7324911b48319b38ee0ea4c77437d29faabdc3f;hb=3828baf56467224f5d44049bf1e7a7ed11f43a05;hpb=f8bd84bfb0393c7e5f4ecf2f202270d4d95c8540 diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index b7324911b..8d39a40ff 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -1,19 +1,20 @@ /* Copyright (C) 2013-2015 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ @@ -31,7 +32,7 @@ #include #include #include -#include +#include using std::cout; using std::list; @@ -39,7 +40,6 @@ using std::string; using std::max; using std::vector; using boost::shared_ptr; -using boost::lexical_cast; #define INDICATOR_SIZE 16 @@ -79,7 +79,7 @@ public: dc.SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (255, 255, 255), wxBRUSHSTYLE_SOLID)); dc.DrawRectangle (wxRect (rect.GetLeft() + xo, rect.GetTop() + yo, INDICATOR_SIZE, INDICATOR_SIZE)); - float const value = lexical_cast (wx_to_std (grid.GetCellValue (row, col))); + float const value = raw_convert (wx_to_std (grid.GetCellValue (row, col))); float const value_dB = 20 * log10 (value); int const range = 18; int height = 0; @@ -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 (); +}