2 Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #if !defined( INCLUDED_DIALOG_H )
23 #define INCLUDED_DIALOG_H
26 #include <uilib/uilib.h>
29 #include "generic/callback.h"
30 #include "gtkutil/dialog.h"
31 #include "generic/callback.h"
32 #include "string/string.h"
35 virtual ~DLG_DATA() = default;
37 virtual void release() = 0;
39 virtual void importData() const = 0;
41 virtual void exportData() const = 0;
45 template<typename FirstArgument>
46 class CallbackDialogData;
48 typedef std::list<DLG_DATA *> DialogDataList;
52 DialogDataList m_data;
62 start modal dialog box
63 you need to use AddModalButton to select eIDOK eIDCANCEL buttons
65 EMessageBoxReturn DoModal();
67 void EndModal(EMessageBoxReturn code);
69 virtual ui::Window BuildDialog() = 0;
71 virtual void exportData();
73 virtual void importData();
75 virtual void PreModal()
78 virtual void PostModal(EMessageBoxReturn code)
81 virtual void ShowDlg();
83 virtual void HideDlg();
89 ui::Window GetWidget()
94 const ui::Window GetWidget() const
99 ui::CheckButton addCheckBox(ui::VBox vbox, const char *name, const char *flag, Property<bool> const &cb);
101 ui::CheckButton addCheckBox(ui::VBox vbox, const char *name, const char *flag, bool &data);
103 void addCombo(ui::VBox vbox, const char *name, StringArrayRange values, Property<int> const &cb);
105 void addCombo(ui::VBox vbox, const char *name, int &data, StringArrayRange values);
107 void addSlider(ui::VBox vbox, const char *name, int &data, gboolean draw_value, const char *low, const char *high,
108 double value, double lower, double upper, double step_increment, double page_increment);
110 void addRadio(ui::VBox vbox, const char *name, StringArrayRange names, Property<int> const &cb);
112 void addRadio(ui::VBox vbox, const char *name, int &data, StringArrayRange names);
114 void addRadioIcons(ui::VBox vbox, const char *name, StringArrayRange icons, Property<int> const &cb);
116 void addRadioIcons(ui::VBox vbox, const char *name, int &data, StringArrayRange icons);
118 ui::Widget addIntEntry(ui::VBox vbox, const char *name, Property<int> const &cb);
120 ui::Widget addEntry(ui::VBox vbox, const char *name, int &data)
122 return addIntEntry(vbox, name, make_property(data));
125 ui::Widget addSizeEntry(ui::VBox vbox, const char *name, Property<std::size_t> const &cb);
127 ui::Widget addEntry(ui::VBox vbox, const char *name, std::size_t &data)
129 return addSizeEntry(vbox, name, make_property(data));
132 ui::Widget addFloatEntry(ui::VBox vbox, const char *name, Property<float> const &cb);
134 ui::Widget addEntry(ui::VBox vbox, const char *name, float &data)
136 return addFloatEntry(vbox, name, make_property(data));
139 ui::Widget addPathEntry(ui::VBox vbox, const char *name, bool browse_directory, Property<const char *> const &cb);
141 ui::Widget addPathEntry(ui::VBox vbox, const char *name, CopiedString &data, bool directory);
143 ui::SpinButton addSpinner(ui::VBox vbox, const char *name, int &data, double value, double lower, double upper);
146 addSpinner(ui::VBox vbox, const char *name, double value, double lower, double upper, Property<int> const &cb);
149 addSpinner(ui::VBox vbox, const char *name, double value, double lower, double upper, Property<float> const &cb);
153 void AddBoolToggleData(ui::ToggleButton object, Property<bool> const &cb);
155 void AddIntRadioData(ui::RadioButton object, Property<int> const &cb);
157 void AddTextEntryData(ui::Entry object, Property<const char *> const &cb);
159 void AddIntEntryData(ui::Entry object, Property<int> const &cb);
161 void AddSizeEntryData(ui::Entry object, Property<std::size_t> const &cb);
163 void AddFloatEntryData(ui::Entry object, Property<float> const &cb);
165 void AddFloatSpinnerData(ui::SpinButton object, Property<float> const &cb);
167 void AddIntSpinnerData(ui::SpinButton object, Property<int> const &cb);
169 void AddIntAdjustmentData(ui::Adjustment object, Property<int> const &cb);
171 void AddIntComboData(ui::ComboBox object, Property<int> const &cb);
173 void AddDialogData(ui::ToggleButton object, bool &data);
175 void AddDialogData(ui::RadioButton object, int &data);
177 void AddDialogData(ui::Entry object, CopiedString &data);
179 void AddDialogData(ui::Entry object, int &data);
181 void AddDialogData(ui::Entry object, std::size_t &data);
183 void AddDialogData(ui::Entry object, float &data);
185 void AddDialogData(ui::SpinButton object, float &data);
187 void AddDialogData(ui::SpinButton object, int &data);
189 void AddDialogData(ui::Adjustment object, int &data);
191 void AddDialogData(ui::ComboBox object, int &data);