use separate variables for width and height entry. Fixes bug #480303.

2007-09-26  Sven Neumann  <sven@gimp.org>

	* plug-ins/maze/maze_face.c (maze_dialog): use separate variables
	for width and height entry. Fixes bug #480303.

svn path=/trunk/; revision=23658
This commit is contained in:
Sven Neumann 2007-09-26 10:57:44 +00:00 committed by Sven Neumann
parent c9635dddec
commit bda4441973
2 changed files with 49 additions and 43 deletions

View File

@ -1,9 +1,14 @@
2007-09-26 Sven Neumann <sven@gimp.org>
* plug-ins/maze/maze_face.c (maze_dialog): use separate variables
for width and height entry. Fixes bug #480303.
2007-09-26 Sven Neumann <sven@gimp.org> 2007-09-26 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcontrollerwheel.c (gimp_controller_wheel_scroll): * app/widgets/gimpcontrollerwheel.c (gimp_controller_wheel_scroll):
fixed check for modifier keys and always return on a matched fixed check for modifier keys and always return on a matched
event(bug #480319). Also reordered the list of events as the code event(bug #480319). Also reordered the list of events as the code
now does not any longer rely on a certain order. does not any longer rely on a certain order.
2007-09-26 Sven Neumann <sven@gimp.org> 2007-09-26 Sven Neumann <sven@gimp.org>

View File

@ -51,15 +51,15 @@
#define MORE 1 #define MORE 1
#define LESS -1 #define LESS -1
typedef void (* EntscaleIntCallbackFunc) (gint value, gpointer data); typedef void (* EntscaleIntCallback) (gint value, gpointer data);
typedef struct typedef struct
{ {
GtkObject *adjustment; GtkObject *adjustment;
GtkWidget *entry; GtkWidget *entry;
gboolean constraint; gboolean constraint;
EntscaleIntCallbackFunc callback; EntscaleIntCallback callback;
gpointer call_data; gpointer call_data;
} EntscaleIntData; } EntscaleIntData;
/* entscale stuff end */ /* entscale stuff end */
@ -131,16 +131,16 @@ static void div_buttonr_callback (GtkObject *object);
#endif #endif
/* entscale stuff begin */ /* entscale stuff begin */
static GtkWidget * entscale_int_new (GtkWidget *table, static GtkWidget * entscale_int_new (GtkWidget *table,
gint x, gint x,
gint y, gint y,
const gchar *caption, const gchar *caption,
gint *intvar, gint *intvar,
gint min, gint min,
gint max, gint max,
gboolean constraint, gboolean constraint,
EntscaleIntCallbackFunc callback, EntscaleIntCallback callback,
gpointer data); gpointer data);
static void entscale_int_scale_update (GtkAdjustment *adjustment, static void entscale_int_scale_update (GtkAdjustment *adjustment,
gpointer data); gpointer data);
@ -165,7 +165,8 @@ maze_dialog (void)
GtkWidget *table; GtkWidget *table;
GtkWidget *table2; GtkWidget *table2;
GtkWidget *tilecheck; GtkWidget *tilecheck;
GtkWidget *entry; GtkWidget *width_entry;
GtkWidget *height_entry;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *frame; GtkWidget *frame;
GtkSizeGroup *group; GtkSizeGroup *group;
@ -210,33 +211,33 @@ maze_dialog (void)
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* entscale == Entry and Scale pair function found in pixelize.c */ /* entscale == Entry and Scale pair function found in pixelize.c */
entry = entscale_int_new (table, 0, trow, _("Width (pixels):"), width_entry = entscale_int_new (table, 0, trow, _("Width (pixels):"),
&mvals.width, &mvals.width,
1, sel_w/4, TRUE, 1, sel_w/4, TRUE,
(EntscaleIntCallbackFunc) height_width_callback, (EntscaleIntCallback) height_width_callback,
&entry); &width_entry);
trow++; trow++;
/* Number of Divisions entry */ /* Number of Divisions entry */
hbox = divbox_new (&sel_w, entry, &entry); hbox = divbox_new (&sel_w, width_entry, &width_entry);
g_snprintf (buffer, BUFSIZE, "%d", (sel_w / mvals.width)); g_snprintf (buffer, BUFSIZE, "%d", (sel_w / mvals.width));
gtk_entry_set_text (GTK_ENTRY (entry), buffer); gtk_entry_set_text (GTK_ENTRY (width_entry), buffer);
gimp_table_attach_aligned (GTK_TABLE (table), 0, trow, gimp_table_attach_aligned (GTK_TABLE (table), 0, trow,
_("Pieces:"), 0.0, 0.5, _("Pieces:"), 0.0, 0.5,
hbox, 1, TRUE); hbox, 1, TRUE);
gtk_table_set_row_spacing (GTK_TABLE (table), trow, 12); gtk_table_set_row_spacing (GTK_TABLE (table), trow, 12);
trow++; trow++;
entry = entscale_int_new (table, 0, trow, _("Height (pixels):"), height_entry = entscale_int_new (table, 0, trow, _("Height (pixels):"),
&mvals.height, &mvals.height,
1, sel_h/4, TRUE, 1, sel_h/4, TRUE,
(EntscaleIntCallbackFunc) height_width_callback, (EntscaleIntCallback) height_width_callback,
&entry); &height_entry);
trow++; trow++;
hbox = divbox_new (&sel_h, entry, &entry); hbox = divbox_new (&sel_h, height_entry, &height_entry);
g_snprintf (buffer, BUFSIZE, "%d", (sel_h / mvals.height)); g_snprintf (buffer, BUFSIZE, "%d", (sel_h / mvals.height));
gtk_entry_set_text (GTK_ENTRY (entry), buffer); gtk_entry_set_text (GTK_ENTRY (height_entry), buffer);
gimp_table_attach_aligned (GTK_TABLE (table), 0, trow, gimp_table_attach_aligned (GTK_TABLE (table), 0, trow,
_("Pieces:"), 0.0, 0.5, _("Pieces:"), 0.0, 0.5,
hbox, 1, TRUE); hbox, 1, TRUE);
@ -484,7 +485,7 @@ div_entry_callback (GtkWidget *entry,
{ {
guint divs, width, max; guint divs, width, max;
EntscaleIntData *userdata; EntscaleIntData *userdata;
EntscaleIntCallbackFunc friend_callback; EntscaleIntCallback friend_callback;
divs = atoi (gtk_entry_get_text (GTK_ENTRY (entry))); divs = atoi (gtk_entry_get_text (GTK_ENTRY (entry)));
if (divs < 4) /* If this is under 4 (e.g. 0), something's weird. */ if (divs < 4) /* If this is under 4 (e.g. 0), something's weird. */
@ -565,16 +566,16 @@ maze_message (const gchar *message)
* call_data: data for callback func * call_data: data for callback func
*/ */
static GtkWidget* static GtkWidget*
entscale_int_new (GtkWidget *table, entscale_int_new (GtkWidget *table,
gint x, gint x,
gint y, gint y,
const gchar *caption, const gchar *caption,
gint *intvar, gint *intvar,
gint min, gint min,
gint max, gint max,
gboolean constraint, gboolean constraint,
EntscaleIntCallbackFunc callback, EntscaleIntCallback callback,
gpointer call_data) gpointer call_data)
{ {
EntscaleIntData *userdata; EntscaleIntData *userdata;
GtkWidget *hbox; GtkWidget *hbox;