struct BoolToggle {
- static void Export(const GtkToggleButton &self, const Callback<void(bool)> &returnz) {
- returnz(gtk_toggle_button_get_active(const_cast<GtkToggleButton *>(&self)) != FALSE);
+ static void Export(const ui::ToggleButton &self, const Callback<void(bool)> &returnz) {
+ returnz(self.active());
}
- static void Import(GtkToggleButton &self, bool value) {
- gtk_toggle_button_set_active(&self, value);
+ static void Import(ui::ToggleButton &self, bool value) {
+ self.active(value);
}
};
-using BoolToggleImportExport = PropertyAdaptor<GtkToggleButton, bool, BoolToggle>;
+using BoolToggleImportExport = PropertyAdaptor<ui::ToggleButton, bool, BoolToggle>;
struct IntEntry {
- static void Export(const GtkEntry &self, const Callback<void(int)> &returnz) {
- returnz(atoi(gtk_entry_get_text(const_cast<GtkEntry *>(&self))));
+ static void Export(const ui::Entry &self, const Callback<void(int)> &returnz) {
+ returnz(atoi(gtk_entry_get_text(self)));
}
- static void Import(GtkEntry &self, int value) {
- entry_set_int(ui::Entry(&self), value);
+ static void Import(ui::Entry &self, int value) {
+ entry_set_int(self, value);
}
};
-using IntEntryImportExport = PropertyAdaptor<GtkEntry, int, IntEntry>;
+using IntEntryImportExport = PropertyAdaptor<ui::Entry, int, IntEntry>;
struct IntRadio {
- static void Export(const GtkRadioButton &self, const Callback<void(int)> &returnz) {
- returnz(radio_button_get_active(ui::RadioButton(const_cast<GtkRadioButton *>(&self))));
+ static void Export(const ui::RadioButton &self, const Callback<void(int)> &returnz) {
+ returnz(radio_button_get_active(self));
}
- static void Import(GtkRadioButton &self, int value) {
- radio_button_set_active(ui::RadioButton(&self), value);
+ static void Import(ui::RadioButton &self, int value) {
+ radio_button_set_active(self, value);
}
};
-using IntRadioImportExport = PropertyAdaptor<GtkRadioButton, int, IntRadio>;
+using IntRadioImportExport = PropertyAdaptor<ui::RadioButton, int, IntRadio>;
struct IntCombo {
- static void Export(const GtkComboBox &self, const Callback<void(int)> &returnz) {
- returnz(gtk_combo_box_get_active(const_cast<GtkComboBox *>(&self)));
+ static void Export(const ui::ComboBox &self, const Callback<void(int)> &returnz) {
+ returnz(gtk_combo_box_get_active(self));
}
- static void Import(GtkComboBox &self, int value) {
- gtk_combo_box_set_active(&self, value);
+ static void Import(ui::ComboBox &self, int value) {
+ gtk_combo_box_set_active(self, value);
}
};
-using IntComboImportExport = PropertyAdaptor<GtkComboBox, int, IntCombo>;
+using IntComboImportExport = PropertyAdaptor<ui::ComboBox, int, IntCombo>;
struct IntAdjustment {
- static void Export(const GtkAdjustment &self, const Callback<void(int)> &returnz) {
- returnz((int) gtk_adjustment_get_value(const_cast<GtkAdjustment *>(&self)));
+ static void Export(const ui::Adjustment &self, const Callback<void(int)> &returnz) {
+ returnz(int(gtk_adjustment_get_value(self)));
}
- static void Import(GtkAdjustment &self, int value) {
- gtk_adjustment_set_value(&self, value);
+ static void Import(ui::Adjustment &self, int value) {
+ gtk_adjustment_set_value(self, value);
}
};
-using IntAdjustmentImportExport = PropertyAdaptor<GtkAdjustment, int, IntAdjustment>;
+using IntAdjustmentImportExport = PropertyAdaptor<ui::Adjustment, int, IntAdjustment>;
struct IntSpinner {
- static void Export(const GtkSpinButton &self, const Callback<void(int)> &returnz) {
- returnz(gtk_spin_button_get_value_as_int(const_cast<GtkSpinButton *>(&self)));
+ static void Export(const ui::SpinButton &self, const Callback<void(int)> &returnz) {
+ returnz(gtk_spin_button_get_value_as_int(self));
}
- static void Import(GtkSpinButton &self, int value) {
- gtk_spin_button_set_value(&self, value);
+ static void Import(ui::SpinButton &self, int value) {
+ gtk_spin_button_set_value(self, value);
}
};
-using IntSpinnerImportExport = PropertyAdaptor<GtkSpinButton, int, IntSpinner>;
-
-using StringImportExport = PropertyAdaptor<CopiedString, const char *>;
+using IntSpinnerImportExport = PropertyAdaptor<ui::SpinButton, int, IntSpinner>;
struct TextEntry {
- static void Export(const GtkEntry &self, const Callback<void(const char *)> &returnz) {
- returnz(gtk_entry_get_text(const_cast<GtkEntry *>(&self)));
+ static void Export(const ui::Entry &self, const Callback<void(const char *)> &returnz) {
+ returnz(gtk_entry_get_text(self));
}
- static void Import(GtkEntry &self, const char *value) {
- ui::Entry(&self).text(value);
+ static void Import(ui::Entry &self, const char *value) {
+ self.text(value);
}
};
-using TextEntryImportExport = PropertyAdaptor<GtkEntry, const char *, TextEntry>;
+using TextEntryImportExport = PropertyAdaptor<ui::Entry, const char *, TextEntry>;
struct SizeEntry {
- static void Export(const GtkEntry &self, const Callback<void(std::size_t)> &returnz) {
- int value = atoi(gtk_entry_get_text(const_cast<GtkEntry *>(&self)));
+ static void Export(const ui::Entry &self, const Callback<void(std::size_t)> &returnz) {
+ int value = atoi(gtk_entry_get_text(self));
if (value < 0) {
value = 0;
}
returnz(value);
}
- static void Import(GtkEntry &self, std::size_t value) {
- entry_set_int(ui::Entry(&self), int(value));
+ static void Import(ui::Entry &self, std::size_t value) {
+ entry_set_int(self, int(value));
}
};
-using SizeEntryImportExport = PropertyAdaptor<GtkEntry, std::size_t, SizeEntry>;
+using SizeEntryImportExport = PropertyAdaptor<ui::Entry, std::size_t, SizeEntry>;
struct FloatEntry {
- static void Export(const GtkEntry &self, const Callback<void(float)> &returnz) {
- returnz((float) atof(gtk_entry_get_text(const_cast<GtkEntry *>(&self))));
+ static void Export(const ui::Entry &self, const Callback<void(float)> &returnz) {
+ returnz(float(atof(gtk_entry_get_text(self))));
}
- static void Import(GtkEntry &self, float value) {
- entry_set_float(ui::Entry(&self), value);
+ static void Import(ui::Entry &self, float value) {
+ entry_set_float(self, value);
}
};
-using FloatEntryImportExport = PropertyAdaptor<GtkEntry, float, FloatEntry>;
+using FloatEntryImportExport = PropertyAdaptor<ui::Entry, float, FloatEntry>;
struct FloatSpinner {
- static void Export(const GtkSpinButton &self, const Callback<void(float)> &returnz) {
- returnz(float(gtk_spin_button_get_value(const_cast<GtkSpinButton *>(&self))));
+ static void Export(const ui::SpinButton &self, const Callback<void(float)> &returnz) {
+ returnz(float(gtk_spin_button_get_value(self)));
}
- static void Import(GtkSpinButton &self, float value) {
- gtk_spin_button_set_value(&self, value);
+ static void Import(ui::SpinButton &self, float value) {
+ gtk_spin_button_set_value(self, value);
}
};
-using FloatSpinnerImportExport = PropertyAdaptor<GtkSpinButton, float, FloatSpinner>;
+using FloatSpinnerImportExport = PropertyAdaptor<ui::SpinButton, float, FloatSpinner>;
template<typename T>
class CallbackDialogData : public DLG_DATA {
- Property<T> m_cbWidget;
- Property<T> m_cbViewer;
+ Property<T> m_pWidget;
+ Property<T> m_pData;
public:
- CallbackDialogData(const Property<T> &cbWidget, const Property<T> &cbViewer)
- : m_cbWidget(cbWidget), m_cbViewer(cbViewer) {
+ CallbackDialogData(const Property<T> &pWidget, const Property<T> &pData)
+ : m_pWidget(pWidget), m_pData(pData) {
}
void release() {
}
void importData() const {
- m_cbViewer.get(m_cbWidget.set);
+ m_pData.get(m_pWidget.set);
}
void exportData() const {
- m_cbWidget.get(m_cbViewer.set);
+ m_pWidget.get(m_pData.set);
}
};
-template<typename Widget, typename Viewer>
-void AddData(DialogDataList &data, typename Widget::Type &widget, typename Viewer::Type &viewer) {
- data.push_back(
- new CallbackDialogData<typename Widget::Other>(
- make_property<Widget>(widget),
- make_property<Viewer>(viewer)
- )
- );
-}
-
-template<typename Widget>
-void AddCustomData(
- DialogDataList &data,
- typename Widget::Type &widget,
- Property<typename Widget::Other> const &cbViewer
-) {
- data.push_back(
- new CallbackDialogData<typename Widget::Other>(
- make_property<Widget>(widget),
- cbViewer
- )
- );
+template<class Widget>
+void AddDataCustom(DialogDataList &self, typename Widget::Type widget, Property<typename Widget::Other> const &property) {
+ using Self = typename Widget::Type;
+ using T = typename Widget::Other;
+ using native = typename std::remove_pointer<typename Self::native>::type;
+ struct Wrapper {
+ static void Export(const native &self, const Callback<void(T)> &returnz) {
+ native *p = &const_cast<native &>(self);
+ auto widget = Self(p);
+ Widget::Get::thunk_(widget, returnz);
+ }
+
+ static void Import(native &self, T value) {
+ native *p = &self;
+ auto widget = Self(p);
+ Widget::Set::thunk_(widget, value);
+ }
+ };
+ self.push_back(new CallbackDialogData<typename Widget::Other>(
+ make_property<PropertyAdaptor<native, T, Wrapper>>(*static_cast<native *>(widget)),
+ property
+ ));
+}
+
+template<class Widget, class D>
+void AddData(DialogDataList &self, typename Widget::Type widget, D &data) {
+ AddDataCustom<Widget>(self, widget, make_property<PropertyAdaptor<D, typename Widget::Other>>(data));
}
// =============================================================================
}
-void Dialog::AddBoolToggleData( GtkToggleButton& widget, Property<bool> const &cb ){
- AddCustomData<BoolToggleImportExport>( m_data, widget, cb );
+void Dialog::AddBoolToggleData( ui::ToggleButton widget, Property<bool> const &cb ){
+ AddDataCustom<BoolToggleImportExport>( m_data, widget, cb );
}
-void Dialog::AddIntRadioData( GtkRadioButton& widget, Property<int> const &cb ){
- AddCustomData<IntRadioImportExport>( m_data, widget, cb );
+void Dialog::AddIntRadioData( ui::RadioButton widget, Property<int> const &cb ){
+ AddDataCustom<IntRadioImportExport>( m_data, widget, cb );
}
-void Dialog::AddTextEntryData( GtkEntry& widget, Property<const char *> const &cb ){
- AddCustomData<TextEntryImportExport>( m_data, widget, cb );
+void Dialog::AddTextEntryData( ui::Entry widget, Property<const char *> const &cb ){
+ AddDataCustom<TextEntryImportExport>( m_data, widget, cb );
}
-void Dialog::AddIntEntryData( GtkEntry& widget, Property<int> const &cb ){
- AddCustomData<IntEntryImportExport>( m_data, widget, cb );
+void Dialog::AddIntEntryData( ui::Entry widget, Property<int> const &cb ){
+ AddDataCustom<IntEntryImportExport>( m_data, widget, cb );
}
-void Dialog::AddSizeEntryData( GtkEntry& widget, Property<std::size_t> const &cb ){
- AddCustomData<SizeEntryImportExport>( m_data, widget, cb );
+void Dialog::AddSizeEntryData( ui::Entry widget, Property<std::size_t> const &cb ){
+ AddDataCustom<SizeEntryImportExport>( m_data, widget, cb );
}
-void Dialog::AddFloatEntryData( GtkEntry& widget, Property<float> const &cb ){
- AddCustomData<FloatEntryImportExport>( m_data, widget, cb );
+void Dialog::AddFloatEntryData( ui::Entry widget, Property<float> const &cb ){
+ AddDataCustom<FloatEntryImportExport>( m_data, widget, cb );
}
-void Dialog::AddFloatSpinnerData( GtkSpinButton& widget, Property<float> const &cb ){
- AddCustomData<FloatSpinnerImportExport>( m_data, widget, cb );
+void Dialog::AddFloatSpinnerData( ui::SpinButton widget, Property<float> const &cb ){
+ AddDataCustom<FloatSpinnerImportExport>( m_data, widget, cb );
}
-void Dialog::AddIntSpinnerData( GtkSpinButton& widget, Property<int> const &cb ){
- AddCustomData<IntSpinnerImportExport>( m_data, widget, cb );
+void Dialog::AddIntSpinnerData( ui::SpinButton widget, Property<int> const &cb ){
+ AddDataCustom<IntSpinnerImportExport>( m_data, widget, cb );
}
-void Dialog::AddIntAdjustmentData( GtkAdjustment& widget, Property<int> const &cb ){
- AddCustomData<IntAdjustmentImportExport>( m_data, widget, cb );
+void Dialog::AddIntAdjustmentData( ui::Adjustment widget, Property<int> const &cb ){
+ AddDataCustom<IntAdjustmentImportExport>( m_data, widget, cb );
}
-void Dialog::AddIntComboData( GtkComboBox& widget, Property<int> const &cb ){
- AddCustomData<IntComboImportExport>( m_data, widget, cb );
+void Dialog::AddIntComboData( ui::ComboBox widget, Property<int> const &cb ){
+ AddDataCustom<IntComboImportExport>( m_data, widget, cb );
}
-void Dialog::AddDialogData( GtkToggleButton& widget, bool& data ){
- AddData<BoolToggleImportExport, PropertyAdaptor<bool>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::ToggleButton widget, bool& data ){
+ AddData<BoolToggleImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkRadioButton& widget, int& data ){
- AddData<IntRadioImportExport, PropertyAdaptor<int>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::RadioButton widget, int& data ){
+ AddData<IntRadioImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkEntry& widget, CopiedString& data ){
- AddData<TextEntryImportExport, StringImportExport>( m_data, widget, data );
+void Dialog::AddDialogData( ui::Entry widget, CopiedString& data ){
+ AddData<TextEntryImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkEntry& widget, int& data ){
- AddData<IntEntryImportExport, PropertyAdaptor<int>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::Entry widget, int& data ){
+ AddData<IntEntryImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkEntry& widget, std::size_t& data ){
- AddData<SizeEntryImportExport, PropertyAdaptor<std::size_t>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::Entry widget, std::size_t& data ){
+ AddData<SizeEntryImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkEntry& widget, float& data ){
- AddData<FloatEntryImportExport, PropertyAdaptor<float>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::Entry widget, float& data ){
+ AddData<FloatEntryImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkSpinButton& widget, float& data ){
- AddData<FloatSpinnerImportExport, PropertyAdaptor<float>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::SpinButton widget, float& data ){
+ AddData<FloatSpinnerImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkSpinButton& widget, int& data ){
- AddData<IntSpinnerImportExport, PropertyAdaptor<int>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::SpinButton widget, int& data ){
+ AddData<IntSpinnerImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkAdjustment& widget, int& data ){
- AddData<IntAdjustmentImportExport, PropertyAdaptor<int>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::Adjustment widget, int& data ){
+ AddData<IntAdjustmentImportExport>( m_data, widget, data );
}
-void Dialog::AddDialogData( GtkComboBox& widget, int& data ){
- AddData<IntComboImportExport, PropertyAdaptor<int>>( m_data, widget, data );
+void Dialog::AddDialogData( ui::ComboBox widget, int& data ){
+ AddData<IntComboImportExport>( m_data, widget, data );
}
void Dialog::exportData(){
ui::CheckButton Dialog::addCheckBox( ui::VBox vbox, const char* name, const char* flag, Property<bool> const &cb ){
auto check = ui::CheckButton( flag );
check.show();
- AddBoolToggleData( *GTK_TOGGLE_BUTTON( check ), cb );
+ AddBoolToggleData( check, cb );
DialogVBox_packRow( vbox, ui::Widget(DialogRow_new( name, check ) ));
return check;
gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), *i );
}
- AddIntComboData( *GTK_COMBO_BOX( combo ), cb );
+ AddIntComboData( combo, cb );
combo.show();
alignment.add(combo);
// adjustment
auto adj = ui::Adjustment( value, lower, upper, step_increment, page_increment, 0 );
- AddIntAdjustmentData(*GTK_ADJUSTMENT(adj), make_property(data));
+ AddIntAdjustmentData(adj, make_property(data));
// scale
auto alignment = ui::Alignment( 0.0, 0.5, 1.0, 0.0 );
{
RadioHBox radioBox = RadioHBox_new( names );
alignment.add(radioBox.m_hbox);
- AddIntRadioData( *GTK_RADIO_BUTTON( radioBox.m_radio ), cb );
+ AddIntRadioData( radioBox.m_radio, cb );
}
auto row = DialogRow_new( name, alignment );
group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
}
- AddIntRadioData( *GTK_RADIO_BUTTON( radio ), cb );
+ AddIntRadioData( radio, cb );
DialogVBox_packRow( vbox, DialogRow_new( name, table ) );
}
ui::Widget Dialog::addIntEntry( ui::VBox vbox, const char* name, Property<int> const &cb ){
DialogEntryRow row( DialogEntryRow_new( name ) );
- AddIntEntryData( *GTK_ENTRY(row.m_entry), cb );
+ AddIntEntryData( row.m_entry, cb );
DialogVBox_packRow( vbox, row.m_row );
return row.m_row;
}
ui::Widget Dialog::addSizeEntry( ui::VBox vbox, const char* name, Property<std::size_t> const &cb ){
DialogEntryRow row( DialogEntryRow_new( name ) );
- AddSizeEntryData( *GTK_ENTRY(row.m_entry), cb );
+ AddSizeEntryData( row.m_entry, cb );
DialogVBox_packRow( vbox, row.m_row );
return row.m_row;
}
ui::Widget Dialog::addFloatEntry( ui::VBox vbox, const char* name, Property<float> const &cb ){
DialogEntryRow row( DialogEntryRow_new( name ) );
- AddFloatEntryData( *GTK_ENTRY(row.m_entry), cb );
+ AddFloatEntryData( row.m_entry, cb );
DialogVBox_packRow( vbox, row.m_row );
return row.m_row;
}
PathEntry pathEntry = PathEntry_new();
pathEntry.m_button.connect( "clicked", G_CALLBACK( browse_directory ? button_clicked_entry_browse_directory : button_clicked_entry_browse_file ), pathEntry.m_entry );
- AddTextEntryData( *GTK_ENTRY(pathEntry.m_entry), cb );
+ AddTextEntryData( pathEntry.m_entry, cb );
auto row = DialogRow_new( name, ui::Widget(pathEntry.m_frame ) );
DialogVBox_packRow( vbox, row );
ui::SpinButton Dialog::addSpinner( ui::VBox vbox, const char* name, double value, double lower, double upper, Property<int> const &cb ){
DialogSpinnerRow row( DialogSpinnerRow_new( name, value, lower, upper, 1 ) );
- AddIntSpinnerData( *GTK_SPIN_BUTTON(row.m_spin), cb );
+ AddIntSpinnerData( row.m_spin, cb );
DialogVBox_packRow( vbox, row.m_row );
return row.m_spin;
}
ui::SpinButton Dialog::addSpinner( ui::VBox vbox, const char* name, double value, double lower, double upper, Property<float> const &cb ){
DialogSpinnerRow row( DialogSpinnerRow_new( name, value, lower, upper, 10 ) );
- AddFloatSpinnerData( *GTK_SPIN_BUTTON(row.m_spin), cb );
+ AddFloatSpinnerData( row.m_spin, cb );
DialogVBox_packRow( vbox, row.m_row );
return row.m_spin;
}
typedef std::list<DLG_DATA*> DialogDataList;
-class Dialog
-{
-ui::Window m_window;
-DialogDataList m_data;
+class Dialog {
+ ui::Window m_window;
+ DialogDataList m_data;
public:
-ModalDialog m_modal;
-ui::Window m_parent;
+ ModalDialog m_modal;
+ ui::Window m_parent;
+
+ Dialog();
-Dialog();
-virtual ~Dialog();
+ virtual ~Dialog();
/*!
start modal dialog box
you need to use AddModalButton to select eIDOK eIDCANCEL buttons
*/
-EMessageBoxReturn DoModal();
-void EndModal( EMessageBoxReturn code );
-virtual ui::Window BuildDialog() = 0;
-virtual void exportData();
-virtual void importData();
-virtual void PreModal() { };
-virtual void PostModal( EMessageBoxReturn code ) { };
-virtual void ShowDlg();
-virtual void HideDlg();
-void Create();
-void Destroy();
-ui::Window GetWidget(){
- return m_window;
-}
-const ui::Window GetWidget() const {
- return m_window;
-}
-
- ui::CheckButton addCheckBox(ui::VBox vbox, const char *name, const char *flag, Property<bool> const &cb);
-ui::CheckButton addCheckBox( ui::VBox vbox, const char* name, const char* flag, bool& data );
-
- void addCombo(ui::VBox vbox, const char *name, StringArrayRange values, Property<int> const &cb);
-void addCombo( ui::VBox vbox, const char* name, int& data, StringArrayRange values );
-void addSlider( ui::VBox vbox, const char* name, int& data, gboolean draw_value, const char* low, const char* high, double value, double lower, double upper, double step_increment, double page_increment );
-
- void addRadio(ui::VBox vbox, const char *name, StringArrayRange names, Property<int> const &cb);
-void addRadio( ui::VBox vbox, const char* name, int& data, StringArrayRange names );
-
- void addRadioIcons(ui::VBox vbox, const char *name, StringArrayRange icons, Property<int> const &cb);
-void addRadioIcons( ui::VBox vbox, const char* name, int& data, StringArrayRange icons );
-
- ui::Widget addIntEntry(ui::VBox vbox, const char *name, Property<int> const &cb);
-ui::Widget addEntry( ui::VBox vbox, const char* name, int& data ){
- return addIntEntry(vbox, name, make_property(data));
-}
-
- ui::Widget addSizeEntry(ui::VBox vbox, const char *name, Property<std::size_t> const &cb);
-ui::Widget addEntry( ui::VBox vbox, const char* name, std::size_t& data ){
- return addSizeEntry(vbox, name, make_property(data));
-}
-
- ui::Widget addFloatEntry(ui::VBox vbox, const char *name, Property<float> const &cb);
-ui::Widget addEntry( ui::VBox vbox, const char* name, float& data ){
- return addFloatEntry(vbox, name, make_property(data));
-}
-
- ui::Widget
- addPathEntry(ui::VBox vbox, const char *name, bool browse_directory, Property<const char *> const &cb);
-ui::Widget addPathEntry( ui::VBox vbox, const char* name, CopiedString& data, bool directory );
-ui::SpinButton addSpinner( ui::VBox vbox, const char* name, int& data, double value, double lower, double upper );
-
- ui::SpinButton
- addSpinner(ui::VBox vbox, const char *name, double value, double lower, double upper, Property<int> const &cb);
-
- ui::SpinButton addSpinner(ui::VBox vbox, const char *name, double value, double lower, double upper,
- Property<float> const &cb);
+ EMessageBoxReturn DoModal();
+
+ void EndModal(EMessageBoxReturn code);
+
+ virtual ui::Window BuildDialog() = 0;
+
+ virtual void exportData();
+
+ virtual void importData();
+
+ virtual void PreModal() {};
+
+ virtual void PostModal(EMessageBoxReturn code) {};
+
+ virtual void ShowDlg();
+
+ virtual void HideDlg();
+
+ void Create();
+
+ void Destroy();
+
+ ui::Window GetWidget() {
+ return m_window;
+ }
+
+ const ui::Window GetWidget() const {
+ return m_window;
+ }
+
+ ui::CheckButton addCheckBox(ui::VBox vbox, const char *name, const char *flag, Property<bool> const &cb);
+
+ ui::CheckButton addCheckBox(ui::VBox vbox, const char *name, const char *flag, bool &data);
+
+ void addCombo(ui::VBox vbox, const char *name, StringArrayRange values, Property<int> const &cb);
+
+ void addCombo(ui::VBox vbox, const char *name, int &data, StringArrayRange values);
+
+ void addSlider(ui::VBox vbox, const char *name, int &data, gboolean draw_value, const char *low, const char *high,
+ double value, double lower, double upper, double step_increment, double page_increment);
+
+ void addRadio(ui::VBox vbox, const char *name, StringArrayRange names, Property<int> const &cb);
+
+ void addRadio(ui::VBox vbox, const char *name, int &data, StringArrayRange names);
+
+ void addRadioIcons(ui::VBox vbox, const char *name, StringArrayRange icons, Property<int> const &cb);
+
+ void addRadioIcons(ui::VBox vbox, const char *name, int &data, StringArrayRange icons);
+
+ ui::Widget addIntEntry(ui::VBox vbox, const char *name, Property<int> const &cb);
+
+ ui::Widget addEntry(ui::VBox vbox, const char *name, int &data) {
+ return addIntEntry(vbox, name, make_property(data));
+ }
+
+ ui::Widget addSizeEntry(ui::VBox vbox, const char *name, Property<std::size_t> const &cb);
+
+ ui::Widget addEntry(ui::VBox vbox, const char *name, std::size_t &data) {
+ return addSizeEntry(vbox, name, make_property(data));
+ }
+
+ ui::Widget addFloatEntry(ui::VBox vbox, const char *name, Property<float> const &cb);
+
+ ui::Widget addEntry(ui::VBox vbox, const char *name, float &data) {
+ return addFloatEntry(vbox, name, make_property(data));
+ }
+
+ ui::Widget addPathEntry(ui::VBox vbox, const char *name, bool browse_directory, Property<const char *> const &cb);
+
+ ui::Widget addPathEntry(ui::VBox vbox, const char *name, CopiedString &data, bool directory);
+
+ ui::SpinButton addSpinner(ui::VBox vbox, const char *name, int &data, double value, double lower, double upper);
+
+ ui::SpinButton
+ addSpinner(ui::VBox vbox, const char *name, double value, double lower, double upper, Property<int> const &cb);
+
+ ui::SpinButton
+ addSpinner(ui::VBox vbox, const char *name, double value, double lower, double upper, Property<float> const &cb);
protected:
- void AddBoolToggleData(struct _GtkToggleButton &object, Property<bool> const &cb);
+ void AddBoolToggleData(ui::ToggleButton object, Property<bool> const &cb);
+
+ void AddIntRadioData(ui::RadioButton object, Property<int> const &cb);
+
+ void AddTextEntryData(ui::Entry object, Property<const char *> const &cb);
+
+ void AddIntEntryData(ui::Entry object, Property<int> const &cb);
+
+ void AddSizeEntryData(ui::Entry object, Property<std::size_t> const &cb);
+
+ void AddFloatEntryData(ui::Entry object, Property<float> const &cb);
+
+ void AddFloatSpinnerData(ui::SpinButton object, Property<float> const &cb);
+
+ void AddIntSpinnerData(ui::SpinButton object, Property<int> const &cb);
+
+ void AddIntAdjustmentData(ui::Adjustment object, Property<int> const &cb);
+
+ void AddIntComboData(ui::ComboBox object, Property<int> const &cb);
- void AddIntRadioData(struct _GtkRadioButton &object, Property<int> const &cb);
+ void AddDialogData(ui::ToggleButton object, bool &data);
- void AddTextEntryData(struct _GtkEntry &object, Property<const char *> const &cb);
+ void AddDialogData(ui::RadioButton object, int &data);
- void AddIntEntryData(struct _GtkEntry &object, Property<int> const &cb);
+ void AddDialogData(ui::Entry object, CopiedString &data);
- void AddSizeEntryData(struct _GtkEntry &object, Property<std::size_t> const &cb);
+ void AddDialogData(ui::Entry object, int &data);
- void AddFloatEntryData(struct _GtkEntry &object, Property<float> const &cb);
+ void AddDialogData(ui::Entry object, std::size_t &data);
- void AddFloatSpinnerData(struct _GtkSpinButton &object, Property<float> const &cb);
+ void AddDialogData(ui::Entry object, float &data);
- void AddIntSpinnerData(struct _GtkSpinButton &object, Property<int> const &cb);
+ void AddDialogData(ui::SpinButton object, float &data);
- void AddIntAdjustmentData(struct _GtkAdjustment &object, Property<int> const &cb);
+ void AddDialogData(ui::SpinButton object, int &data);
- void AddIntComboData(struct _GtkComboBox &object, Property<int> const &cb);
+ void AddDialogData(ui::Adjustment object, int &data);
-void AddDialogData( struct _GtkToggleButton& object, bool& data );
-void AddDialogData( struct _GtkRadioButton& object, int& data );
-void AddDialogData( struct _GtkEntry& object, CopiedString& data );
-void AddDialogData( struct _GtkEntry& object, int& data );
-void AddDialogData( struct _GtkEntry& object, std::size_t& data );
-void AddDialogData( struct _GtkEntry& object, float& data );
-void AddDialogData( struct _GtkSpinButton& object, float& data );
-void AddDialogData( struct _GtkSpinButton& object, int& data );
-void AddDialogData( struct _GtkAdjustment& object, int& data );
-void AddDialogData( struct _GtkComboBox& object, int& data );
+ void AddDialogData(ui::ComboBox object, int &data);
};
#endif