X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fgain_calculator_dialog.cc;h=133d84c21719cfa30b0718898636987f3f43a5ce;hb=e60bb3e51bd1508b149e6b8f6608f09b5196ae26;hp=22e6b447ab1bb96f69f0946986b0c0f4b3d8651f;hpb=a00ebbc68438e84076c65e99d0e70403afb4407d;p=dcpomatic.git diff --git a/src/wx/gain_calculator_dialog.cc b/src/wx/gain_calculator_dialog.cc index 22e6b447a..133d84c21 100644 --- a/src/wx/gain_calculator_dialog.cc +++ b/src/wx/gain_calculator_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,29 +24,15 @@ using namespace boost; GainCalculatorDialog::GainCalculatorDialog (wxWindow* parent) - : wxDialog (parent, wxID_ANY, _("Gain Calculator")) + : TableDialog (parent, _("Gain Calculator"), 2, true) { - wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6); - table->AddGrowableCol (1, 1); + add (_("I want to play this back at fader"), true); + _wanted = add (new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator (wxFILTER_NUMERIC))); - add_label_to_sizer (table, this, _("I want to play this back at fader")); - _wanted = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator (wxFILTER_NUMERIC)); - table->Add (_wanted, 1, wxEXPAND); + add (_("But I have to use fader"), true); + _actual = add (new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator (wxFILTER_NUMERIC))); - add_label_to_sizer (table, this, _("But I have to use fader")); - _actual = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator (wxFILTER_NUMERIC)); - table->Add (_actual, 1, wxEXPAND); - - wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6); - - wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); - if (buttons) { - overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); - } - - SetSizer (overall_sizer); - overall_sizer->SetSizeHints (this); + layout (); } float @@ -55,7 +41,7 @@ GainCalculatorDialog::wanted_fader () const if (_wanted->GetValue().IsEmpty()) { return 0; } - + return lexical_cast (wx_to_std (_wanted->GetValue ())); }