* @brief AudioMappingView class and helpers.
*/
-#include "lib/audio_mapping.h"
-#include "lib/util.h"
-#include "lib/raw_convert.h"
#include "audio_mapping_view.h"
#include "wx_util.h"
#include "audio_gain_dialog.h"
+#include "lib/audio_mapping.h"
+#include "lib/util.h"
+#include <dcp/locale_convert.h>
#include <dcp/types.h>
#include <wx/wx.h>
#include <wx/renderer.h>
using std::pair;
using std::make_pair;
using boost::shared_ptr;
+using dcp::locale_convert;
#define INDICATOR_SIZE 16
#define LEFT_WIDTH 48
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 = raw_convert<float> (wx_to_std (grid.GetCellValue (row, col)));
+ float const value = locale_convert<float> (wx_to_std (grid.GetCellValue (row, col)));
float const value_dB = 20 * log10 (value);
int const range = 18;
int height = 0;
}
update_cells ();
+ setup_sizes ();
}
void
_grid->SetCellValue (i, 0, std_to_wx (row_names[i]));
}
for (int j = 1; j < _grid->GetNumberCols(); ++j) {
- _grid->SetCellValue (i, j, std_to_wx (raw_convert<string> (_map.get (i, j - 1))));
+ _grid->SetCellValue (i, j, std_to_wx (locale_convert<string> (_map.get (i, j - 1))));
}
}
void
AudioMappingView::sized (wxSizeEvent& ev)
+{
+ setup_sizes ();
+ ev.Skip ();
+}
+
+void
+AudioMappingView::setup_sizes ()
{
int const top_height = 24;
_grid->AutoSize ();
_left_labels->SetMinSize (wxSize (LEFT_WIDTH, _grid->GetSize().GetHeight()));
_top_labels->SetMinSize (wxSize (_grid->GetSize().GetWidth() + LEFT_WIDTH, top_height));
+ /* Try to make the _top_labels 'actua' size respect the minimum we just set */
+ _top_labels->Fit ();
_left_labels->Refresh ();
_top_labels->Refresh ();
- ev.Skip ();
}
void