Commit 89cf4554 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/widgets/Makefile.am app/widgets/widgets-types.h removed GimpEnumMenu.

2004-04-18  Sven Neumann  <sven@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpenummenu.[ch]: removed GimpEnumMenu.

	* app/widgets/gimpenumwidgets.[ch]: moved widget constructors that
	don't use GimpEnumMenu from gimpenummenu.[ch] to these new files.

	* app/widgets/gimpenumcombobox.[ch]: added a GtkComboBox widget
	using GimpEnumStore; replaces GimpEnumMenu.

	* app/widgets/gimpenumstore.[ch]: added new function
	gimp_enum_store_lookup_by_value().

	* app/widgets/gimppropwidgets.[ch]: replaced
	gimp_prop_enum_option_menu_new() with gimp_prop_enum_combo_box_new().

	* app/gui/brush-select.[ch]
	* app/gui/convert-dialog.c
	* app/gui/layers-commands.c
	* app/gui/preferences-dialog.c
	* app/gui/resize-dialog.c
	* app/tools/gimpblendoptions.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimppaintoptions-gui.c
	* app/tools/gimpselectionoptions.c
	* app/tools/gimptransformoptions.c
	* app/widgets/gimpcolorframe.c
	* app/widgets/gimpeditor.c
	* app/widgets/gimpgrideditor.c
	* app/widgets/gimphistogrameditor.c
	* app/widgets/gimpstrokeeditor.c
	* app/widgets/gimptemplateeditor.c
	* app/widgets/gimptexteditor.c: ported to GimpEnumComboBox.
parent f9135400
2004-04-18 Sven Neumann <sven@gimp.org>
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpenummenu.[ch]: removed GimpEnumMenu.
* app/widgets/gimpenumwidgets.[ch]: moved widget constructors that
don't use GimpEnumMenu from gimpenummenu.[ch] to these new files.
* app/widgets/gimpenumcombobox.[ch]: added a GtkComboBox widget
using GimpEnumStore; replaces GimpEnumMenu.
* app/widgets/gimpenumstore.[ch]: added new function
gimp_enum_store_lookup_by_value().
* app/widgets/gimppropwidgets.[ch]: replaced
gimp_prop_enum_option_menu_new() with gimp_prop_enum_combo_box_new().
* app/gui/brush-select.[ch]
* app/gui/convert-dialog.c
* app/gui/layers-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.c
* app/tools/gimpblendoptions.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcroptool.c
* app/tools/gimpcurvestool.c
* app/tools/gimplevelstool.c
* app/tools/gimpmagnifytool.c
* app/tools/gimppaintoptions-gui.c
* app/tools/gimpselectionoptions.c
* app/tools/gimptransformoptions.c
* app/widgets/gimpcolorframe.c
* app/widgets/gimpeditor.c
* app/widgets/gimpgrideditor.c
* app/widgets/gimphistogrameditor.c
* app/widgets/gimpstrokeeditor.c
* app/widgets/gimptemplateeditor.c
* app/widgets/gimptexteditor.c: ported to GimpEnumComboBox.
2004-04-18 Sven Neumann <sven@gimp.org>
* app/widgets/Makefile.am
......
......@@ -46,7 +46,7 @@
#include "pdb/procedural_db.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumwidgets.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimppropwidgets.h"
......
......@@ -31,7 +31,7 @@
#include "core/gimplist.h"
#include "core/gimppalette.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumwidgets.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
......
......@@ -783,25 +783,25 @@ prefs_color_button_add (GObject *config,
}
static GtkWidget *
prefs_enum_option_menu_add (GObject *config,
const gchar *property_name,
gint minimum,
gint maximum,
const gchar *label,
GtkTable *table,
gint table_row)
prefs_enum_combo_box_add (GObject *config,
const gchar *property_name,
gint minimum,
gint maximum,
const gchar *label,
GtkTable *table,
gint table_row)
{
GtkWidget *menu;
GtkWidget *combo_box;
menu = gimp_prop_enum_option_menu_new (config, property_name,
minimum, maximum);
combo_box = gimp_prop_enum_combo_box_new (config, property_name,
minimum, maximum);
if (menu)
if (combo_box)
gimp_table_attach_aligned (table, 0, table_row,
label, 1.0, 0.5,
menu, 1, TRUE);
combo_box, 1, TRUE);
return menu;
return combo_box;
}
static GtkWidget *
......@@ -923,8 +923,8 @@ prefs_display_options_frame_add (Gimp *gimp,
table = prefs_table_new (2, GTK_CONTAINER (vbox), FALSE);
prefs_enum_option_menu_add (object, "padding-mode", 0, 0,
_("Canvas Padding Mode:"), GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "padding-mode", 0, 0,
_("Canvas Padding Mode:"), GTK_TABLE (table), 0);
button = prefs_color_button_add (object, "padding-color",
_("Custom Padding Color:"),
......@@ -1208,15 +1208,15 @@ prefs_dialog_new (Gimp *gimp,
table = prefs_table_new (3, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (object, "layer-preview-size", 0, 0,
_("Default _Layer & Channel Preview Size:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (object, "navigation-preview-size", 0, 0,
_("_Navigation Preview Size:"),
GTK_TABLE (table), 1);
prefs_enum_option_menu_add (object, "undo-preview-size", 0, 0,
_("_Undo History Preview Size:"),
GTK_TABLE (table), 2);
prefs_enum_combo_box_add (object, "layer-preview-size", 0, 0,
_("Default _Layer & Channel Preview Size:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "navigation-preview-size", 0, 0,
_("_Navigation Preview Size:"),
GTK_TABLE (table), 1);
prefs_enum_combo_box_add (object, "undo-preview-size", 0, 0,
_("_Undo History Preview Size:"),
GTK_TABLE (table), 2);
/* Dialog Bahavior */
vbox2 = prefs_frame_new (_("Dialog Behavior"), GTK_CONTAINER (vbox), FALSE);
......@@ -1360,9 +1360,9 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (object, "help-browser", 0, 0,
_("Help _Browser to Use:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "help-browser", 0, 0,
_("Help _Browser to Use:"),
GTK_TABLE (table), 0);
/* Web Browser (unused on win32) */
#ifndef G_OS_WIN32
......@@ -1414,9 +1414,9 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Scaling"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2), TRUE);
prefs_enum_option_menu_add (object, "interpolation-type", 0, 0,
_("Default _Interpolation:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "interpolation-type", 0, 0,
_("Default _Interpolation:"),
GTK_TABLE (table), 0);
/* Global Brush, Pattern, ... */
vbox2 = prefs_frame_new (_("Paint Options Shared Between Tools"),
......@@ -1528,9 +1528,9 @@ prefs_dialog_new (Gimp *gimp,
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (object, "cursor-mode", 0, 0,
_("Cursor M_ode:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "cursor-mode", 0, 0,
_("Cursor M_ode:"),
GTK_TABLE (table), 0);
/********************************************/
......@@ -1700,12 +1700,12 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Transparency"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (2, GTK_CONTAINER (vbox2), TRUE);
prefs_enum_option_menu_add (object, "transparency-type", 0, 0,
_("Transparency _Type:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (object, "transparency-size", 0, 0,
_("Check _Size:"),
GTK_TABLE (table), 1);
prefs_enum_combo_box_add (object, "transparency-type", 0, 0,
_("Transparency _Type:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "transparency-size", 0, 0,
_("Check _Size:"),
GTK_TABLE (table), 1);
/* 8-Bit Displays */
vbox2 = prefs_frame_new (_("8-Bit Displays"), GTK_CONTAINER (vbox), FALSE);
......@@ -1862,13 +1862,13 @@ prefs_dialog_new (Gimp *gimp,
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (object, "toolbox-window-hint", 0, 0,
_("Window Type Hint for the _Toolbox:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "toolbox-window-hint", 0, 0,
_("Window Type Hint for the _Toolbox:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (object, "dock-window-hint", 0, 0,
_("Window Type Hint for the _Docks:"),
GTK_TABLE (table), 1);
prefs_enum_combo_box_add (object, "dock-window-hint", 0, 0,
_("Window Type Hint for the _Docks:"),
GTK_TABLE (table), 1);
vbox2 = prefs_frame_new (_("Focus"),
GTK_CONTAINER (vbox), FALSE);
......@@ -1936,9 +1936,9 @@ prefs_dialog_new (Gimp *gimp,
_("Always"),
_("\"File -> Save\" Saves the Image:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (object, "thumbnail-size", 0, 0,
_("Size of Thumbnail Files:"),
GTK_TABLE (table), 1);
prefs_enum_combo_box_add (object, "thumbnail-size", 0, 0,
_("Size of Thumbnail Files:"),
GTK_TABLE (table), 1);
/************************/
......
......@@ -33,7 +33,7 @@
#include "core/gimplayer.h"
#include "core/gimptemplate.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumcombobox.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
......@@ -698,7 +698,7 @@ resize_widget_new (GimpViewable *viewable,
if (type == ScaleWidget)
{
GtkWidget *hbox;
GtkWidget *option_menu;
GtkWidget *combo;
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
......@@ -708,15 +708,19 @@ resize_widget_new (GimpViewable *viewable,
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
private->interpolation_menu = option_menu =
gimp_enum_option_menu_new (GIMP_TYPE_INTERPOLATION_TYPE,
G_CALLBACK (gimp_menu_item_update),
&resize->interpolation);
gimp_int_option_menu_set_history (GTK_OPTION_MENU (option_menu),
resize->interpolation);
gtk_box_pack_start (GTK_BOX (hbox), option_menu,
FALSE, FALSE, 0);
gtk_widget_show (option_menu);
combo = gimp_enum_combo_box_new (GIMP_TYPE_INTERPOLATION_TYPE);
gimp_enum_combo_box_set_active (GIMP_ENUM_COMBO_BOX (combo),
resize->interpolation);
g_signal_connect (combo, "changed",
G_CALLBACK (gimp_enum_combo_box_get_active),
&resize->interpolation);
gimp_enum_combo_box_set_active (GIMP_ENUM_COMBO_BOX (combo),
resize->interpolation);
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
gtk_widget_show (combo);
private->interpolation_menu = combo;
if (gimp_image_base_type (resize->gimage) == GIMP_INDEXED)
{
......@@ -892,8 +896,8 @@ response_callback (GtkWidget *widget,
resize->interpolation =
resize->gimage->gimp->config->interpolation_type;
gimp_int_option_menu_set_history (GTK_OPTION_MENU (private->interpolation_menu),
resize->interpolation);
gimp_enum_combo_box_set_active (GIMP_ENUM_COMBO_BOX (private->interpolation_menu),
resize->interpolation);
}
break;
......
......@@ -196,14 +196,14 @@ brush_select_new (Gimp *gimp,
bsp);
/* Create the paint mode option menu */
bsp->option_menu =
bsp->paint_mode_menu =
gimp_paint_mode_menu_new (G_CALLBACK (paint_mode_menu_callback),
bsp,
TRUE,
gimp_context_get_paint_mode (bsp->context));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Mode:"), 1.0, 0.5,
bsp->option_menu, 2, TRUE);
bsp->paint_mode_menu, 2, TRUE);
spacing_adj = GIMP_BRUSH_FACTORY_VIEW (bsp->view)->spacing_adjustment;
......@@ -365,7 +365,7 @@ brush_select_paint_mode_changed (GimpContext *context,
GimpLayerModeEffects paint_mode,
BrushSelect *bsp)
{
gimp_int_option_menu_set_history (GTK_OPTION_MENU (bsp->option_menu),
gimp_int_option_menu_set_history (GTK_OPTION_MENU (bsp->paint_mode_menu),
paint_mode);
brush_select_change_callbacks (bsp, FALSE);
......
......@@ -31,7 +31,7 @@ struct _BrushSelect
GtkWidget *shell;
GtkWidget *view;
GtkAdjustment *opacity_data;
GtkWidget *option_menu;
GtkWidget *paint_mode_menu;
};
......
......@@ -31,7 +31,7 @@
#include "core/gimplist.h"
#include "core/gimppalette.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumwidgets.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
......
......@@ -46,7 +46,7 @@
#include "pdb/procedural_db.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumwidgets.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimppropwidgets.h"
......
......@@ -783,25 +783,25 @@ prefs_color_button_add (GObject *config,
}
static GtkWidget *
prefs_enum_option_menu_add (GObject *config,
const gchar *property_name,
gint minimum,
gint maximum,
const gchar *label,
GtkTable *table,
gint table_row)
prefs_enum_combo_box_add (GObject *config,
const gchar *property_name,
gint minimum,
gint maximum,
const gchar *label,
GtkTable *table,
gint table_row)
{
GtkWidget *menu;
GtkWidget *combo_box;
menu = gimp_prop_enum_option_menu_new (config, property_name,
minimum, maximum);
combo_box = gimp_prop_enum_combo_box_new (config, property_name,
minimum, maximum);
if (menu)
if (combo_box)
gimp_table_attach_aligned (table, 0, table_row,
label, 1.0, 0.5,
menu, 1, TRUE);
combo_box, 1, TRUE);
return menu;
return combo_box;
}
static GtkWidget *
......@@ -923,8 +923,8 @@ prefs_display_options_frame_add (Gimp *gimp,
table = prefs_table_new (2, GTK_CONTAINER (vbox), FALSE);
prefs_enum_option_menu_add (object, "padding-mode", 0, 0,
_("Canvas Padding Mode:"), GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "padding-mode", 0, 0,
_("Canvas Padding Mode:"), GTK_TABLE (table), 0);
button = prefs_color_button_add (object, "padding-color",
_("Custom Padding Color:"),
......@@ -1208,15 +1208,15 @@ prefs_dialog_new (Gimp *gimp,
table = prefs_table_new (3, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (object, "layer-preview-size", 0, 0,
_("Default _Layer & Channel Preview Size:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (object, "navigation-preview-size", 0, 0,
_("_Navigation Preview Size:"),
GTK_TABLE (table), 1);
prefs_enum_option_menu_add (object, "undo-preview-size", 0, 0,
_("_Undo History Preview Size:"),
GTK_TABLE (table), 2);
prefs_enum_combo_box_add (object, "layer-preview-size", 0, 0,
_("Default _Layer & Channel Preview Size:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "navigation-preview-size", 0, 0,
_("_Navigation Preview Size:"),
GTK_TABLE (table), 1);
prefs_enum_combo_box_add (object, "undo-preview-size", 0, 0,
_("_Undo History Preview Size:"),
GTK_TABLE (table), 2);
/* Dialog Bahavior */
vbox2 = prefs_frame_new (_("Dialog Behavior"), GTK_CONTAINER (vbox), FALSE);
......@@ -1360,9 +1360,9 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (object, "help-browser", 0, 0,
_("Help _Browser to Use:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "help-browser", 0, 0,
_("Help _Browser to Use:"),
GTK_TABLE (table), 0);
/* Web Browser (unused on win32) */
#ifndef G_OS_WIN32
......@@ -1414,9 +1414,9 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Scaling"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2), TRUE);
prefs_enum_option_menu_add (object, "interpolation-type", 0, 0,
_("Default _Interpolation:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "interpolation-type", 0, 0,
_("Default _Interpolation:"),
GTK_TABLE (table), 0);
/* Global Brush, Pattern, ... */
vbox2 = prefs_frame_new (_("Paint Options Shared Between Tools"),
......@@ -1528,9 +1528,9 @@ prefs_dialog_new (Gimp *gimp,
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (object, "cursor-mode", 0, 0,
_("Cursor M_ode:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "cursor-mode", 0, 0,
_("Cursor M_ode:"),
GTK_TABLE (table), 0);
/********************************************/
......@@ -1700,12 +1700,12 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Transparency"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (2, GTK_CONTAINER (vbox2), TRUE);
prefs_enum_option_menu_add (object, "transparency-type", 0, 0,
_("Transparency _Type:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (object, "transparency-size", 0, 0,
_("Check _Size:"),
GTK_TABLE (table), 1);
prefs_enum_combo_box_add (object, "transparency-type", 0, 0,
_("Transparency _Type:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "transparency-size", 0, 0,
_("Check _Size:"),
GTK_TABLE (table), 1);
/* 8-Bit Displays */
vbox2 = prefs_frame_new (_("8-Bit Displays"), GTK_CONTAINER (vbox), FALSE);
......@@ -1862,13 +1862,13 @@ prefs_dialog_new (Gimp *gimp,
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (object, "toolbox-window-hint", 0, 0,
_("Window Type Hint for the _Toolbox:"),
GTK_TABLE (table), 0);
prefs_enum_combo_box_add (object, "toolbox-window-hint", 0, 0,
_("Window Type Hint for the _Toolbox:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (object, "dock-window-hint", 0, 0,
_("Window Type Hint for the _Docks:"),
GTK_TABLE (table), 1);
prefs_enum_combo_box_add (object, "dock-window-hint", 0, 0,
_("Window Type Hint for the _Docks:"),
GTK_TABLE (table), 1);
vbox2 = prefs_frame_new (_("Focus"),
GTK_CONTAINER (vbox), FALSE);
......@@ -1936,9 +1936,9 @@ prefs_dialog_new (Gimp *gimp,
_("Always"),
_("\"File -> Save\" Saves the Image:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (object, "thumbnail-size", 0, 0,
_("Size of Thumbnail Files:"),
GTK_TABLE (table), 1);
prefs_enum_combo_box_add (object, "thumbnail-size", 0, 0,
_("Size of Thumbnail Files:"),
GTK_TABLE (table), 1);
/************************/
......
......@@ -33,7 +33,7 @@
#include "core/gimplayer.h"
#include "core/gimptemplate.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumcombobox.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
......@@ -698,7 +698,7 @@ resize_widget_new (GimpViewable *viewable,
if (type == ScaleWidget)
{
GtkWidget *hbox;
GtkWidget *option_menu;
GtkWidget *combo;
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
......@@ -708,15 +708,19 @@ resize_widget_new (GimpViewable *viewable,
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
private->interpolation_menu = option_menu =
gimp_enum_option_menu_new (GIMP_TYPE_INTERPOLATION_TYPE,
G_CALLBACK (gimp_menu_item_update),
&resize->interpolation);
gimp_int_option_menu_set_history (GTK_OPTION_MENU (option_menu),
resize->interpolation);
gtk_box_pack_start (GTK_BOX (hbox), option_menu,
FALSE, FALSE, 0);
gtk_widget_show (option_menu);
combo = gimp_enum_combo_box_new (GIMP_TYPE_INTERPOLATION_TYPE);
gimp_enum_combo_box_set_active (GIMP_ENUM_COMBO_BOX (combo),
resize->interpolation);
g_signal_connect (combo, "changed",
G_CALLBACK (gimp_enum_combo_box_get_active),
&resize->interpolation);
gimp_enum_combo_box_set_active (GIMP_ENUM_COMBO_BOX (combo),
resize->interpolation);
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
gtk_widget_show (combo);
private->interpolation_menu = combo;
if (gimp_image_base_type (resize->gimage) == GIMP_INDEXED)
{
......@@ -892,8 +896,8 @@ response_callback (GtkWidget *widget,
resize->interpolation =
resize->gimage->gimp->config->interpolation_type;
gimp_int_option_menu_set_history (GTK_OPTION_MENU (private->interpolation_menu),
resize->interpolation);
gimp_enum_combo_box_set_active (GIMP_ENUM_COMBO_BOX (private->interpolation_menu),
resize->interpolation);
}
break;
......
......@@ -30,7 +30,7 @@
#include "core/gimpdatafactory.h"
#include "core/gimptoolinfo.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumcombobox.h"
#include "widgets/gimppropwidgets.h"
#include "gimpblendoptions.h"
......@@ -66,7 +66,7 @@ static void gimp_blend_options_get_property (GObject *object,
static void blend_options_gradient_type_notify (GimpBlendOptions *options,
GParamSpec *pspec,
GtkWidget *repeat_menu);
GtkWidget *repeat_combo);
static GimpPaintOptionsClass *parent_class = NULL;
......@@ -244,7 +244,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *frame;
GtkWidget *menu;
GtkWidget *combo;
GtkWidget *button;
config = G_OBJECT (tool_options);
......@@ -261,22 +261,22 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
FALSE, 0.0, 0.0);
/* the gradient type menu */
menu = gimp_prop_enum_option_menu_new (config, "gradient-type", 0, 0);
gimp_enum_option_menu_set_stock_prefix (GTK_OPTION_MENU (menu),
"gimp-gradient");
combo = gimp_prop_enum_combo_box_new (config, "gradient-type", 0, 0);
gimp_enum_combo_box_set_stock_prefix (GIMP_ENUM_COMBO_BOX (combo),
"gimp-gradient");
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
_("Shape:"), 1.0, 0.5,
menu, 2, TRUE);
combo, 2, TRUE);
/* the repeat option */
menu = gimp_prop_enum_option_menu_new (config, "gradient-repeat", 0, 0);
combo = gimp_prop_enum_combo_box_new (config, "gradient-repeat", 0, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 5,
_("Repeat:"), 1.0, 0.5,
menu, 2, TRUE);
combo, 2, TRUE);
g_signal_connect (config, "notify::gradient-type",
G_CALLBACK (blend_options_gradient_type_notify),
menu);
combo);
button = gimp_prop_check_button_new (config, "dither",
_("Dithering"));
......@@ -325,7 +325,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
static void
blend_options_gradient_type_notify (GimpBlendOptions *options,
GParamSpec *pspec,
GtkWidget *repeat_menu)
GtkWidget *repeat_combo)
{
gtk_widget_set_sensitive (repeat_menu, options->gradient_type < 6);
gtk_widget_set_sensitive (repeat_combo, options->gradient_type < 6);
}
......@@ -33,7 +33,7 @@
#include "core/gimpimagemap.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumwidgets.h"
#include "display/gimpdisplay.h"
......
......@@ -33,7 +33,7 @@
#include "core/gimptoolinfo.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumwidgets.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
#include "widgets/gimpwidgets-utils.h"
......
......@@ -44,7 +44,8 @@
#include "widgets/gimpcolorbar.h"
#include "widgets/gimpcursor.h"
#include "widgets/gimpenummenu.h"
#include "widgets/gimpenumcombobox.h"
#include "widgets/gimpenumwidgets.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimphistogramview.h"
#include "widgets/gimppropwidgets.h"
......@@ -301,14 +302,17 @@ gimp_curves_tool_initialize (GimpTool *tool,
gimp_color_tool_enable (GIMP_COLOR_TOOL (tool),
GIMP_COLOR_OPTIONS (tool->tool_info->tool_options));
/* FIXME: regression! */
#if 0
/* set the sensitivity of the channel menu based on the drawable type */
gimp_int_option_menu_set_sensitive (GTK_OPTION_MENU (c_tool->channel_menu),
(GimpIntOptionMenuSensitivityCallback) curves_set_sensitive_callback,
c_tool);
#endif
/* set the current selection */
gimp_int_option_menu_set_history (GTK_OPTION_MENU (c_tool->channel_menu),
c_tool->channel);
gimp_enum_combo_box_set_active (GIMP_ENUM_COMBO_BOX (c_tool->channel_menu),
c_tool->channel);
if (! c_tool->color && c_tool->alpha)
c_tool->channel = 1;
......@@ -477,11 +481,12 @@ gimp_curves_tool_dialog (GimpImageMapTool *image_map_tool)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
menu = gimp_enum_option_menu_new (GIMP_TYPE_HISTOGRAM_CHANNEL,
G_CALLBACK (curves_channel_callback),
tool);
gimp_enum_option_menu_set_stock_prefix (GTK_OPTION_MENU (menu),
"gimp-channel");
menu = gimp_enum_combo_box_new (GIMP_TYPE_HISTOGRAM_CHANNEL);
g_signal_connect (menu, "changed",
G_CALLBACK (curves_channel_callback),
tool);
gimp_enum_combo_box_set_stock_prefix (GIMP_ENUM_COMBO_BOX (menu),
"gimp-channel");
gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0);
gtk_widget_show (menu);
......@@ -796,17 +801,19 @@ static void
curves_channel_callback (GtkWidget *widget,
GimpCurvesTool *tool)
{
gimp_menu_item_update (widget, &tool->channel);
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->graph),
tool->channel);
if (gimp_enum_combo_box_get_active (GIMP_ENUM_COMBO_BOX (widget),
(gint *) &tool->channel))
{
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->graph),
tool->channel);
/* FIXME: hack */
if (! tool->color && tool->alpha)
tool->channel = (tool->channel > 1) ? 2 : 1;
/* FIXME: hack */
if (! tool->color && tool->alpha)
tool->channel = (tool->channel > 1) ? 2 : 1;
}