void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, int defcols, int maxrows, int maxcols ){
ModalDialog dialog;
- GtkComboBox* width;
- GtkComboBox* height;
ui::Window window = MainFrame_getWindow().create_dialog_window("Patch density", G_CALLBACK(dialog_delete_callback ), &dialog );
auto accel = ui::AccelGroup(ui::New);
window.add_accel_group( accel );
-
+ auto width = ui::ComboBoxText(ui::New);
+ auto height = ui::ComboBoxText(ui::New);
{
auto hbox = create_dialog_hbox( 4, 4 );
window.add(hbox);
}
{
- auto combo = ui::ComboBoxText(ui::New);
+ auto combo = width;
#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_text_append_text( combo, #x )
D_ITEM( 3 );
D_ITEM( 5 );
#undef D_ITEM
combo.show();
table.attach(combo, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, 0});
-
- width = combo;
}
{
- auto combo = ui::ComboBoxText(ui::New);
+ auto combo = height;
#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_text_append_text( combo, #x )
D_ITEM( 3 );
D_ITEM( 5 );
#undef D_ITEM
combo.show();
table.attach(combo, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, 0});
-
- height = combo;
}
}
GSList* group = 0;
{
- ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Bevel" ));
+ ui::Widget button = ui::Widget::from(gtk_radio_button_new_with_label( group, "Bevel" ));
button.show();
table.attach(button, {1, 2, 0, 1}, {GTK_FILL | GTK_EXPAND, 0});
group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
bevel = button;
}
{
- ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Endcap" ));
+ ui::Widget button = ui::Widget::from(gtk_radio_button_new_with_label( group, "Endcap" ));
button.show();
table.attach(button, {1, 2, 1, 2}, {GTK_FILL | GTK_EXPAND, 0});
group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
endcap = button;
}
{
- ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Inverted Bevel" ));
+ ui::Widget button = ui::Widget::from(gtk_radio_button_new_with_label( group, "Inverted Bevel" ));
button.show();
table.attach(button, {1, 2, 2, 3}, {GTK_FILL | GTK_EXPAND, 0});
group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
ibevel = button;
}
{
- ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Inverted Endcap" ));
+ ui::Widget button = ui::Widget::from(gtk_radio_button_new_with_label( group, "Inverted Endcap" ));
button.show();
table.attach(button, {1, 2, 3, 4}, {GTK_FILL | GTK_EXPAND, 0});
group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );
iendcap = button;
}
{
- ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Cylinder" ));
+ ui::Widget button = ui::Widget::from(gtk_radio_button_new_with_label( group, "Cylinder" ));
button.show();
table.attach(button, {1, 2, 4, 5}, {GTK_FILL | GTK_EXPAND, 0});
group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) );