X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fgain_calculator_dialog.cc;h=133d84c21719cfa30b0718898636987f3f43a5ce;hb=78bc6f9286864052b304a1871739479c16e393dd;hp=3f07faf062e4239835d692f8466d30c438fb7822;hpb=c0ed407fb02891f0dd364e78b6192f0e6dbe1d8d;p=dcpomatic.git diff --git a/src/wx/gain_calculator_dialog.cc b/src/wx/gain_calculator_dialog.cc index 3f07faf06..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, wxString (_("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 ())); }