static void populate_notebook (gpointer data, gpointer user_data) { gchar *header_name; GtkWidget *header = NULL; GtkWidget *h_data; GtkWidget *scrolled_window; GtkWidget *notebook; notebook = (GtkWidget *) user_data; header_name = (gchar *) data; if (strcmp (header_name, "comment")) { header = gtk_label_new (header_name); gtk_label_set_text (GTK_LABEL (header), header_name); h_data = create_tree_view (); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add (GTK_CONTAINER (scrolled_window), h_data); gtk_notebook_append_page_menu (GTK_NOTEBOOK (notebook), scrolled_window, header, NULL); gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (notebook), scrolled_window, TRUE); g_hash_table_insert (ui->notebook_hash, header_name, scrolled_window); } }
/** \brief Description yet to be added. **/ static int addPage ( GtkNotebook *notebook, Tcl_Interp *interp, Tcl_Obj *child, Tcl_Obj *label, Tcl_Obj *menu, int begin ) { GtkWidget *menuWidget; GtkWidget *labelWidget; GtkWidget *childWidget = gnoclChildNotPacked ( Tcl_GetString ( child ), interp ); if ( childWidget == NULL ) return -1; labelWidget = getLabel ( interp, label ); if ( labelWidget == NULL ) return -1; menuWidget = getLabel ( interp, menu ? menu : label ); if ( menuWidget == NULL ) return -1; if ( begin ) gtk_notebook_append_page_menu ( notebook, childWidget, labelWidget, menuWidget ); else gtk_notebook_prepend_page_menu ( notebook, childWidget, labelWidget, menuWidget ); return gtk_notebook_page_num ( notebook, childWidget ); }
static GtkWidget * gimp_color_notebook_add_page (GimpColorNotebook *notebook, GType page_type) { GimpColorSelector *selector = GIMP_COLOR_SELECTOR (notebook); GimpColorSelectorClass *selector_class; GtkWidget *page; GtkWidget *menu_widget; GtkWidget *image; GtkWidget *label; page = gimp_color_selector_new (page_type, &selector->rgb, &selector->hsv, selector->channel); if (! page) return NULL; selector_class = GIMP_COLOR_SELECTOR_GET_CLASS (page); gimp_color_selector_set_show_alpha (GIMP_COLOR_SELECTOR (page), GIMP_COLOR_SELECTOR (notebook)->show_alpha); menu_widget = gtk_hbox_new (FALSE, 4); image = gtk_image_new_from_stock (selector_class->stock_id, GTK_ICON_SIZE_MENU); gtk_box_pack_start (GTK_BOX (menu_widget), image, FALSE, FALSE, 0); gtk_widget_show (image); label = gtk_label_new (gettext (selector_class->name)); gtk_box_pack_start (GTK_BOX (menu_widget), label, FALSE, FALSE, 0); gtk_widget_show (label); image = gtk_image_new_from_stock (selector_class->stock_id, DEFAULT_TAB_ICON_SIZE); gtk_notebook_append_page_menu (GTK_NOTEBOOK (notebook->notebook), page, image, menu_widget); if (! notebook->cur_page) notebook->cur_page = GIMP_COLOR_SELECTOR (page); notebook->selectors = g_list_append (notebook->selectors, page); gtk_widget_show (page); g_signal_connect (page, "color-changed", G_CALLBACK (gimp_color_notebook_color_changed), notebook); g_signal_connect (page, "channel-changed", G_CALLBACK (gimp_color_notebook_channel_changed), notebook); return page; }
static void create_custom_texture_page (GtkNotebook *notebook, const gchar* category, const gchar* path) { GtkWidget *label = gtk_label_new (category); GtkWidget *thispage = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (thispage), 12); gtk_widget_show (thispage); gtk_notebook_append_page_menu (notebook, thispage, label, NULL); }
/* Appends to notebook a page whose content is child, whose bookmark * is tab_label, and whose menu label is menu_label. */ int clip_GTK_NOTEBOOKAPPENDPAGEMENU(ClipMachine * ClipMachineMemory) { C_widget *cntb = _fetch_cw_arg(ClipMachineMemory); C_widget *cchild = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2)); C_widget *ctab_label; GtkWidget *tab_label; C_widget *cmenu_label; GtkWidget *menu_label; CHECKCWID(cntb, GTK_IS_NOTEBOOK); CHECKARG2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType); CHECKCWID(cchild, GTK_IS_WIDGET); CHECKARG3(3, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType); CHECKARG3(4, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType); if (_clip_parinfo(ClipMachineMemory, 3) == CHARACTER_type_of_ClipVarType) { char *caption = _clip_parc(ClipMachineMemory, 3); LOCALE_TO_UTF(caption); tab_label = gtk_label_new(caption); FREE_TEXT(caption); } else { ctab_label = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 3)); CHECKCWID(ctab_label, GTK_IS_WIDGET); if (ctab_label) tab_label = ctab_label->widget; } if (_clip_parinfo(ClipMachineMemory, 4) == CHARACTER_type_of_ClipVarType) { char *menu_text = _clip_parc(ClipMachineMemory, 4); LOCALE_TO_UTF(menu_text); menu_label = gtk_label_new(menu_text); FREE_TEXT(menu_text); } else { cmenu_label = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 4)); CHECKCWID(cmenu_label, GTK_IS_WIDGET); if (cmenu_label) menu_label = cmenu_label->widget; } gtk_notebook_append_page_menu(GTK_NOTEBOOK(cntb->widget), cchild->widget, tab_label, menu_label); return 0; err: return 1; }
void create_colorpage (GtkNotebook *notebook) { GtkWidget *vbox; GtkWidget *label, *table; GtkWidget *frame; label = gtk_label_new_with_mnemonic (_("Co_lor")); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); gtk_widget_show (vbox); frame = gimp_int_radio_group_new (TRUE, _("Color"), G_CALLBACK (gimp_radio_button_update), &pcvals.color_type, 0, _("A_verage under brush"), COLOR_TYPE_AVERAGE, &colorradio[COLOR_TYPE_AVERAGE], _("C_enter of brush"), COLOR_TYPE_CENTER, &colorradio[COLOR_TYPE_CENTER], NULL); gimp_help_set_help_data (colorradio[COLOR_TYPE_AVERAGE], _("Color is computed from the average of all pixels under the brush"), NULL); gimp_help_set_help_data (colorradio[COLOR_TYPE_CENTER], _("Samples the color from the pixel in the center of the brush"), NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); table = gtk_table_new (1, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); gtk_widget_show (table); colornoiseadjust = gimp_scale_entry_new (GTK_TABLE (table), 0, 0, _("Color _noise:"), 100, -1, pcvals.color_noise, 0.0, 100.0, 1.0, 5.0, 0, TRUE, 0, 0, _("Adds random noise to the color"), NULL); g_signal_connect (colornoiseadjust, "value-changed", G_CALLBACK (gimp_double_adjustment_update), &pcvals.color_noise); color_restore (); gtk_notebook_append_page_menu (notebook, vbox, label, NULL); }
static VALUE rg_append_page_menu(int argc, VALUE *argv, VALUE self) { VALUE child, tab_label, menu_label; rb_scan_args(argc, argv, "12", &child, &tab_label, &menu_label); gtk_notebook_append_page_menu(_SELF(self), RVAL2WIDGET(child), RVAL2WIDGET(tab_label), NIL_P(menu_label) ? NULL : RVAL2WIDGET(menu_label)); return self; }
static void create_sheets(GtkWidget *parent) { GtkWidget *notebook; GtkWidget *separator; GSList *list; Sheet *sheet; GtkWidget *child; GtkWidget *label; GtkWidget *menu_label; separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (parent), separator, FALSE, TRUE, 3); gtk_widget_show(separator); notebook = gtk_notebook_new (); /* gtk_signal_connect (GTK_OBJECT (notebook), "switch_page", GTK_SIGNAL_FUNC (page_switch), NULL); */ gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), TRUE); gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE); gtk_notebook_popup_enable (GTK_NOTEBOOK (notebook)); gtk_container_set_border_width (GTK_CONTAINER (notebook), 1); gtk_box_pack_start (GTK_BOX (parent), notebook, TRUE, TRUE, 0); list = get_sheets_list(); while (list != NULL) { sheet = (Sheet *) list->data; label = gtk_label_new(gettext(sheet->name)); menu_label = gtk_label_new(gettext(sheet->name)); gtk_misc_set_alignment(GTK_MISC(menu_label), 0.0, 0.5); child = create_sheet_page(notebook, sheet); gtk_widget_show(label); gtk_widget_show(menu_label); gtk_widget_show_all(child); gtk_notebook_append_page_menu (GTK_NOTEBOOK (notebook), child, label, menu_label); list = g_slist_next(list); } gtk_widget_show(notebook); }
static void create_texture_page (GtkNotebook *notebook, const gchar* category, const Border* textures, guint n_textures) { GtkWidget *label = gtk_label_new (category); GtkWidget *thispage = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (thispage), 0); gtk_widget_set_size_request (thispage, -1, 480); gtk_widget_show (thispage); /* scrolled window */ GtkWidget *scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (thispage), scrolled_window, TRUE, TRUE, 0); gtk_widget_show (scrolled_window); /* table */ gint rows = 5; gint cols = 3; GtkWidget *table = gtk_table_new (rows, cols, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_table_set_row_spacings (GTK_TABLE (table), 6); //gtk_box_pack_start (GTK_BOX (thispage), table, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (table), 10); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), table); gtk_widget_show (table); gint row = 1; gint col = 1; gint i; for (i = 0; i < n_textures; i++) { GtkWidget *icon = effect_icon_new (&textures[i]); gtk_table_attach_defaults (GTK_TABLE (table), icon, col - 1, col, row - 1, row); gtk_widget_show (icon); col++; if (col > cols) { row++; col = 1; } } gtk_notebook_append_page_menu (notebook, thispage, label, NULL); }
static GtkWidget *make_viewer_tab (tabwin_t *tabwin, windata_t *vwin, const gchar *info) { GtkNotebook *notebook; gchar *title = NULL; GtkWidget *tab; GtkWidget *label; GtkWidget *mlabel; tab = gtk_hbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(tab), 0); if (tabwin->role == EDIT_SCRIPT) { if (strstr(info, "script_tmp") != NULL) { title = untitled_title(tabwin); } else { title = title_from_filename(info, EDIT_SCRIPT, FALSE); } } else if (info != NULL) { title = g_strdup(info); } else { title = g_strdup("unknown"); } label = gtk_label_new(title); mlabel = gtk_label_new(title); gtk_container_add(GTK_CONTAINER(tab), label); g_object_set_data(G_OBJECT(tab), "label", label); g_object_set_data(G_OBJECT(tab), "mlabel", mlabel); g_free(title); viewer_tab_add_closer(tab, vwin); gtk_widget_set_size_request(tab, -1, 18); gtk_widget_show_all(tab); notebook = GTK_NOTEBOOK(tabwin->tabs); gtk_notebook_append_page_menu(notebook, vwin->main, tab, mlabel); return tab; }
void create_generalpage (GtkNotebook *notebook) { GtkWidget *box1, *box2, *box3, *box4, *thispage; GtkWidget *label, *tmpw, *frame, *table; GSList * radio_group = NULL; label = gtk_label_new_with_mnemonic (_("_General")); thispage = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (thispage), 12); gtk_widget_show (thispage); frame = gimp_frame_new (_("Background")); gtk_box_pack_start (GTK_BOX (thispage), frame, FALSE, FALSE, 0); gtk_widget_show (frame); box3 = gtk_vbox_new (FALSE, 6); gtk_container_add (GTK_CONTAINER (frame), box3); gtk_widget_show (box3); create_general_button (box3, BG_TYPE_KEEP_ORIGINAL, _("Keep original"), _("Preserve the original image as a background"), &radio_group); create_general_button (box3, BG_TYPE_FROM_PAPER, _("From paper"), _("Copy the texture of the selected paper as a background"), &radio_group); box4 = gtk_hbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (box3), box4, FALSE, FALSE, 0); gtk_widget_show (box4); create_general_button (box4, BG_TYPE_SOLID, _("Solid"), _("Solid colored background"), &radio_group); general_color_button = gimp_color_button_new (_("Color"), COLORBUTTONWIDTH, COLORBUTTONHEIGHT, &pcvals.color, GIMP_COLOR_AREA_FLAT); g_signal_connect (general_color_button, "clicked", G_CALLBACK (select_color), NULL); g_signal_connect (general_color_button, "color-changed", G_CALLBACK (gimp_color_button_get_color), &pcvals.color); gtk_box_pack_start (GTK_BOX (box4), general_color_button, FALSE, FALSE, 0); gtk_widget_show (general_color_button); tmpw = create_general_button (box3, BG_TYPE_TRANSPARENT, _("Transparent"), _("Use a transparent background; Only the strokes painted will be visible"), &radio_group); if (!img_has_alpha) gtk_widget_set_sensitive (tmpw, FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (general_bg_radio[pcvals.general_background_type]), TRUE); box1 = gtk_hbox_new (FALSE, 12); gtk_box_pack_start (GTK_BOX (thispage), box1, FALSE, FALSE, 0); gtk_widget_show (box1); box2 = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); tmpw = gtk_check_button_new_with_label ( _("Paint edges")); general_paint_edges = tmpw; gtk_box_pack_start (GTK_BOX (box2), tmpw, FALSE, FALSE, 0); gtk_widget_show (tmpw); gimp_help_set_help_data (tmpw, _("Selects if to place strokes all the way out to the edges of the image"), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw), pcvals.general_paint_edges); general_tileable = tmpw = gtk_check_button_new_with_label ( _("Tileable")); gtk_box_pack_start (GTK_BOX (box2), tmpw, FALSE, FALSE, 0); gtk_widget_show (tmpw); gimp_help_set_help_data (tmpw, _("Selects if the resulting image should be seamlessly tileable"), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw), pcvals.general_tileable); tmpw = gtk_check_button_new_with_label ( _("Drop shadow")); general_drop_shadow = tmpw; gtk_box_pack_start (GTK_BOX (box2), tmpw, FALSE, FALSE, 0); gtk_widget_show (tmpw); gimp_help_set_help_data (tmpw, _("Adds a shadow effect to each brush stroke"), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw), pcvals.general_drop_shadow); table = gtk_table_new (5, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_box_pack_start (GTK_BOX (box1), table, FALSE, FALSE, 0); gtk_widget_show (table); general_dark_edge_adjust = gimp_scale_entry_new (GTK_TABLE (table), 0, 0, _("Edge darken:"), 150, 6, pcvals.general_dark_edge, 0.0, 1.0, 0.01, 0.1, 2, TRUE, 0, 0, _("How much to \"darken\" the edges of each brush stroke"), NULL); general_shadow_adjust = gimp_scale_entry_new (GTK_TABLE (table), 0, 1, _("Shadow darken:"), 150, 6, pcvals.general_shadow_darkness, 0.0, 99.0, 0.1, 1, 2, TRUE, 0, 0, _("How much to \"darken\" the drop shadow"), NULL); general_shadow_depth = gimp_scale_entry_new (GTK_TABLE (table), 0, 2, _("Shadow depth:"), 150, 6, pcvals.general_shadow_depth, 0, 99, 1, 5, 0, TRUE, 0, 0, _("The depth of the drop shadow, i.e. how far apart from the object it should be"), NULL); general_shadow_blur = gimp_scale_entry_new (GTK_TABLE (table), 0, 3, _("Shadow blur:"), 150, 6, pcvals.general_shadow_blur, 0, 99, 1, 5, 0, TRUE, 0, 0, _("How much to blur the drop shadow"), NULL); dev_thresh_adjust = gimp_scale_entry_new (GTK_TABLE (table), 0, 4, _("Deviation threshold:"), 150, 6, pcvals.devthresh, 0.0, 1.0, 0.01, 0.01, 2, TRUE, 0, 0, _("A bailout-value for adaptive selections"), NULL); gtk_notebook_append_page_menu (notebook, thispage, label, NULL); }
void create_brushpage (GtkNotebook *notebook) { GtkWidget *box1, *box2, *box3, *thispage; GtkWidget *view; GtkWidget *tmpw, *table; GtkWidget *frame; GtkWidget *combo; GtkWidget *label; GtkSizeGroup *group; GtkTreeSelection *selection; label = gtk_label_new_with_mnemonic (_("_Brush")); thispage = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (thispage), 12); gtk_widget_show (thispage); box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_box_pack_start (GTK_BOX (thispage), box1, TRUE,TRUE,0); gtk_widget_show (box1); view = create_one_column_list (box1, brush_select_file); brush_list = view; brush_list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view))); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (box2), frame, FALSE, FALSE, 0); gtk_widget_show (frame); brush_preview = tmpw = gimp_preview_area_new (); gtk_widget_set_size_request (brush_preview, 100, 100); gtk_container_add (GTK_CONTAINER (frame), tmpw); gtk_widget_show (tmpw); g_signal_connect (brush_preview, "size-allocate", G_CALLBACK (brush_preview_size_allocate), NULL); box3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); gtk_box_pack_end (GTK_BOX (box2), box3, FALSE, FALSE,0); gtk_widget_show (box3); tmpw = gtk_label_new (_("Gamma:")); gtk_misc_set_alignment (GTK_MISC (tmpw), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (box3), tmpw, FALSE, FALSE,0); gtk_widget_show (tmpw); brush_gamma_adjust = GTK_ADJUSTMENT (gtk_adjustment_new (pcvals.brushgamma, 0.5, 3.0, 0.1, 0.1, 1.0)); tmpw = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, brush_gamma_adjust); gtk_widget_set_size_request (GTK_WIDGET (tmpw), 100, 30); gtk_scale_set_draw_value (GTK_SCALE (tmpw), FALSE); gtk_scale_set_digits (GTK_SCALE (tmpw), 2); gtk_box_pack_start (GTK_BOX (box3), tmpw, FALSE, FALSE, 0); gtk_widget_show (tmpw); g_signal_connect_swapped (brush_gamma_adjust, "value-changed", G_CALLBACK (update_brush_preview), pcvals.selected_brush); gimp_help_set_help_data (tmpw, _("Changes the gamma (brightness) of the selected brush"), NULL); box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start (GTK_BOX (thispage), box3, FALSE, FALSE,0); gtk_widget_show (box3); group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); tmpw = gtk_label_new (_("Select:")); gtk_misc_set_alignment (GTK_MISC (tmpw), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (box3), tmpw, FALSE, FALSE, 0); gtk_widget_show (tmpw); gtk_size_group_add_widget (group, tmpw); g_object_unref (group); combo = gimp_drawable_combo_box_new (validdrawable, NULL); gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), -1, G_CALLBACK (brushdmenuselect), NULL); gtk_box_pack_start (GTK_BOX (box3), combo, TRUE, TRUE, 0); gtk_widget_show (combo); tmpw = gtk_button_new_from_stock (GTK_STOCK_SAVE_AS); gtk_box_pack_start (GTK_BOX (box3),tmpw, FALSE, FALSE, 0); g_signal_connect (tmpw, "clicked", G_CALLBACK (savebrush), NULL); gtk_widget_show (tmpw); table = gtk_table_new (2, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_box_pack_start (GTK_BOX (thispage), table, FALSE, FALSE, 0); gtk_widget_show (table); brush_aspect_adjust = (GtkAdjustment *) gimp_scale_entry_new (GTK_TABLE (table), 0, 0, _("Aspect ratio:"), 150, -1, pcvals.brush_aspect, -1.0, 1.0, 0.1, 0.1, 2, TRUE, 0, 0, _("Specifies the aspect ratio of the brush"), NULL); gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_LABEL (brush_aspect_adjust)); g_signal_connect (brush_aspect_adjust, "value-changed", G_CALLBACK (brush_asepct_adjust_cb), &pcvals.brush_aspect); brush_relief_adjust = (GtkAdjustment *) gimp_scale_entry_new (GTK_TABLE (table), 0, 1, _("Relief:"), 150, -1, pcvals.brush_relief, 0.0, 100.0, 1.0, 10.0, 1, TRUE, 0, 0, _("Specifies the amount of embossing to apply to the image (in percent)"), NULL); gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_LABEL (brush_relief_adjust)); g_signal_connect (brush_relief_adjust, "value-changed", G_CALLBACK (gimp_double_adjustment_update), &pcvals.brush_relief); brush_select (selection, FALSE); readdirintolist ("Brushes", view, pcvals.selected_brush); /* * This is so the "changed signal won't get sent to the brushes' list * and reset the gamma and stuff. * */ gtk_widget_grab_focus (brush_list); gtk_notebook_append_page_menu (notebook, thispage, label, NULL); }
void create_paperpage (GtkNotebook *notebook) { GtkWidget *box1, *thispage, *box2; GtkWidget *label, *tmpw, *grid; GtkWidget *view; GtkWidget *frame; GtkTreeSelection *selection; GtkTreeIter iter; GtkListStore *paper_store_list; label = gtk_label_new_with_mnemonic (_("P_aper")); thispage = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (thispage), 12); gtk_widget_show (thispage); box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_box_pack_start (GTK_BOX (thispage), box1, TRUE, TRUE, 0); gtk_widget_show (box1); paper_list = view = create_one_column_list (box1, paper_select); paper_store_list = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view))); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (box2), frame, FALSE, FALSE, 0); gtk_widget_show (frame); paper_preview = tmpw = gimp_preview_area_new (); gtk_widget_set_size_request (tmpw, 100, 100); gtk_container_add (GTK_CONTAINER (frame), tmpw); gtk_widget_show (tmpw); paper_invert = tmpw = gtk_check_button_new_with_mnemonic ( _("_Invert")); gtk_box_pack_start (GTK_BOX (box2), tmpw, FALSE, FALSE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw), FALSE); gtk_widget_show (tmpw); g_signal_connect_swapped (tmpw, "clicked", G_CALLBACK (paper_select), selection); gimp_help_set_help_data (tmpw, _("Inverts the Papers texture"), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw), pcvals.paper_invert); paper_overlay = tmpw = gtk_check_button_new_with_mnemonic ( _("O_verlay")); gtk_box_pack_start (GTK_BOX (box2), tmpw, FALSE, FALSE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw), FALSE); gtk_widget_show (tmpw); gimp_help_set_help_data (tmpw, _("Applies the paper as it is (without embossing it)"), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw), pcvals.paper_overlay); grid = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (grid), 6); gtk_grid_set_column_spacing (GTK_GRID (grid), 6); gtk_box_pack_start (GTK_BOX (thispage), grid, FALSE, FALSE, 0); gtk_widget_show (grid); paper_scale_adjust = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("Scale:"), 150, -1, pcvals.paper_scale, 3.0, 150.0, 1.0, 10.0, 1, TRUE, 0, 0, _("Specifies the scale of the texture (in percent of original file)"), NULL); g_signal_connect (paper_scale_adjust, "value-changed", G_CALLBACK (gimp_double_adjustment_update), &pcvals.paper_scale); paper_relief_adjust = gimp_scale_entry_new (GTK_GRID (grid), 0, 1, _("Relief:"), 150, -1, pcvals.paper_relief, 0.0, 100.0, 1.0, 10.0, 1, TRUE, 0, 0, _("Specifies the amount of embossing to apply to the image (in percent)"), NULL); g_signal_connect (paper_relief_adjust, "value-changed", G_CALLBACK (gimp_double_adjustment_update), &pcvals.paper_relief); if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (paper_store_list), &iter)) gtk_tree_selection_select_iter (selection, &iter); paper_select (selection, NULL); readdirintolist ("Paper", view, pcvals.selected_paper); gtk_notebook_append_page_menu (notebook, thispage, label, NULL); }
void create_presetpage (GtkNotebook *notebook) { GtkWidget *vbox, *hbox, *box1, *box2, *thispage; GtkWidget *view; GtkWidget *tmpw; GtkWidget *label; GtkTreeSelection *selection; label = gtk_label_new_with_mnemonic (_("_Presets")); thispage = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (thispage), 12); gtk_widget_show (thispage); box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_box_pack_start (GTK_BOX (thispage), box1, FALSE, FALSE, 0); gtk_widget_show (box1); presetnameentry = tmpw = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (box1), tmpw, FALSE, FALSE, 0); gtk_widget_set_size_request (tmpw, 200, -1); gtk_widget_show (tmpw); presetsavebutton = tmpw = gtk_button_new_with_label ( _("Save Current...")); gtk_button_set_image (GTK_BUTTON (presetsavebutton), gtk_image_new_from_icon_name ("document-save", GTK_ICON_SIZE_BUTTON)); gtk_box_pack_start (GTK_BOX (box1), tmpw, FALSE, FALSE, 0); gtk_widget_show (tmpw); g_signal_connect (tmpw, "clicked", G_CALLBACK (create_save_preset), NULL); gimp_help_set_help_data (tmpw, _("Save the current settings to the specified file"), NULL); box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_box_pack_start (GTK_BOX (thispage), box1, TRUE, TRUE, 0); gtk_widget_show (box1); presetlist = view = create_presets_list (box1); store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view))); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); add_factory_defaults (); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (box1), vbox, FALSE, FALSE, 0); gtk_widget_show (vbox); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (hbox), box2, FALSE, FALSE, 0); gtk_widget_show (box2); tmpw = gtk_button_new_from_stock (GTK_STOCK_APPLY); gtk_box_pack_start (GTK_BOX (box2), tmpw, FALSE, FALSE, 0); gtk_widget_show (tmpw); g_signal_connect (tmpw, "clicked", G_CALLBACK (apply_preset), selection); gimp_help_set_help_data (tmpw, _("Reads the selected Preset into memory"), NULL); tmpw = delete_button = gtk_button_new_from_stock (GTK_STOCK_DELETE); gtk_box_pack_start (GTK_BOX (box2), tmpw, FALSE, FALSE,0); gtk_widget_show (tmpw); g_signal_connect (tmpw, "clicked", G_CALLBACK (delete_preset), selection); gimp_help_set_help_data (tmpw, _("Deletes the selected Preset"), NULL); tmpw = gtk_button_new_from_stock (GTK_STOCK_REFRESH); gtk_box_pack_start (GTK_BOX (box2), tmpw, FALSE, FALSE,0); gtk_widget_show (tmpw); g_signal_connect (tmpw, "clicked", G_CALLBACK (preset_refresh_presets), NULL); gimp_help_set_help_data (tmpw, _("Reread the folder of Presets"), NULL); presetdesclabel = tmpw = gtk_label_new (NULL); gimp_label_set_attributes (GTK_LABEL (tmpw), PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC, -1); gtk_label_set_line_wrap (GTK_LABEL (tmpw), TRUE); /* * Make sure the label's width is reasonable and it won't stretch * the dialog more than its width. * */ gtk_widget_set_size_request (tmpw, 240, -1); gtk_misc_set_alignment (GTK_MISC (tmpw), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), tmpw, TRUE, TRUE, 0); gtk_widget_show (tmpw); preset_read_dir_into_list (); gtk_notebook_append_page_menu (notebook, thispage, label, NULL); }
void create_placementpage (GtkNotebook *notebook) { GtkWidget *vbox; GtkWidget *label, *tmpw, *table, *frame; label = gtk_label_new_with_mnemonic (_("Pl_acement")); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); gtk_widget_show (vbox); frame = gimp_int_radio_group_new (TRUE, _("Placement"), G_CALLBACK (gimp_radio_button_update), &pcvals.place_type, 0, _("Randomly"), PLACEMENT_TYPE_RANDOM, &placement_radio[PLACEMENT_TYPE_RANDOM], _("Evenly distributed"), PLACEMENT_TYPE_EVEN_DIST, &placement_radio[PLACEMENT_TYPE_EVEN_DIST], NULL); gimp_help_set_help_data (placement_radio[PLACEMENT_TYPE_RANDOM], _("Place strokes randomly around the image"), NULL); gimp_help_set_help_data (placement_radio[PLACEMENT_TYPE_EVEN_DIST], _("The strokes are evenly distributed across the image"), NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (placement_radio[pcvals.place_type]), TRUE); placement_center = gtk_check_button_new_with_mnemonic ( _("Centered")); tmpw = placement_center; gtk_box_pack_start (GTK_BOX (vbox), tmpw, FALSE, FALSE, 0); gtk_widget_show (tmpw); gimp_help_set_help_data (tmpw, _("Focus the brush strokes around the center of the image"), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw), pcvals.placement_center); table = gtk_table_new (1, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); gtk_widget_show (table); brush_density_adjust = gimp_scale_entry_new (GTK_TABLE (table), 0, 0, _("Stroke _density:"), 100, -1, pcvals.brush_density, 1.0, 50.0, 1.0, 5.0, 0, TRUE, 0, 0, _("The relative density of the brush strokes"), NULL); g_signal_connect (brush_density_adjust, "value-changed", G_CALLBACK (gimp_double_adjustment_update), &pcvals.brush_density); gtk_notebook_append_page_menu (notebook, vbox, label, NULL); }
void add_page_in_notebook (GtkNotebook *Notebook, gchar *FileName) { GtkWidget *VScrolledWindow; GtkWidget *TabLabel, *MenuLabel; GtkWidget *PopUpMenu; GtkStyle *Style; t_fprops Storage; g_array_append_val (FileProperties, Storage); if (!FileName) { gchar *Untitled; Untitled = g_strdup_printf (UNTITLED " %d", ++NewFilesCnt); init_file_properties (Untitled, OpenedFilesCnt); g_free (Untitled); } else init_file_properties (FileName, OpenedFilesCnt); VScrolledWindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(VScrolledWindow), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); if (SCROLLBAR_POSITION == 1) gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW(VScrolledWindow), GTK_CORNER_TOP_RIGHT); if (SCROLLBAR_POSITION == 2) gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW(VScrolledWindow), GTK_CORNER_TOP_LEFT); FPROPS(OpenedFilesCnt, Text) = gtk_text_new (NULL, NULL); Style = gtk_style_copy (gtk_widget_get_style(FPROPS(OpenedFilesCnt, Text))); Style -> font = gdk_font_load (FONT); Style -> bg[GTK_STATE_SELECTED].red = SELECTED_BG_RED; Style -> bg[GTK_STATE_SELECTED].green = SELECTED_BG_GREEN; Style -> bg[GTK_STATE_SELECTED].blue = SELECTED_BG_BLUE; Style -> fg[GTK_STATE_SELECTED].red = SELECTED_FG_RED; Style -> fg[GTK_STATE_SELECTED].green = SELECTED_FG_GREEN; Style -> fg[GTK_STATE_SELECTED].blue = SELECTED_FG_BLUE; Style -> base[GTK_STATE_NORMAL].red = BG_RED; Style -> base[GTK_STATE_NORMAL].green = BG_GREEN; Style -> base[GTK_STATE_NORMAL].blue = BG_BLUE; Style -> text[GTK_STATE_NORMAL].red = FG_RED; Style -> text[GTK_STATE_NORMAL].green = FG_GREEN; Style -> text[GTK_STATE_NORMAL].blue = FG_BLUE; gtk_widget_set_style (FPROPS(OpenedFilesCnt, Text), Style); if (!FPROPS(OpenedFilesCnt, ReadOnly)) gtk_text_set_editable (GTK_TEXT(FPROPS(OpenedFilesCnt, Text)), TRUE); if (TOGGLE_WORDWRAP) gtk_text_set_word_wrap (GTK_TEXT(FPROPS(OpenedFilesCnt, Text)), TRUE); PopUpMenu = popup_menu_new (); gtk_signal_connect_object (GTK_OBJECT(FPROPS(OpenedFilesCnt, Text)), "event", (GtkSignalFunc)popup_menu_show, GTK_OBJECT(PopUpMenu)); gtk_container_add (GTK_CONTAINER(VScrolledWindow), FPROPS(OpenedFilesCnt, Text)); TabLabel = gtk_label_new (""); MenuLabel = gtk_label_new (""); gtk_notebook_append_page_menu (Notebook, VScrolledWindow, TabLabel, MenuLabel); gtk_widget_show_all (GTK_WIDGET(Notebook)); set_label (Notebook, OpenedFilesCnt); gtk_notebook_set_page (GTK_NOTEBOOK(Notebook), OpenedFilesCnt++); }