2 Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
22 #include "static_text.h"
23 #include "table_dialog.h"
27 TableDialog::TableDialog (wxWindow* parent, wxString title, int columns, int growable, bool cancel)
28 : wxDialog (parent, wxID_ANY, title)
30 _overall_sizer = new wxBoxSizer (wxVERTICAL);
31 SetSizer (_overall_sizer);
33 _table = new wxFlexGridSizer (columns, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
34 _table->AddGrowableCol (growable, 1);
36 _overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
38 long int flags = wxOK;
43 auto buttons = CreateSeparatedButtonSizer (flags);
45 _overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
51 TableDialog::layout ()
53 _overall_sizer->Layout ();
54 _overall_sizer->SetSizeHints (this);
60 TableDialog::add (wxString text, bool label, int flags)
62 TableDialog::add (wxString text, bool, int flags)
67 flags |= wxALIGN_RIGHT;
71 auto m = new StaticText (this, wxT (""));
72 m->SetLabelMarkup (text);
73 _table->Add (m, 0, flags, 6);
79 TableDialog::add_spacer ()
81 _table->AddSpacer (0);