Commit 24ffa60f authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

#include <gtk/gtk.h>.

1999-04-05  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/action_area.h: #include <gtk/gtk.h>.

	* app/devices.c: made the "Input Devices" dialog follow the action
	area conventions. Grab pointer in the pattern/brush preview popups.

	* app/errorconsole.c: use the actionarea functions.

	* app/gimpunit.c: had the wrong copyright header.

	* app/info_dialog.c: correctly set the spinbuttons' digits.

	* app/perspectice_tool.c: removed #include <stdio.h> again but
	didn't forget to s/sprintf/g_snprintf/ this time.

	* app/preferences_dialog.c: unified order of varible definitions,
	removed some unused variables.

	* app/crop.c
	* app/file_new_dialog.c
	* app/info_dialog.[ch]
	* app/interface.c
	* app/preferences_dialog.c
	* app/rotate_tool.c
	* app/scale_tool.c
	* libgimp/gimpsizeentry.[ch]
	* libgimp/gimpunitmenu.[ch]: prepared for "percent" in size
	entries.
parent 1cdbc896
1999-04-05 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/action_area.h: #include <gtk/gtk.h>.
* app/devices.c: made the "Input Devices" dialog follow the action
area conventions. Grab pointer in the pattern/brush preview popups.
* app/errorconsole.c: use the actionarea functions.
* app/gimpunit.c: had the wrong copyright header.
* app/info_dialog.c: correctly set the spinbuttons' digits.
* app/perspectice_tool.c: removed #include <stdio.h> again but
didn't forget to s/sprintf/g_snprintf/ this time.
* app/preferences_dialog.c: unified order of varible definitions,
removed some unused variables.
* app/crop.c
* app/file_new_dialog.c
* app/info_dialog.[ch]
* app/interface.c
* app/preferences_dialog.c
* app/rotate_tool.c
* app/scale_tool.c
* libgimp/gimpsizeentry.[ch]
* libgimp/gimpunitmenu.[ch]: prepared for "percent" in size
entries.
Sat Apr 3 22:58:17 PST 1999 Manish Singh <yosh@gimp.org>
* tools.h: #include <gtk/gtk.h>
......
......@@ -18,6 +18,7 @@
#ifndef __ACTIONAREA_H__
#define __ACTIONAREA_H__
#include <gtk/gtk.h>
typedef void (*ActionCallback) (GtkWidget *, gpointer);
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
*
* gimpunit.c
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
......@@ -268,14 +268,14 @@ void save_unitrc (void)
if (!fp)
return;
fprintf(fp, _("# GIMP unitrc\n"));
fprintf(fp, _("# This file contains your user unit database. You can\n"));
fprintf(fp, _("# modify this list with the unit editor. You are not\n"));
fprintf(fp, _("# supposed to edit it manually, but of course you can do.\n"));
fprintf(fp, _("# This file will be entirely rewritten every time you\n"));
fprintf(fp, _("# quit the gimp.\n\n"));
fprintf (fp, _("# GIMP unitrc\n"));
fprintf (fp, _("# This file contains your user unit database. You can\n"));
fprintf (fp, _("# modify this list with the unit editor. You are not\n"));
fprintf (fp, _("# supposed to edit it manually, but of course you can do.\n"));
fprintf (fp, _("# This file will be entirely rewritten every time you\n"));
fprintf (fp, _("# quit the gimp.\n\n"));
/* save window geometries */
/* save user defined units */
for (i = gimp_unit_get_number_of_built_in_units();
i < gimp_unit_get_number_of_units ();
i++)
......
......@@ -827,7 +827,6 @@ crop_info_create (Tool *tool)
GDisplay *gdisp;
GtkWidget *sizeentry;
GtkWidget *spinbutton2;
GtkAdjustment *adjustment2;
gdisp = (GDisplay *) tool->gdisp_ptr;
......@@ -837,18 +836,14 @@ crop_info_create (Tool *tool)
/* add the information fields */
spinbutton2 = info_dialog_add_spinbutton (crop_info, _("Origin X:"), NULL,
-1, 1, 1, 10, 1, 1, 2, NULL, NULL);
adjustment2 = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton2));
sizeentry =
info_dialog_add_sizeentry (crop_info, _("Y:"), orig_vals, 1,
gdisp->dot_for_dot ?
UNIT_PIXEL : gdisp->gimage->unit, "%a",
TRUE, FALSE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
TRUE, FALSE, FALSE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
crop_orig_changed, tool);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (sizeentry),
adjustment2,
GTK_SPIN_BUTTON (spinbutton2),
NULL, NULL);
GTK_SPIN_BUTTON (spinbutton2), NULL);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0,
-65536, 65536);
......@@ -864,18 +859,14 @@ crop_info_create (Tool *tool)
spinbutton2 = info_dialog_add_spinbutton (crop_info, _("Width:"), NULL,
-1, 1, 1, 10, 1, 1, 2, NULL, NULL);
adjustment2 = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton2));
sizeentry =
info_dialog_add_sizeentry (crop_info, _("Height:"), size_vals, 1,
gdisp->dot_for_dot ?
UNIT_PIXEL : gdisp->gimage->unit, "%a",
TRUE, FALSE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
TRUE, FALSE, FALSE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
crop_size_changed, tool);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (sizeentry),
adjustment2,
GTK_SPIN_BUTTON (spinbutton2),
NULL, NULL);
GTK_SPIN_BUTTON (spinbutton2), NULL);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0,
-65536, 65536);
......
......@@ -127,6 +127,7 @@ void
create_input_dialog (void)
{
static GtkWidget *inputd = NULL;
GtkWidget *hbbox;
if (!inputd)
{
......@@ -135,7 +136,24 @@ create_input_dialog (void)
/* register this one only */
dialog_register(inputd);
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG(inputd)->action_area), 2);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG(inputd)->action_area), 2);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (inputd)->action_area),
FALSE);
hbbox = gtk_hbutton_box_new();
gtk_button_box_set_spacing(GTK_BUTTON_BOX (hbbox), 4);
gtk_widget_reparent (GTK_INPUT_DIALOG (inputd)->save_button, hbbox);
GTK_WIDGET_SET_FLAGS (GTK_INPUT_DIALOG (inputd)->save_button,
GTK_CAN_DEFAULT);
gtk_widget_reparent (GTK_INPUT_DIALOG (inputd)->close_button, hbbox);
GTK_WIDGET_SET_FLAGS (GTK_INPUT_DIALOG (inputd)->close_button,
GTK_CAN_DEFAULT);
gtk_box_pack_end(GTK_BOX (GTK_DIALOG (inputd)->action_area), hbbox,
FALSE, FALSE, 0);
gtk_widget_grab_default (GTK_INPUT_DIALOG (inputd)->close_button);
gtk_widget_show(hbbox);
gtk_signal_connect (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->save_button),
"clicked",
......@@ -1035,6 +1053,13 @@ device_preview_events (GtkWidget *widget,
break; /* Error no device info */
}
/* Grab the pointer */
gdk_pointer_grab (widget->window, FALSE,
(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK),
NULL, NULL, bevent->time);
if(type == BRUSH_PREVIEW)
{
brush = device_info->brush;
......
......@@ -367,7 +367,7 @@ file_new_cmd_callback (GtkWidget *widget,
gtk_widget_show (hbox);
vals->size_sizeentry = gimp_size_entry_new (2, vals->unit, "%p",
FALSE, TRUE, 75,
FALSE, FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (vals->size_sizeentry), 0,
vals->xresolution, FALSE);
......@@ -401,7 +401,7 @@ file_new_cmd_callback (GtkWidget *widget,
gtk_widget_show (hbox);
vals->simple_res = gimp_size_entry_new (1, vals->res_unit, "%s",
FALSE, FALSE, 75,
FALSE, FALSE, FALSE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (vals->simple_res),
0, 1, 32767);
......@@ -424,7 +424,7 @@ file_new_cmd_callback (GtkWidget *widget,
(not shown by default, but used to keep track of all the variables) */
vals->resolution_sizeentry =
gimp_size_entry_new (2, vals->res_unit, "%s",
FALSE, TRUE, 75,
FALSE, FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (vals->resolution_sizeentry),
0, 1, 32767);
......
......@@ -53,7 +53,8 @@ info_field_new (InfoDialog *idialog,
label = gtk_label_new (gettext (title));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (idialog->info_table), label,
0, 1, row - 1, row, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
0, 1, row - 1, row,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
gtk_table_attach_defaults (GTK_TABLE (idialog->info_table), widget,
......@@ -293,7 +294,7 @@ info_dialog_add_spinbutton (InfoDialog *idialog,
adjustment = gtk_adjustment_new (value_ptr ? *value_ptr : 0, lower, upper,
step_increment, page_increment, page_size);
spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment),
climb_rate, MIN (MAX (digits, 6), 0));
climb_rate, MAX (MIN (digits, 6), 0));
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton),
GTK_SHADOW_NONE);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
......@@ -320,6 +321,7 @@ info_dialog_add_sizeentry (InfoDialog *idialog,
GUnit unit,
gchar *unit_format,
gboolean menu_show_pixels,
gboolean menu_show_percent,
gboolean show_refval,
GimpSizeEntryUP update_policy,
GtkSignalFunc callback,
......@@ -334,7 +336,8 @@ info_dialog_add_sizeentry (InfoDialog *idialog,
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
sizeentry = gimp_size_entry_new (nfields, unit, unit_format,
menu_show_pixels, show_refval, 75,
menu_show_pixels, menu_show_percent,
show_refval, 75,
update_policy);
if (value_ptr)
for (i = 0; i < nfields; i++)
......
......@@ -109,6 +109,7 @@ GtkWidget *info_dialog_add_sizeentry (InfoDialog *idialog,
GUnit unit,
gchar *unit_format,
gboolean menu_show_pixels,
gboolean menu_show_percent,
gboolean show_refval,
GimpSizeEntryUP update_policy,
GtkSignalFunc callback,
......
This diff is collapsed.
......@@ -1019,7 +1019,7 @@ query_size_box (gchar *title,
(GtkSignalFunc) size_query_box_ok_callback,
query_box);
sizeentry = gimp_size_entry_new (1, unit, "%p", TRUE, FALSE, 100,
sizeentry = gimp_size_entry_new (1, unit, "%p", TRUE, FALSE, FALSE, 100,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0,
resolution, FALSE);
......
......@@ -1019,7 +1019,7 @@ query_size_box (gchar *title,
(GtkSignalFunc) size_query_box_ok_callback,
query_box);
sizeentry = gimp_size_entry_new (1, unit, "%p", TRUE, FALSE, 100,
sizeentry = gimp_size_entry_new (1, unit, "%p", TRUE, FALSE, FALSE, 100,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0,
resolution, FALSE);
......
......@@ -44,6 +44,8 @@
#endif
#endif
#include "actionarea.h"
#include <gtk/gtk.h>
#include "commands.h"
......@@ -63,12 +65,21 @@ static GtkWidget *text;
static void
error_console_close_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data)
gpointer data)
{
gtk_widget_hide (error_console);
}
static gint
error_console_delete_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
error_console_close_callback (NULL, NULL);
return TRUE;
}
void
error_console_free (void)
{
......@@ -210,10 +221,15 @@ text_clicked_callback (GtkWidget *widget,
return TRUE;
}
/* the action area structure */
static ActionAreaItem action_items[] =
{
{ N_("Close"), error_console_close_callback, NULL, NULL }
};
static void
error_console_create_window (void)
{
GtkWidget *button;
GtkWidget *table;
GtkWidget *vscrollbar;
GtkWidget *menu;
......@@ -230,16 +246,12 @@ error_console_create_window (void)
gtk_widget_set_usize (error_console, 250, 300);
gtk_window_set_policy (GTK_WINDOW(error_console), TRUE, TRUE, FALSE);
gtk_signal_connect (GTK_OBJECT (error_console), "delete_event",
(GtkSignalFunc) error_console_close_callback, NULL);
(GdkEventFunc) error_console_delete_callback, NULL);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (error_console)->vbox), 2);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (error_console)->action_area), 2);
/* Action area */
button = gtk_button_new_with_label (_("Close"));
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) error_console_close_callback, NULL);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (error_console)->action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
action_items[0].user_data = error_console;
build_action_area (GTK_DIALOG (error_console), action_items, 1, 0);
menu = gtk_menu_new ();
......
......@@ -367,7 +367,7 @@ file_new_cmd_callback (GtkWidget *widget,
gtk_widget_show (hbox);
vals->size_sizeentry = gimp_size_entry_new (2, vals->unit, "%p",
FALSE, TRUE, 75,
FALSE, FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (vals->size_sizeentry), 0,
vals->xresolution, FALSE);
......@@ -401,7 +401,7 @@ file_new_cmd_callback (GtkWidget *widget,
gtk_widget_show (hbox);
vals->simple_res = gimp_size_entry_new (1, vals->res_unit, "%s",
FALSE, FALSE, 75,
FALSE, FALSE, FALSE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (vals->simple_res),
0, 1, 32767);
......@@ -424,7 +424,7 @@ file_new_cmd_callback (GtkWidget *widget,
(not shown by default, but used to keep track of all the variables) */
vals->resolution_sizeentry =
gimp_size_entry_new (2, vals->res_unit, "%s",
FALSE, TRUE, 75,
FALSE, FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (vals->resolution_sizeentry),
0, 1, 32767);
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
*
* gimpunit.c
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
......@@ -268,14 +268,14 @@ void save_unitrc (void)
if (!fp)
return;
fprintf(fp, _("# GIMP unitrc\n"));
fprintf(fp, _("# This file contains your user unit database. You can\n"));
fprintf(fp, _("# modify this list with the unit editor. You are not\n"));
fprintf(fp, _("# supposed to edit it manually, but of course you can do.\n"));
fprintf(fp, _("# This file will be entirely rewritten every time you\n"));
fprintf(fp, _("# quit the gimp.\n\n"));
fprintf (fp, _("# GIMP unitrc\n"));
fprintf (fp, _("# This file contains your user unit database. You can\n"));
fprintf (fp, _("# modify this list with the unit editor. You are not\n"));
fprintf (fp, _("# supposed to edit it manually, but of course you can do.\n"));
fprintf (fp, _("# This file will be entirely rewritten every time you\n"));
fprintf (fp, _("# quit the gimp.\n\n"));
/* save window geometries */
/* save user defined units */
for (i = gimp_unit_get_number_of_built_in_units();
i < gimp_unit_get_number_of_units ();
i++)
......
......@@ -127,6 +127,7 @@ void
create_input_dialog (void)
{
static GtkWidget *inputd = NULL;
GtkWidget *hbbox;
if (!inputd)
{
......@@ -135,7 +136,24 @@ create_input_dialog (void)
/* register this one only */
dialog_register(inputd);
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG(inputd)->action_area), 2);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG(inputd)->action_area), 2);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (inputd)->action_area),
FALSE);
hbbox = gtk_hbutton_box_new();
gtk_button_box_set_spacing(GTK_BUTTON_BOX (hbbox), 4);
gtk_widget_reparent (GTK_INPUT_DIALOG (inputd)->save_button, hbbox);
GTK_WIDGET_SET_FLAGS (GTK_INPUT_DIALOG (inputd)->save_button,
GTK_CAN_DEFAULT);
gtk_widget_reparent (GTK_INPUT_DIALOG (inputd)->close_button, hbbox);
GTK_WIDGET_SET_FLAGS (GTK_INPUT_DIALOG (inputd)->close_button,
GTK_CAN_DEFAULT);
gtk_box_pack_end(GTK_BOX (GTK_DIALOG (inputd)->action_area), hbbox,
FALSE, FALSE, 0);
gtk_widget_grab_default (GTK_INPUT_DIALOG (inputd)->close_button);
gtk_widget_show(hbbox);
gtk_signal_connect (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->save_button),
"clicked",
......@@ -1035,6 +1053,13 @@ device_preview_events (GtkWidget *widget,
break; /* Error no device info */
}
/* Grab the pointer */
gdk_pointer_grab (widget->window, FALSE,
(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK),
NULL, NULL, bevent->time);
if(type == BRUSH_PREVIEW)
{
brush = device_info->brush;
......
......@@ -367,7 +367,7 @@ file_new_cmd_callback (GtkWidget *widget,
gtk_widget_show (hbox);
vals->size_sizeentry = gimp_size_entry_new (2, vals->unit, "%p",
FALSE, TRUE, 75,
FALSE, FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (vals->size_sizeentry), 0,
vals->xresolution, FALSE);
......@@ -401,7 +401,7 @@ file_new_cmd_callback (GtkWidget *widget,
gtk_widget_show (hbox);
vals->simple_res = gimp_size_entry_new (1, vals->res_unit, "%s",
FALSE, FALSE, 75,
FALSE, FALSE, FALSE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (vals->simple_res),
0, 1, 32767);
......@@ -424,7 +424,7 @@ file_new_cmd_callback (GtkWidget *widget,
(not shown by default, but used to keep track of all the variables) */
vals->resolution_sizeentry =
gimp_size_entry_new (2, vals->res_unit, "%s",
FALSE, TRUE, 75,
FALSE, FALSE, TRUE, 75,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (vals->resolution_sizeentry),
0, 1, 32767);
......
......@@ -53,7 +53,8 @@ info_field_new (InfoDialog *idialog,
label = gtk_label_new (gettext (title));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (idialog->info_table), label,
0, 1, row - 1, row, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
0, 1, row - 1, row,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
gtk_table_attach_defaults (GTK_TABLE (idialog->info_table), widget,
......@@ -293,7 +294,7 @@ info_dialog_add_spinbutton (InfoDialog *idialog,
adjustment = gtk_adjustment_new (value_ptr ? *value_ptr : 0, lower, upper,
step_increment, page_increment, page_size);
spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment),
climb_rate, MIN (MAX (digits, 6), 0));
climb_rate, MAX (MIN (digits, 6), 0));
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton),
GTK_SHADOW_NONE);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
......@@ -320,6 +321,7 @@ info_dialog_add_sizeentry (InfoDialog *idialog,
GUnit unit,
gchar *unit_format,
gboolean menu_show_pixels,
gboolean menu_show_percent,
gboolean show_refval,
GimpSizeEntryUP update_policy,
GtkSignalFunc callback,
......@@ -334,7 +336,8 @@ info_dialog_add_sizeentry (InfoDialog *idialog,
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
sizeentry = gimp_size_entry_new (nfields, unit, unit_format,
menu_show_pixels, show_refval, 75,
menu_show_pixels, menu_show_percent,
show_refval, 75,
update_policy);
if (value_ptr)
for (i = 0; i < nfields; i++)
......
......@@ -109,6 +109,7 @@ GtkWidget *info_dialog_add_sizeentry (InfoDialog *idialog,
GUnit unit,
gchar *unit_format,
gboolean menu_show_pixels,
gboolean menu_show_percent,
gboolean show_refval,
GimpSizeEntryUP update_policy,
GtkSignalFunc callback,
......
......@@ -127,6 +127,7 @@ void
create_input_dialog (void)
{
static GtkWidget *inputd = NULL;
GtkWidget *hbbox;
if (!inputd)
{
......@@ -135,7 +136,24 @@ create_input_dialog (void)
/* register this one only */
dialog_register(inputd);
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG(inputd)->action_area), 2);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG(inputd)->action_area), 2);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (inputd)->action_area),
FALSE);
hbbox = gtk_hbutton_box_new();
gtk_button_box_set_spacing(GTK_BUTTON_BOX (hbbox), 4);
gtk_widget_reparent (GTK_INPUT_DIALOG (inputd)->save_button, hbbox);
GTK_WIDGET_SET_FLAGS (GTK_INPUT_DIALOG (inputd)->save_button,
GTK_CAN_DEFAULT);
gtk_widget_reparent (GTK_INPUT_DIALOG (inputd)->close_button, hbbox);
GTK_WIDGET_SET_FLAGS (GTK_INPUT_DIALOG (inputd)->close_button,
GTK_CAN_DEFAULT);
gtk_box_pack_end(GTK_BOX (GTK_DIALOG (inputd)->action_area), hbbox,
FALSE, FALSE, 0);
gtk_widget_grab_default (GTK_INPUT_DIALOG (inputd)->close_button);
gtk_widget_show(hbbox);
gtk_signal_connect (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->save_button),
"clicked",
......@@ -1035,6 +1053,13 @@ device_preview_events (GtkWidget *widget,
break; /* Error no device info */
}
/* Grab the pointer */
gdk_pointer_grab (widget->window, FALSE,
(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK),
NULL, NULL, bevent->time);
if(type == BRUSH_PREVIEW)
{
brush = device_info->brush;
......
This diff is collapsed.
......@@ -53,7 +53,8 @@ info_field_new (InfoDialog *idialog,
label = gtk_label_new (gettext (title));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (idialog->info_table), label,
0, 1, row - 1, row, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
0, 1, row - 1, row,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
gtk_table_attach_defaults (GTK_TABLE (idialog->info_table), widget,
......@@ -293,7 +294,7 @@ info_dialog_add_spinbutton (InfoDialog *idialog,
adjustment = gtk_adjustment_new (value_ptr ? *value_ptr : 0, lower, upper,
step_increment, page_increment, page_size);
spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment),
climb_rate, MIN (MAX (digits, 6), 0));
climb_rate, MAX (MIN (digits, 6), 0));
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton),
GTK_SHADOW_NONE);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
......@@ -320,6 +321,7 @@ info_dialog_add_sizeentry (InfoDialog *idialog,
GUnit unit,
gchar *unit_format,
gboolean menu_show_pixels,
gboolean menu_show_percent,
gboolean show_refval,
GimpSizeEntryUP update_policy,
GtkSignalFunc callback,
......@@ -334,7 +336,8 @@ info_dialog_add_sizeentry (InfoDialog *idialog,
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
sizeentry = gimp_size_entry_new (nfields, unit, unit_format,
menu_show_pixels, show_refval, 75,
menu_show_pixels, menu_show_percent,
show_refval, 75,
update_policy);
if (value_ptr)
for (i = 0; i < nfields; i++)
......
......@@ -109,6 +109,7 @@ GtkWidget *info_dialog_add_sizeentry (InfoDialog *idialog,
GUnit unit,
gchar *unit_format,
gboolean menu_show_pixels,
gboolean menu_show_percent,
gboolean show_refval,
GimpSizeEntryUP update_policy,
GtkSignalFunc callback,
......
......@@ -1019,7 +1019,7 @@ query_size_box (gchar *title,
(GtkSignalFunc) size_query_box_ok_callback,
query_box);
sizeentry = gimp_size_entry_new (1, unit, "%p", TRUE, FALSE, 100,
sizeentry = gimp_size_entry_new (1, unit, "%p", TRUE, FALSE, FALSE, 100,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0,
resolution, FALSE);
......
......@@ -15,8 +15,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdio.h>
#include "appenv.h"
#include "drawable.h"
#include "gdisplay.h"
......@@ -169,7 +167,8 @@ perspective_info_update (Tool *tool)
for (j = 0; j < 3; j++)
{
p += sprintf (p, "%10.3g", transform_core->transform[i][j]);
p += g_snprintf (p, MAX_INFO_BUF - (p - matrix_row_buf[i]),
"%10.3g", transform_core->transform[i][j]);
}
}
......
This diff is collapsed.
......@@ -72,7 +72,6 @@ rotate_tool_transform (Tool *tool,
GDisplay *gdisp;
GtkWidget *widget;
GtkWidget *spinbutton2;
GtkAdjustment *adjustment2;
transform_core = (TransformCore *) tool->private;
gdisp = (GDisplay *) gdisp_ptr;
......@@ -101,20 +100,16 @@ rotate_tool_transform (Tool *tool,
spinbutton2 =
info_dialog_add_spinbutton (transform_info, _("Center X:"), NULL,
-1, 1, 1, 10, 1, 1, 2, NULL, NULL);
adjustment2 =
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton2));
widget =
info_dialog_add_sizeentry (transform_info, _("Y:"),
center_vals, 1,
gdisp->dot_for_dot ?
UNIT_PIXEL : gdisp->gimage->unit, "%a",
TRUE, FALSE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
TRUE, FALSE, FALSE,
GIMP_SIZE_ENTRY_UPDATE_SIZE,
rotate_center_changed, tool);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (widget),
adjustment2,
GTK_SPIN_BUTTON (spinbutton2),
NULL, NULL);
GTK_SPIN_BUTTON (spinbutton2), NULL);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (widget), 0,
-4096,
......
......@@ -66,7 +66,6 @@ scale_tool_transform (Tool *tool,
GDisplay *gdisp;
TransformCore *transform_core;
GtkWidget *spinbutton2;
GtkAdjustment *adjustment2;
gdisp = (GDisplay *) gdisp_ptr;
transform_core = (TransformCore *) tool->private;
......@@ -86,20 +85,16 @@ scale_tool_transform (Tool *tool,
spinbutton2 =
info_dialog_add_spinbutton (transform_info, _("Current Width:"),
NULL, -1, 1, 1, 10, 1, 1, 2, NULL, NULL);
adjustment2 =
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton2));
sizeentry =
info_dialog_add_sizeentry (transform_info, _("Height:"),
size_vals, 1,
gdisp->dot_for_dot ?
UNIT_PIXEL : gdisp->gimage->unit, "%a",
TRUE, FALSE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
TRUE, FALSE, FALSE,
GIMP_SIZE_ENTRY_UPDATE_SIZE,
scale_size_changed, tool);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (sizeentry),
adjustment2,
GTK_SPIN_BUTTON (spinbutton2),
NULL, NULL);
GTK_SPIN_BUTTON (spinbutton2), NULL);
gtk_signal_connect (GTK_OBJECT (sizeentry), "unit_changed",
scale_unit_changed, tool);
......
......@@ -827,7 +827,6 @@ crop_info_create (Tool *tool)
GDisplay *gdisp;
GtkWidget *sizeentry;
GtkWidget *spinbutton2;
GtkAdjustment *adjustment2;
gdisp = (GDisplay *) tool->gdisp_ptr;
......@@ -837,18 +836,14 @@ crop_info_create (Tool *tool)
/* add the information fields */
spinbutton2 = info_dialog_add_spinbutton (crop_info, _("Origin X:"), NULL,
-1, 1, 1, 10, 1, 1, 2, NULL, NULL);
adjustment2 = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton2));
sizeentry =
info_dialog_add_sizeentry (crop_info, _("Y:"), orig_vals, 1,
gdisp->dot_for_dot ?
UNIT_PIXEL : gdisp->gimage->unit, "%a",
TRUE, FALSE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
TRUE, FALSE, FALSE, GIMP_SIZE_ENTRY_UPDATE_SIZE,
crop_orig_changed, tool);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (sizeentry),
adjustment2,
GTK_SPIN_BUTTON (spinbutton2),