Commit f3d1c7ef authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

correct resolution size_entry initialisation.

1999-03-12  Michael Natterer  <mitschel@cs.tu-berlin.de>

        * app/preferences_dialog.c: correct resolution size_entry
        initialisation.

        * libgimp/gimpsizeentry.c: fixed the update bug reported by Marc.
        Works now but still needs discussion...
parent 17b18717
1999-03-12 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/preferences_dialog.c: correct resolution size_entry
initialisation.
* libgimp/gimpsizeentry.c: fixed the update bug reported by Marc.
Works now but still needs discussion...
1999-03-11 Jay Cox <jaycox@earthlink.net>
* app/paint_funcs.c: made the INT_MULT3 macro be more accurate.
......
......@@ -1139,8 +1139,8 @@ file_pref_cmd_callback (GtkWidget *widget,
default_resolution_sizeentry =
gimp_size_entry_new (2, default_resolution_units, "%s", FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, 1e-5, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, 1e-5, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, 1, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, 1, 32767);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, default_xresolution);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, default_yresolution);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_resolution_sizeentry), _("Horizontal"), 0, 1, 0.0);
......
......@@ -1139,8 +1139,8 @@ file_pref_cmd_callback (GtkWidget *widget,
default_resolution_sizeentry =
gimp_size_entry_new (2, default_resolution_units, "%s", FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, 1e-5, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, 1e-5, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, 1, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, 1, 32767);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, default_xresolution);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, default_yresolution);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_resolution_sizeentry), _("Horizontal"), 0, 1, 0.0);
......
......@@ -1139,8 +1139,8 @@ file_pref_cmd_callback (GtkWidget *widget,
default_resolution_sizeentry =
gimp_size_entry_new (2, default_resolution_units, "%s", FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, 1e-5, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, 1e-5, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, 1, 32767);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, 1, 32767);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, default_xresolution);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, default_yresolution);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_resolution_sizeentry), _("Horizontal"), 0, 1, 0.0);
......
......@@ -22,9 +22,20 @@
#define SIZE_MAX_VALUE 500000.0 /* is that enough ?? */
static void gimp_size_entry_unit_callback (GtkWidget *widget, gpointer data);
static void gimp_size_entry_value_callback (GtkWidget *widget, gpointer data);
static void gimp_size_entry_refval_callback (GtkWidget *widget, gpointer data);
static void gimp_size_entry_unit_callback (GtkWidget *widget,
gpointer data);
static void gimp_size_entry_value_callback (GtkWidget *widget,
gpointer data);
static void gimp_size_entry_value_focus_out_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static void gimp_size_entry_refval_callback (GtkWidget *widget,
gpointer data);
static void gimp_size_entry_refval_focus_out_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data);
enum {
GSE_VALUE_CHANGED_SIGNAL,
......@@ -227,6 +238,10 @@ gimp_size_entry_new (gint number_of_fields,
gse->show_refval+1, gse->show_refval+2);
gtk_signal_connect (GTK_OBJECT (gsef->value_spinbutton), "changed",
(GtkSignalFunc) gimp_size_entry_value_callback, gsef);
gtk_signal_connect (GTK_OBJECT (gsef->value_spinbutton),
"focus_out_event",
(GdkEventFunc) gimp_size_entry_value_focus_out_callback,
gsef);
gtk_widget_show (gsef->value_spinbutton);
if (gse->show_refval)
......@@ -247,6 +262,10 @@ gimp_size_entry_new (gint number_of_fields,
gtk_signal_connect (GTK_OBJECT (gsef->refval_spinbutton), "changed",
(GtkSignalFunc) gimp_size_entry_refval_callback,
gsef);
gtk_signal_connect (GTK_OBJECT (gsef->refval_spinbutton),
"focus_out_event",
(GdkEventFunc) gimp_size_entry_refval_focus_out_callback,
gsef);
gtk_widget_show (gsef->refval_spinbutton);
}
......@@ -473,6 +492,7 @@ gimp_size_entry_value_callback (GtkWidget *widget,
gfloat new_value;
gsef = (GimpSizeEntryField*)data;
new_value =
gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON(gsef->value_spinbutton));
......@@ -484,6 +504,19 @@ gimp_size_entry_value_callback (GtkWidget *widget,
}
}
static void
gimp_size_entry_value_focus_out_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
GimpSizeEntryField *gsef;
gsef = (GimpSizeEntryField*)data;
gtk_spin_button_update (GTK_SPIN_BUTTON (gsef->value_spinbutton));
gimp_size_entry_value_callback (widget, data);
}
/* refval stuff ***********/
......@@ -676,6 +709,7 @@ gimp_size_entry_refval_callback (GtkWidget *widget,
gfloat new_refval;
gsef = (GimpSizeEntryField*)data;
new_refval =
gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (gsef->refval_spinbutton));
......@@ -687,6 +721,19 @@ gimp_size_entry_refval_callback (GtkWidget *widget,
}
}
static void
gimp_size_entry_refval_focus_out_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
GimpSizeEntryField *gsef;
gsef = (GimpSizeEntryField*)data;
gtk_spin_button_update (GTK_SPIN_BUTTON (gsef->refval_spinbutton));
gimp_size_entry_refval_callback (widget, data);
}
/* unit stuff ***********/
......
......@@ -22,9 +22,20 @@
#define SIZE_MAX_VALUE 500000.0 /* is that enough ?? */
static void gimp_size_entry_unit_callback (GtkWidget *widget, gpointer data);
static void gimp_size_entry_value_callback (GtkWidget *widget, gpointer data);
static void gimp_size_entry_refval_callback (GtkWidget *widget, gpointer data);
static void gimp_size_entry_unit_callback (GtkWidget *widget,
gpointer data);
static void gimp_size_entry_value_callback (GtkWidget *widget,
gpointer data);
static void gimp_size_entry_value_focus_out_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static void gimp_size_entry_refval_callback (GtkWidget *widget,
gpointer data);
static void gimp_size_entry_refval_focus_out_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data);
enum {
GSE_VALUE_CHANGED_SIGNAL,
......@@ -227,6 +238,10 @@ gimp_size_entry_new (gint number_of_fields,
gse->show_refval+1, gse->show_refval+2);
gtk_signal_connect (GTK_OBJECT (gsef->value_spinbutton), "changed",
(GtkSignalFunc) gimp_size_entry_value_callback, gsef);
gtk_signal_connect (GTK_OBJECT (gsef->value_spinbutton),
"focus_out_event",
(GdkEventFunc) gimp_size_entry_value_focus_out_callback,
gsef);
gtk_widget_show (gsef->value_spinbutton);
if (gse->show_refval)
......@@ -247,6 +262,10 @@ gimp_size_entry_new (gint number_of_fields,
gtk_signal_connect (GTK_OBJECT (gsef->refval_spinbutton), "changed",
(GtkSignalFunc) gimp_size_entry_refval_callback,
gsef);
gtk_signal_connect (GTK_OBJECT (gsef->refval_spinbutton),
"focus_out_event",
(GdkEventFunc) gimp_size_entry_refval_focus_out_callback,
gsef);
gtk_widget_show (gsef->refval_spinbutton);
}
......@@ -473,6 +492,7 @@ gimp_size_entry_value_callback (GtkWidget *widget,
gfloat new_value;
gsef = (GimpSizeEntryField*)data;
new_value =
gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON(gsef->value_spinbutton));
......@@ -484,6 +504,19 @@ gimp_size_entry_value_callback (GtkWidget *widget,
}
}
static void
gimp_size_entry_value_focus_out_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
GimpSizeEntryField *gsef;
gsef = (GimpSizeEntryField*)data;
gtk_spin_button_update (GTK_SPIN_BUTTON (gsef->value_spinbutton));
gimp_size_entry_value_callback (widget, data);
}
/* refval stuff ***********/
......@@ -676,6 +709,7 @@ gimp_size_entry_refval_callback (GtkWidget *widget,
gfloat new_refval;
gsef = (GimpSizeEntryField*)data;
new_refval =
gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (gsef->refval_spinbutton));
......@@ -687,6 +721,19 @@ gimp_size_entry_refval_callback (GtkWidget *widget,
}
}
static void
gimp_size_entry_refval_focus_out_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
GimpSizeEntryField *gsef;
gsef = (GimpSizeEntryField*)data;
gtk_spin_button_update (GTK_SPIN_BUTTON (gsef->refval_spinbutton));
gimp_size_entry_refval_callback (widget, data);
}
/* unit stuff ***********/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment