/** * Constructor. Configure the dialog window and create all the contained * widgets. Connect widgets to callbacks as necessary. * * @param key The unique key identifying this dialog. */ SetScaleDialog::SetScaleDialog(const std::string& key) : GenericDialog(key), _nullVisitor(new MeshVisitor()) { // Enable the usual handling of the close event. CreateWindowCloseCallback(); // Configure the dialog window. gtk_window_set_resizable(GTK_WINDOW(_dialog), FALSE); gtk_window_set_title(GTK_WINDOW(_dialog), DIALOG_SET_SCALE_TITLE); gtk_container_set_border_width(GTK_CONTAINER(_dialog), 10); // Create the contained widgets. GtkWidget *table; GtkWidget *entry; GtkWidget *applybutton, *refbutton, *button; GtkWidget *label; GtkWidget *mainvbox, *vbox, *hbox; GtkWidget *frame; table = gtk_table_new(2, 2, FALSE); gtk_table_set_row_spacing(GTK_TABLE(table), 0, 15); gtk_table_set_col_spacing(GTK_TABLE(table), 0, 10); gtk_container_add(GTK_CONTAINER(_dialog), table); gtk_widget_show(table); // Checkbox for the "S" grouping of widgets. All the widgets in that // grouping will have a dependence registered on this checkbox; i.e. they // will only be active when it is checked. applybutton = gtk_check_button_new_with_label(DIALOG_SET_SCALE_S_ACTIVE_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "s_apply", applybutton); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(applybutton), TRUE); gtk_widget_show(applybutton); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), applybutton); gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 0, 1); gtk_widget_show(frame); mainvbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), mainvbox); gtk_widget_show(mainvbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying S scaling. label = gtk_label_new(DIALOG_SET_SCALE_METHOD_FRAME_TITLE); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), label); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new_with_label(NULL, DIALOG_SET_SCALE_TILES_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "s_tiling", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_tiles", entry); gtk_entry_set_text(GTK_ENTRY(entry), "1"); gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 50, -2); gtk_widget_set_sensitive(entry, FALSE); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); UIInstance().RegisterWidgetDependence(button, entry); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_SET_SCALE_NATURAL_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "s_natural", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_scale", entry); gtk_entry_set_text(GTK_ENTRY(entry), "1"); gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 50, -2); gtk_widget_set_sensitive(entry, TRUE); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); UIInstance().RegisterWidgetDependence(button, entry); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying the alignment column. label = gtk_label_new(DIALOG_SET_SCALE_S_ALIGN_FRAME_TITLE); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), label); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new(NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "col_num_align", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 25, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); UIInstance().RegisterWidgetDependence(button, entry); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_SET_SCALE_MAX_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "col_max_align", button); gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, FALSE, 5); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying the reference row & usage. refbutton = gtk_check_button_new_with_label(DIALOG_SET_SCALE_S_REF_ROW_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "row_ref", refbutton); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(refbutton), TRUE); gtk_widget_show(refbutton); UIInstance().RegisterWidgetDependence(applybutton, refbutton); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), refbutton); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new(NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); UIInstance().RegisterWidgetDependence(refbutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "row_num_ref", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 25, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); UIInstance().RegisterWidgetDependence(refbutton, entry); UIInstance().RegisterWidgetDependence(button, entry); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_SET_SCALE_MAX_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "row_max_ref", button); gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, FALSE, 5); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); UIInstance().RegisterWidgetDependence(refbutton, button); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_check_button_new_with_label(DIALOG_SET_SCALE_REF_TOTAL_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "row_ref_total", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); UIInstance().RegisterWidgetDependence(refbutton, button); // Checkbox for the "T" grouping of widgets. All the widgets in that // grouping will have a dependence registered on this checkbox; i.e. they // will only be active when it is checked. applybutton = gtk_check_button_new_with_label(DIALOG_SET_SCALE_T_ACTIVE_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "t_apply", applybutton); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(applybutton), TRUE); gtk_widget_show(applybutton); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), applybutton); gtk_table_attach_defaults(GTK_TABLE(table), frame, 1, 2, 0, 1); gtk_widget_show(frame); mainvbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), mainvbox); gtk_widget_show(mainvbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying T scaling. label = gtk_label_new(DIALOG_SET_SCALE_METHOD_FRAME_TITLE); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), label); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new_with_label(NULL, DIALOG_SET_SCALE_TILES_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "t_tiling", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_tiles", entry); gtk_entry_set_text(GTK_ENTRY(entry), "1"); gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 50, -2); gtk_widget_set_sensitive(entry, FALSE); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); UIInstance().RegisterWidgetDependence(button, entry); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_SET_SCALE_NATURAL_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "t_natural", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_scale", entry); gtk_entry_set_text(GTK_ENTRY(entry), "1"); gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 50, -2); gtk_widget_set_sensitive(entry, TRUE); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); UIInstance().RegisterWidgetDependence(button, entry); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying the alignment row. label = gtk_label_new(DIALOG_SET_SCALE_T_ALIGN_FRAME_TITLE); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), label); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new(NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "row_num_align", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 25, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); UIInstance().RegisterWidgetDependence(button, entry); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_SET_SCALE_MAX_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "row_max_align", button); gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, FALSE, 5); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying the reference column & usage. refbutton = gtk_check_button_new_with_label(DIALOG_SET_SCALE_T_REF_COL_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "col_ref", refbutton); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(refbutton), TRUE); gtk_widget_show(refbutton); UIInstance().RegisterWidgetDependence(applybutton, refbutton); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), refbutton); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new(NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); UIInstance().RegisterWidgetDependence(refbutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "col_num_ref", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 25, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); UIInstance().RegisterWidgetDependence(refbutton, entry); UIInstance().RegisterWidgetDependence(button, entry); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_SET_SCALE_MAX_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "col_max_ref", button); gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, FALSE, 5); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); UIInstance().RegisterWidgetDependence(refbutton, button); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_check_button_new_with_label(DIALOG_SET_SCALE_REF_TOTAL_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "col_ref_total", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(applybutton, button); UIInstance().RegisterWidgetDependence(refbutton, button); hbox = gtk_hbox_new(FALSE, 0); gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 2, 1, 2); gtk_widget_show(hbox); // Create Cancel button and hook it to callback. button = gtk_button_new_with_label(DIALOG_CANCEL_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize(button, 60, -2); gtk_widget_show(button); CreateCancelButtonCallback(button); // Create Apply button and hook it to callback. button = gtk_button_new_with_label(DIALOG_APPLY_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 10); gtk_widget_set_usize (button, 60, -2); gtk_widget_show(button); CreateApplyButtonCallback(button); // Create OK button and hook it to callback. button = gtk_button_new_with_label(DIALOG_OK_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 60, -2); gtk_widget_show(button); CreateOkButtonCallback(button); }
/** * Constructor. Configure the dialog window and create all the contained * widgets. Connect widgets to callbacks as necessary. * * @param key The unique key identifying this dialog. */ GeneralFunctionDialog::GeneralFunctionDialog(const std::string& key) : GenericDialog(key), _nullVisitor(new MeshVisitor()) { // Enable the usual handling of the close event. CreateWindowCloseCallback(); // Configure the dialog window. gtk_window_set_resizable(GTK_WINDOW(_dialog), FALSE); gtk_window_set_title(GTK_WINDOW(_dialog), DIALOG_GEN_FUNC_TITLE); gtk_container_set_border_width(GTK_CONTAINER(_dialog), 10); // Create the contained widgets. GtkWidget *table; GtkWidget *entry; GtkWidget *applybutton, *refbutton, *button; GtkWidget *separator; GtkWidget *label; GtkWidget *mainvbox, *vbox, *hbox, *mainhbox; GtkWidget *frame; table = gtk_table_new(6, 13, FALSE); gtk_table_set_row_spacing(GTK_TABLE(table), 0, 5); gtk_table_set_row_spacing(GTK_TABLE(table), 1, 10); gtk_table_set_row_spacing(GTK_TABLE(table), 3, 15); gtk_table_set_row_spacing(GTK_TABLE(table), 4, 15); gtk_container_add(GTK_CONTAINER(_dialog), table); gtk_widget_show(table); hbox = gtk_hbox_new(TRUE, 10); gtk_table_attach(GTK_TABLE(table), hbox, 0, 13, 0, 1, GTK_SHRINK, GTK_EXPAND, 0, 0); gtk_widget_show(hbox); // Mutually exclusive "Surface values" and "Control values" radio buttons. button = gtk_radio_button_new_with_label(NULL, DIALOG_GEN_FUNC_SURFACE_VALUES); gtk_object_set_data(GTK_OBJECT(_dialog), "surface", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_GEN_FUNC_CONTROL_VALUES); gtk_object_set_data(GTK_OBJECT(_dialog), "control", button); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); separator = gtk_hseparator_new(); gtk_table_attach_defaults(GTK_TABLE(table), separator, 0, 13, 1, 2); gtk_widget_show(separator); // Checkbox for the "S" row of factors. All the other widgets on this row // will have a dependence registered on this checkbox; i.e. they will only // be active when it is checked. applybutton = gtk_check_button_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_apply", applybutton); gtk_table_attach_defaults(GTK_TABLE(table), applybutton, 0, 1, 2, 3); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(applybutton), TRUE); gtk_widget_show(applybutton); label = gtk_label_new(DIALOG_GEN_FUNC_S_FUNC_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 2, 3); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_oldval", entry); gtk_entry_set_text(GTK_ENTRY(entry), "1.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 2, 3, 2, 3); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_OLD_S_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 3, 4, 2, 3); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_rowdist", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 4, 5, 2, 3); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_ROW_DIST_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 5, 6, 2, 3); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_coldist", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 6, 7, 2, 3); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_COL_DIST_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 7, 8, 2, 3); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_rownum", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 8, 9, 2, 3); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_ROW_NUM_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 9, 10, 2, 3); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_colnum", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 10, 11, 2, 3); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_COL_NUM_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 11, 12, 2, 3); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_constant", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 12, 13, 2, 3); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); // Checkbox for the "T" row of factors. All the other widgets on this row // will have a dependence registered on this checkbox; i.e. they will only // be active when it is checked. applybutton = gtk_check_button_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_apply", applybutton); gtk_table_attach_defaults(GTK_TABLE(table), applybutton, 0, 1, 3, 4); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(applybutton), TRUE); gtk_widget_show(applybutton); label = gtk_label_new(DIALOG_GEN_FUNC_T_FUNC_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 3, 4); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_oldval", entry); gtk_entry_set_text(GTK_ENTRY(entry), "1.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 2, 3, 3, 4); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_OLD_T_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 3, 4, 3, 4); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_rowdist", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 4, 5, 3, 4); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_ROW_DIST_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 5, 6, 3, 4); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_coldist", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 6, 7, 3, 4); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_COL_DIST_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 7, 8, 3, 4); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_rownum", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 8, 9, 3, 4); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_ROW_NUM_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 9, 10, 3, 4); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_colnum", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 10, 11, 3, 4); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); label = gtk_label_new(DIALOG_GEN_FUNC_COL_NUM_LABEL); gtk_table_attach_defaults(GTK_TABLE(table), label, 11, 12, 3, 4); gtk_widget_show(label); UIInstance().RegisterWidgetDependence(applybutton, label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_constant", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0.0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 12, 13, 3, 4); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(applybutton, entry); mainhbox = gtk_hbox_new(TRUE, 0); gtk_table_attach(GTK_TABLE(table), mainhbox, 0, 13, 4, 5, GTK_SHRINK, GTK_EXPAND, 0, 0); gtk_widget_show(mainhbox); mainvbox = gtk_vbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainhbox), mainvbox, FALSE, FALSE, 0); gtk_widget_show(mainvbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); frame = gtk_frame_new(DIALOG_GEN_FUNC_COL_ALIGN_FRAME_LABEL); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying the alignment column. button = gtk_radio_button_new(NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "col_num_align", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 25, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(button, entry); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_GEN_FUNC_MAX_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "col_max_align", button); gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, FALSE, 5); gtk_widget_show(button); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying the reference row & usage. refbutton = gtk_check_button_new_with_label(DIALOG_GEN_FUNC_REF_ROW_FRAME_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "row_ref", refbutton); gtk_widget_show(refbutton); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), refbutton); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new(NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(refbutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "row_num_ref", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 25, -2); gtk_widget_set_sensitive(entry, FALSE); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(refbutton, entry); UIInstance().RegisterWidgetDependence(button, entry); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_GEN_FUNC_MAX_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "row_max_ref", button); gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, FALSE, 5); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(refbutton, button); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_check_button_new_with_label(DIALOG_GEN_FUNC_REF_TOTAL_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "row_ref_total", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(refbutton, button); mainvbox = gtk_vbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(mainhbox), mainvbox, FALSE, FALSE, 0); gtk_widget_show(mainvbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); frame = gtk_frame_new(DIALOG_GEN_FUNC_ROW_ALIGN_FRAME_LABEL); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying the alignment row. button = gtk_radio_button_new(NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "row_num_align", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 25, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(button, entry); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_GEN_FUNC_MAX_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "row_max_align", button); gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, FALSE, 5); gtk_widget_show(button); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); // Widgets for specifying the reference column & usage. refbutton = gtk_check_button_new_with_label(DIALOG_GEN_FUNC_REF_COL_FRAME_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "col_ref", refbutton); gtk_widget_show(refbutton); frame = gtk_frame_new(NULL); gtk_frame_set_label_widget(GTK_FRAME(frame), refbutton); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 5); gtk_widget_show(frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_radio_button_new(NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(refbutton, button); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "col_num_ref", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5); gtk_widget_set_usize(entry, 25, -2); gtk_widget_set_sensitive(entry, FALSE); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(refbutton, entry); UIInstance().RegisterWidgetDependence(button, entry); button = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(button)), DIALOG_GEN_FUNC_MAX_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "col_max_ref", button); gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, FALSE, 5); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(refbutton, button); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); gtk_widget_show(hbox); button = gtk_check_button_new_with_label(DIALOG_GEN_FUNC_REF_TOTAL_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "col_ref_total", button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); UIInstance().RegisterWidgetDependence(refbutton, button); hbox = gtk_hbox_new(FALSE, 0); gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 13, 5, 6); gtk_widget_show(hbox); // Create Cancel button and hook it to callback. button = gtk_button_new_with_label(DIALOG_CANCEL_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize(button, 60, -2); gtk_widget_show(button); CreateCancelButtonCallback(button); // Create Apply button and hook it to callback. button = gtk_button_new_with_label(DIALOG_APPLY_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 10); gtk_widget_set_usize (button, 60, -2); gtk_widget_show(button); CreateApplyButtonCallback(button); // Create OK button and hook it to callback. button = gtk_button_new_with_label(DIALOG_OK_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 60, -2); gtk_widget_show(button); CreateOkButtonCallback(button); }
/** * Constructor. Connect the row and column texture info callbacks to the * appropriate methods on the Set S/T Scale dialog object. Configure the * dialog window and create all the contained widgets. Connect widgets to * callbacks as necessary. * * @param key The unique key identifying this dialog. * @param setScaleDialog Reference-counted handle on the Set S/T Scale dialog. */ GetInfoDialog::GetInfoDialog(const std::string& key, SmartPointer<SetScaleDialog>& setScaleDialog) : GenericDialog(key), _setScaleDialog(setScaleDialog), _rowTexInfoCallback( MeshEntity::TexInfoCallbackMethod<SetScaleDialog, &SetScaleDialog::PopulateSWidgets>(*setScaleDialog)), _colTexInfoCallback( MeshEntity::TexInfoCallbackMethod<SetScaleDialog, &SetScaleDialog::PopulateTWidgets>(*setScaleDialog)), _nullVisitor(new MeshVisitor()) { // Enable the usual handling of the close event. CreateWindowCloseCallback(); // Configure the dialog window. gtk_window_set_resizable(GTK_WINDOW(_dialog), FALSE); gtk_window_set_title(GTK_WINDOW(_dialog), DIALOG_GET_INFO_TITLE); gtk_container_set_border_width(GTK_CONTAINER(_dialog), 10); // Create the contained widgets. GtkWidget *table; GtkWidget *entry; GtkWidget *button; GtkWidget *label; GtkWidget *hbox; table = gtk_table_new(4, 3, FALSE); gtk_table_set_row_spacing(GTK_TABLE(table), 1, 10); gtk_table_set_row_spacing(GTK_TABLE(table), 2, 15); gtk_container_add(GTK_CONTAINER(_dialog), table); gtk_widget_show(table); // Widgets for specifying the reference row if any. button = gtk_check_button_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_apply", button); gtk_table_attach_defaults(GTK_TABLE(table), button, 0, 1, 0, 1); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); label = gtk_label_new(DIALOG_GET_INFO_S_ROW_HEADER); gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT); gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 0, 1); gtk_widget_show(label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "s_ref_row", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 2, 3, 0, 1); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(button, label); UIInstance().RegisterWidgetDependence(button, entry); // Widgets for specifying the reference column if any. button = gtk_check_button_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_apply", button); gtk_table_attach_defaults(GTK_TABLE(table), button, 0, 1, 1, 2); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); gtk_widget_show(button); label = gtk_label_new(DIALOG_GET_INFO_T_COL_HEADER); gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT); gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 1, 2); gtk_widget_show(label); entry = gtk_entry_new(); gtk_object_set_data(GTK_OBJECT(_dialog), "t_ref_col", entry); gtk_entry_set_text(GTK_ENTRY(entry), "0"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 2, 3, 1, 2); gtk_widget_set_usize(entry, 50, -2); gtk_widget_show(entry); UIInstance().RegisterWidgetDependence(button, label); UIInstance().RegisterWidgetDependence(button, entry); // Checkbox to enable the callbacks to Set S/T Scale. button = gtk_check_button_new_with_label(DIALOG_GET_INFO_XFER_OPT_LABEL); gtk_object_set_data(GTK_OBJECT(_dialog), "transfer", button); gtk_table_attach(GTK_TABLE(table), button, 0, 3, 2, 3, GTK_EXPAND, GTK_EXPAND, 0, 0); gtk_widget_show(button); hbox = gtk_hbox_new(FALSE, 0); gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 3, 3, 4); gtk_widget_show(hbox); // Create Cancel button and hook it to callback. button = gtk_button_new_with_label(DIALOG_CANCEL_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize(button, 60, -2); gtk_widget_show(button); CreateCancelButtonCallback(button); // Create Apply button and hook it to callback. button = gtk_button_new_with_label(DIALOG_APPLY_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 10); gtk_widget_set_usize (button, 60, -2); gtk_widget_show(button); CreateApplyButtonCallback(button); // Create OK button and hook it to callback. button = gtk_button_new_with_label(DIALOG_OK_BUTTON); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 60, -2); gtk_widget_show(button); CreateOkButtonCallback(button); }