2 Copyright (C) 2014 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/>.
21 #include "table_dialog.h"
24 TableDialog::TableDialog (wxWindow* parent, wxString title, int columns, int growable, bool cancel)
25 : wxDialog (parent, wxID_ANY, title)
27 _overall_sizer = new wxBoxSizer (wxVERTICAL);
28 SetSizer (_overall_sizer);
30 _table = new wxFlexGridSizer (columns, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
31 _table->AddGrowableCol (growable, 1);
33 _overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
35 long int flags = wxOK;
40 wxSizer* buttons = CreateSeparatedButtonSizer (flags);
42 _overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
47 TableDialog::layout ()
49 _overall_sizer->Layout ();
50 _overall_sizer->SetSizeHints (this);
55 TableDialog::add (wxString text, bool label)
57 TableDialog::add (wxString text, bool)
60 int flags = wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT;
63 flags |= wxALIGN_RIGHT;
67 wxStaticText* m = new wxStaticText (this, wxID_ANY, wxT (""));
68 m->SetLabelMarkup (text);
69 _table->Add (m, 0, flags, 6);
73 TableDialog::add_spacer ()
75 _table->AddSpacer (0);