Commit 608837cc authored by Maurits Rijk's avatar Maurits Rijk

Enable mnemonics (#80804) and some work to get imagemap plug-in up-to-date.

parent 9f632962
2002-06-01 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/imagemap/imap_preferences.[ch]
* plug-ins/imagemap/imap_table.c: enable mnemonics
* plug-ins/imagemap/imap_grid.[ch]: Add mnemonics to dialog and added
option to couple Width/Height and Left/Top offset in grid with
GimpChainButton.
* plug-ins/imagemap/imap_tools.c (make_tools)
* plug-ins/imagemap/imap_selection.c (make_selection_toolbar)
* plug-ins/imagemap/imap_toolbar.c (make_toolbar): set style to only
show icons (GTK_TOOLBAR_ICONS).
* plug-ins/imagemap/imap_object.[ch] (object_on_button_press): event
function now returns boolean value.
* plug-ins/imagemap/imap_main.c (dialog): removed some obsolete code
that caused strange startup size of plug-in.
2002-06-01 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/common/convmatrix.c: enable mnemonics and removed some
global variables.
* plug-ins/mosaic/mosaic.c (mosaic_dialog):
* plug-ins/common/nova.c (nova_center_create)
* plug-ins/common/nlfilt.c (mw_preview_new)
* plug-ins/common/noisify.c (noisify_dialog)
* plug-ins/common/borderaverage.c (borderaverage_dialog): enable
mnemonics
2002-05-31 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/common/borderaverage.c (borderaverage_dialog)
* plug-ins/common/blur.c (blur_dialog): enable mnemonics
2002-05-31 Jakub Steiner <jimmac@ximian.com>
* themes/Default/images/tools/stock-tool-blend-22.png: make it
......
......@@ -598,6 +598,7 @@ blur_dialog (void)
GtkWidget *dlg;
GtkWidget *frame;
GtkWidget *table;
GtkWidget *label;
GtkWidget *seed_hbox;
GtkObject *adj;
......@@ -643,15 +644,17 @@ blur_dialog (void)
seed_hbox = gimp_random_seed_new (&pivals.blur_seed,
&pivals.seed_type,
SEED_TIME, SEED_USER);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Random Seed:"), 1.0, 0.5,
label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("_Random Seed:"), 1.0, 0.5,
seed_hbox, 1, TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (label),
GIMP_RANDOM_SEED_SPINBUTTON (seed_hbox));
/*
* Randomization percentage label & scale (1 to 100)
*/
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Randomization %:"), SCALE_WIDTH, 0,
_("R_andomization %:"), SCALE_WIDTH, 0,
pivals.blur_pct, 1.0, 100.0, 1.0, 10.0, 0,
TRUE, 0, 0,
_("Percentage of pixels to be filtered"), NULL);
......@@ -663,7 +666,7 @@ blur_dialog (void)
* Repeat count label & scale (1 to 100)
*/
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
_("Repeat:"), SCALE_WIDTH, 0,
_("R_epeat:"), SCALE_WIDTH, 0,
pivals.blur_rcount, 1.0, 100.0, 1.0, 10.0, 0,
TRUE, 0, 0,
_("Number of times to apply filter"), NULL);
......
......@@ -399,7 +399,7 @@ borderaverage_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_widget_show (hbox);
label = gtk_label_new (_("Thickness:"));
label = gtk_label_new_with_mnemonic (_("_Thickness:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
......@@ -407,6 +407,7 @@ borderaverage_dialog (void)
0, 256, 1, 5, 0, 0, 0);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
......@@ -421,7 +422,7 @@ borderaverage_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_widget_show (hbox);
label = gtk_label_new (_("Bucket Size:"));
label = gtk_label_new_with_mnemonic (_("_Bucket Size:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
......@@ -442,6 +443,7 @@ borderaverage_dialog (void)
NULL);
gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0);
gtk_widget_show (menu);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), menu);
gtk_widget_show (dlg);
......
......@@ -78,22 +78,22 @@ typedef enum
MIRROR
} BorderMode;
GimpDrawable *drawable;
static GimpDrawable *drawable;
gchar * const channel_labels[] =
static gchar * const channel_labels[] =
{
N_("Grey"),
N_("Red"),
N_("Green"),
N_("Blue"),
N_("Alpha")
N_("Gr_ey"),
N_("Re_d"),
N_("_Green"),
N_("_Blue"),
N_("_Alpha")
};
gchar * const bmode_labels[] =
static gchar * const bmode_labels[] =
{
N_("Extend"),
N_("Wrap"),
N_("Crop")
N_("E_xtend"),
N_("_Wrap"),
N_("Cro_p")
};
/* Declare local functions. */
......@@ -117,9 +117,8 @@ GimpPlugInInfo PLUG_IN_INFO =
run, /* run_proc */
};
gint bytes;
gint sx1, sy1, sx2, sy2;
gint run_flag = 0;
static gint bytes;
static gint run_flag = 0;
typedef struct
{
......@@ -132,7 +131,7 @@ typedef struct
gint autoset;
} config;
const config default_config =
static const config default_config =
{
{
{ 0.0, 0.0, 0.0, 0.0, 0.0 },
......@@ -149,7 +148,7 @@ const config default_config =
0 /* autoset */
};
config my_config;
static config my_config;
struct
{
......@@ -503,6 +502,7 @@ doit (void)
GimpPixelRgn srcPR, destPR;
gint width, height, row, col;
gint w, h, i;
gint sx1, sy1, sx2, sy2;
gint x1, x2, y1, y2;
guchar *destrow[3];
guchar *srcrow[5];
......@@ -918,7 +918,7 @@ dialog (void)
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_box_pack_start (GTK_BOX (box), table, TRUE, FALSE, 0);
label = gtk_label_new (_("Divisor:"));
label = gtk_label_new_with_mnemonic (_("D_ivisor:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
gtk_widget_show (label);
......@@ -927,6 +927,7 @@ dialog (void)
gtk_widget_set_size_request (entry, 40, -1);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1);
gtk_widget_show (entry);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (entry_callback),
......@@ -938,7 +939,7 @@ dialog (void)
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_box_pack_start (GTK_BOX (box), table, TRUE, FALSE, 0);
label = gtk_label_new (_("Offset:"));
label = gtk_label_new_with_mnemonic (_("O_ffset:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
gtk_widget_show (label);
......@@ -947,6 +948,7 @@ dialog (void)
gtk_widget_set_size_request (entry, 40, -1);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1);
gtk_widget_show (entry);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (entry_callback),
......@@ -963,7 +965,7 @@ dialog (void)
gtk_box_pack_start (GTK_BOX (yetanotherbox), box, FALSE, FALSE, 0);
my_widgets.autoset = button =
gtk_check_button_new_with_label (_("Automatic"));
gtk_check_button_new_with_mnemonic (_("A_utomatic"));
gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0);
gtk_widget_show (button);
......@@ -972,7 +974,7 @@ dialog (void)
&my_config.autoset);
my_widgets.alpha_alg = button =
gtk_check_button_new_with_label (_("Alpha-weighting"));
gtk_check_button_new_with_mnemonic (_("A_lpha-weighting"));
if (my_config.alpha_alg == -1)
gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0);
......@@ -1001,7 +1003,7 @@ dialog (void)
for (i = 0; i < 3; i++)
{
my_widgets.bmode[i] = button =
gtk_radio_button_new_with_label (group, gettext (bmode_labels[i]));
gtk_radio_button_new_with_mnemonic (group, gettext (bmode_labels[i]));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
gtk_widget_show (button);
......@@ -1025,7 +1027,7 @@ dialog (void)
for (i = 0; i < 5; i++)
{
my_widgets.channels[i] = button =
gtk_check_button_new_with_label (gettext (channel_labels[i]));
gtk_check_button_new_with_mnemonic (gettext (channel_labels[i]));
if (my_config.channels[i] < 0)
gtk_widget_set_sensitive (button, FALSE);
......
......@@ -607,7 +607,7 @@ mosaic_dialog (void)
gtk_container_set_border_width (GTK_CONTAINER (toggle_vbox), 2);
gtk_container_add (GTK_CONTAINER (frame), toggle_vbox);
toggle = gtk_check_button_new_with_label (_("Antialiasing"));
toggle = gtk_check_button_new_with_mnemonic (_("_Antialiasing"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), mvals.antialiasing);
gtk_widget_show (toggle);
......@@ -616,7 +616,7 @@ mosaic_dialog (void)
G_CALLBACK (gimp_toggle_button_update),
&mvals.antialiasing);
toggle = gtk_check_button_new_with_label ( _("Color Averaging"));
toggle = gtk_check_button_new_with_mnemonic ( _("Co_lor Averaging"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
mvals.color_averaging);
......@@ -626,7 +626,7 @@ mosaic_dialog (void)
G_CALLBACK (gimp_toggle_button_update),
&mvals.color_averaging);
toggle = gtk_check_button_new_with_label ( _("Allow Tile splitting"));
toggle = gtk_check_button_new_with_mnemonic ( _("Allo_w Tile splitting"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
mvals.tile_allow_split);
......@@ -636,7 +636,7 @@ mosaic_dialog (void)
G_CALLBACK (gimp_toggle_button_update),
&mvals.tile_allow_split);
toggle = gtk_check_button_new_with_label ( _("Pitted Surfaces"));
toggle = gtk_check_button_new_with_mnemonic ( _("_Pitted Surfaces"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
(mvals.tile_surface == ROUGH));
......@@ -646,7 +646,7 @@ mosaic_dialog (void)
G_CALLBACK (gimp_toggle_button_update),
&mvals.tile_surface);
toggle = gtk_check_button_new_with_label ( _("FG/BG Lighting"));
toggle = gtk_check_button_new_with_mnemonic ( _("_FG/BG Lighting"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
(mvals.grout_color == FG_BG));
......@@ -665,11 +665,11 @@ mosaic_dialog (void)
G_CALLBACK (gimp_radio_button_update),
&mvals.tile_type, (gpointer) mvals.tile_type,
_("Squares"),
_("_Squares"),
(gpointer) SQUARES, NULL,
_("Hexagons"),
_("He_xagons"),
(gpointer) HEXAGONS, NULL,
_("Octagons & Squares"),
_("Oc_tagons & Squares"),
(gpointer) OCTAGONS, NULL,
NULL);
......@@ -690,7 +690,7 @@ mosaic_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), table);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("Tile Size:"), SCALE_WIDTH, 0,
_("T_ile Size:"), SCALE_WIDTH, 0,
mvals.tile_size, 5.0, 100.0, 1.0, 10.0, 1,
TRUE, 0, 0,
NULL, NULL);
......@@ -699,7 +699,7 @@ mosaic_dialog (void)
&mvals.tile_size);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Tile Height:"), SCALE_WIDTH, 0,
_("Tile _Height:"), SCALE_WIDTH, 0,
mvals.tile_height, 1.0, 50.0, 1.0, 10.0, 1,
TRUE, 0, 0,
NULL, NULL);
......@@ -708,7 +708,7 @@ mosaic_dialog (void)
&mvals.tile_height);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
_("Tile Spacing:"), SCALE_WIDTH, 0,
_("Til_e Spacing:"), SCALE_WIDTH, 0,
mvals.tile_spacing, 1.0, 50.0, 1.0, 10.0, 1,
TRUE, 0, 0,
NULL, NULL);
......@@ -717,7 +717,7 @@ mosaic_dialog (void)
&mvals.tile_spacing);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
_("Tile Neatness:"), SCALE_WIDTH, 0,
_("Tile _Neatness:"), SCALE_WIDTH, 0,
mvals.tile_neatness,
0.0, 1.0, 0.10, 0.1, 2,
TRUE, 0, 0,
......@@ -727,7 +727,7 @@ mosaic_dialog (void)
&mvals.tile_neatness);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
_("Light Direction:"), SCALE_WIDTH, 0,
_("Light _Direction:"), SCALE_WIDTH, 0,
mvals.light_dir, 0.0, 360.0, 1.0, 15.0, 1,
TRUE, 0, 0,
NULL, NULL);
......@@ -736,7 +736,7 @@ mosaic_dialog (void)
&mvals.light_dir);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 5,
_("Color Variation:"), SCALE_WIDTH, 0,
_("Color _Variation:"), SCALE_WIDTH, 0,
mvals.color_variation,
0.0, 1.0, 0.01, 0.1, 2,
TRUE, 0, 0,
......
......@@ -576,7 +576,7 @@ mw_preview_new (GtkWidget *parent,
gtk_container_add (GTK_CONTAINER (pframe), preview);
gtk_widget_show (preview);
button = gtk_check_button_new_with_label (_("_Do Preview"));
button = gtk_check_button_new_with_mnemonic (_("_Do Preview"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), do_preview);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
......
......@@ -405,10 +405,7 @@ noisify (GimpDrawable *drawable,
gtk_widget_queue_draw (preview);
if(even)
g_free(even);
if(odd)
g_free(odd);
}
......@@ -538,7 +535,7 @@ noisify_dialog (GimpDrawable *drawable,
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
toggle = gtk_check_button_new_with_label (_("_Independent"));
toggle = gtk_check_button_new_with_mnemonic (_("_Independent"));
gtk_table_attach (GTK_TABLE (table), toggle, 0, 3, 0, 1, GTK_FILL, 0, 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), nvals.independent);
gtk_widget_show (toggle);
......
......@@ -702,7 +702,7 @@ nova_center_create (GimpDrawable *drawable)
gtk_widget_show (frame);
check = gtk_check_button_new_with_label (_("S_how Cursor"));
check = gtk_check_button_new_with_mnemonic (_("S_how Cursor"));
gtk_table_attach (GTK_TABLE (table), check, 0, 4, 2, 3,
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), show_cursor);
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2002 Maurits Rijk lpeek.mrijk@consunet.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -25,7 +25,8 @@
#include <gtk/gtk.h>
#include "libgimp/gimp.h"
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "imap_grid.h"
#include "imap_main.h"
......@@ -39,6 +40,27 @@
typedef enum {GRID_HIDDEN, GRID_LINES, GRID_CROSSES} GridType_t;
typedef struct {
DefaultDialog_t *dialog;
GtkWidget *type_frame;
GtkWidget *granularity_frame;
GtkWidget *offset_frame;
GtkWidget *snap;
GtkWidget *width;
GtkWidget *height;
GtkWidget *chain_width_height;
GtkWidget *left;
GtkWidget *top;
GtkWidget *chain_left_top;
GtkWidget *hidden;
GtkWidget *lines;
GtkWidget *crosses;
GtkWidget *preview;
gboolean enable_preview;
} GridDialog_t;
static GdkGC *grid_gc;
static gboolean grid_snap = FALSE;
static gint grid_width = 15;
......@@ -114,25 +136,53 @@ grid_assign_value(GtkWidget *widget, gpointer data, gint *value)
static void
width_changed_cb(GtkWidget *widget, gpointer data)
{
GridDialog_t *dialog = (GridDialog_t*) data;
grid_assign_value(widget, data, &grid_width);
if (gimp_chain_button_get_active(
GIMP_CHAIN_BUTTON(dialog->chain_width_height))) {
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->height), value);
}
}
static void
height_changed_cb(GtkWidget *widget, gpointer data)
{
GridDialog_t *dialog = (GridDialog_t*) data;
grid_assign_value(widget, data, &grid_height);
if (gimp_chain_button_get_active(
GIMP_CHAIN_BUTTON(dialog->chain_width_height))) {
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->width), value);
}
}
static void
left_changed_cb(GtkWidget *widget, gpointer data)
{
GridDialog_t *dialog = (GridDialog_t*) data;
grid_assign_value(widget, data, &grid_left);
if (gimp_chain_button_get_active(
GIMP_CHAIN_BUTTON(dialog->chain_left_top))) {
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->top), value);
}
}
static void
top_changed_cb(GtkWidget *widget, gpointer data)
{
GridDialog_t *dialog = (GridDialog_t*) data;
grid_assign_value(widget, data, &grid_top);
if (gimp_chain_button_get_active(
GIMP_CHAIN_BUTTON(dialog->chain_left_top))) {
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->left), value);
}
}
static GridDialog_t*
......@@ -140,11 +190,11 @@ create_grid_settings_dialog()
{
GridDialog_t *data = g_new(GridDialog_t, 1);
DefaultDialog_t *dialog;
GtkWidget *main_table, *table;
GtkWidget *main_table, *table, *label;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *button;
GSList* group;
GtkWidget *chain_button;
data->dialog = dialog = make_default_dialog(_("Grid Settings"));
default_dialog_set_ok_cb(dialog, grid_settings_ok_cb, (gpointer) data);
......@@ -157,7 +207,7 @@ create_grid_settings_dialog()
main_table, TRUE, TRUE, 10);
gtk_widget_show(main_table);
data->snap = gtk_check_button_new_with_label(_("Snap-To Grid Enabled"));
data->snap = gtk_check_button_new_with_mnemonic(_("_Snap-To Grid Enabled"));
g_signal_connect(G_OBJECT(data->snap), "toggled",
G_CALLBACK (snap_toggled_cb), data);
gtk_table_attach_defaults(GTK_TABLE(main_table), data->snap, 0, 1, 0, 1);
......@@ -170,23 +220,25 @@ create_grid_settings_dialog()
gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox);
data->hidden = button = gtk_radio_button_new_with_label(NULL, _("Hidden"));
button = gtk_radio_button_new_with_mnemonic_from_widget(NULL, _("_Hidden"));
data->hidden = button;
g_signal_connect(G_OBJECT(button), "toggled",
G_CALLBACK (type_toggled_cb), (gpointer) GRID_HIDDEN);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 10);
gtk_widget_show(button);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
data->lines = button = gtk_radio_button_new_with_label(group, _("Lines"));
button = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(button), _("_Lines"));
data->lines = button;
g_signal_connect(G_OBJECT(button), "toggled",
G_CALLBACK (type_toggled_cb), (gpointer) GRID_LINES);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 10);
gtk_widget_show(button);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
data->crosses = button = gtk_radio_button_new_with_label(group,
_("Crosses"));
button = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(button), _("C_rosses"));
data->crosses = button;
g_signal_connect(G_OBJECT(button), "toggled",
G_CALLBACK (type_toggled_cb),
(gpointer) GRID_CROSSES);
......@@ -195,47 +247,57 @@ create_grid_settings_dialog()
data->granularity_frame = frame = gtk_frame_new(_("Grid Granularity"));
gtk_table_attach_defaults(GTK_TABLE(main_table), frame, 0, 1, 2, 3);
table = gtk_table_new(2, 3, FALSE);
table = gtk_table_new(2, 4, FALSE);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
gtk_table_set_col_spacings(GTK_TABLE(table), 10);
gtk_container_add(GTK_CONTAINER(frame), table);
create_label_in_table(table, 0, 0, _("Width"));
label = create_label_in_table(table, 0, 0, _("_Width"));
data->width = create_spin_button_in_table(table, 0, 1, 15, 1, 100);
g_signal_connect(G_OBJECT(data->width), "changed",
g_signal_connect(G_OBJECT(data->width), "value_changed",
G_CALLBACK (width_changed_cb), (gpointer) data);
create_label_in_table(table, 0, 2, _("pixels"));
create_label_in_table(table, 0, 3, _("pixels"));
create_label_in_table(table, 1, 0, _("Height"));
label = create_label_in_table(table, 1, 0, _("_Height"));
data->height = create_spin_button_in_table(table, 1, 1, 15, 1, 100);
g_signal_connect(G_OBJECT(data->height), "changed",
g_signal_connect(G_OBJECT(data->height), "value_changed",
G_CALLBACK (height_changed_cb), (gpointer) data);
create_label_in_table(table, 1, 2, _("pixels"));
create_label_in_table(table, 1, 3, _("pixels"));
chain_button = gimp_chain_button_new(GIMP_CHAIN_RIGHT);
data->chain_width_height = chain_button;
gtk_table_attach_defaults(GTK_TABLE(table), chain_button, 2, 3, 0, 2);
gtk_widget_show(chain_button);
gtk_widget_show(table);
gtk_widget_show(frame);
data->offset_frame = frame = gtk_frame_new(_("Grid Offset"));
gtk_table_attach_defaults(GTK_TABLE(main_table), frame, 1, 2, 2, 3);
table = gtk_table_new(2, 2, FALSE);
table = gtk_table_new(2, 3, FALSE);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
gtk_table_set_col_spacings(GTK_TABLE(table), 10);
gtk_container_add(GTK_CONTAINER(frame), table);
label = create_label_in_table(table, 0, 2, _("pixels from l_eft"));
data->left = create_spin_button_in_table(table, 0, 0, 0, 0, 100);
g_signal_connect(G_OBJECT(data->left), "changed",
g_signal_connect(G_OBJECT(data->left), "value_changed",
G_CALLBACK (left_changed_cb), (gpointer) data);
create_label_in_table(table, 0, 1, _("pixels from left"));
label = create_label_in_table(table, 1, 2, _("pixels from _top"));
data->top = create_spin_button_in_table(table, 1, 0, 0, 0, 100);
g_signal_connect(G_OBJECT(data->top), "changed",
g_signal_connect(G_OBJECT(data->top), "value_changed",
G_CALLBACK (top_changed_cb), (gpointer) data);
create_label_in_table(table, 1, 1, _("pixels from top"));
chain_button = gimp_chain_button_new(GIMP_CHAIN_RIGHT);
data->chain_left_top = chain_button;
gtk_table_attach_defaults(GTK_TABLE(table), chain_button, 1, 2, 0, 2);
gtk_widget_show(chain_button);
data->preview = create_check_button_in_table(main_table, 3, 0,
_("Preview"));
_("_Preview"));
g_signal_connect(G_OBJECT(data->preview), "toggled",
G_CALLBACK (toggle_preview_cb), (gpointer) data);
gtk_widget_show(data->preview);
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2002 Maurits Rijk lpeek.mrijk@consunet.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -24,26 +24,6 @@
#ifndef _IMAP_GRID_H
#define _IMAP_GRID_H
#include "imap_default_dialog.h"
typedef struct {
DefaultDialog_t *dialog;
GtkWidget *type_frame;
GtkWidget *granularity_frame;
GtkWidget *offset_frame;
GtkWidget *snap;
GtkWidget *width;
GtkWidget *height;
GtkWidget *left;
GtkWidget *top;
GtkWidget *hidden;
GtkWidget *lines;
GtkWidget *crosses;
GtkWidget *preview;
gboolean enable_preview;
} GridDialog_t;
void do_grid_settings_dialog();
void draw_grid(GtkWidget *preview);
gboolean toggle_grid();
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2002 Maurits Rijk lpeek.mrijk@consunet.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -107,7 +107,7 @@ static StatusBar_t *_statusbar;
static ToolBar_t *_toolbar;
static ObjectList_t *_shapes;
static gint _zoom_factor = 1;
static void (*_button_press_func)(GtkWidget*, GdkEventButton*, gpointer);
static gboolean (*_button_press_func)(GtkWidget*, GdkEventButton*, gpointer);
static gpointer _button_press_param;