From 41b7a04cf3dedaa93aaf3c050db7a693281417f7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 26 Mar 2014 16:43:34 +0000 Subject: Cleanup of various dialogs by inherting TableDialog. --- src/wx/table_dialog.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/wx/table_dialog.h (limited to 'src/wx/table_dialog.h') diff --git a/src/wx/table_dialog.h b/src/wx/table_dialog.h new file mode 100644 index 000000000..23017c3b6 --- /dev/null +++ b/src/wx/table_dialog.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef DCPOMATIC_TABLE_DIALOG_H +#define DCPOMATIC_TABLE_DIALOG_H + +#include + +class TableDialog : public wxDialog +{ +public: + TableDialog (wxWindow* parent, wxString title, int columns, bool cancel); + +protected: + template + T* add (T* w) { + _table->Add (w, 1, wxEXPAND); + return w; + } + + void add (wxString text, bool label); + void add_spacer (); + + void layout (); + +private: + wxSizer* _overall_sizer; + wxFlexGridSizer* _table; +}; + +#endif -- cgit v1.2.3