[gimp] imagemap: monster-port to kill GtkTable
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] imagemap: monster-port to kill GtkTable
- Date: Sun, 20 May 2018 19:38:29 +0000 (UTC)
commit de76dc20bcb162bebf5622d5de5c09002602bd88
Author: Simon Budig <simon budig de>
Date: Sat May 5 19:30:39 2018 +0200
imagemap: monster-port to kill GtkTable
plug-ins/imagemap/Makefile.am | 4 +-
plug-ins/imagemap/imap_circle.c | 32 +++++-----
plug-ins/imagemap/imap_cmd_gimp_guides.c | 12 ++--
plug-ins/imagemap/imap_cmd_guides.c | 38 +++++-----
plug-ins/imagemap/imap_default_dialog.c | 14 ++--
plug-ins/imagemap/imap_default_dialog.h | 3 +-
plug-ins/imagemap/imap_edit_area_info.c | 90 ++++++++++++------------
plug-ins/imagemap/imap_grid.c | 64 +++++++++---------
plug-ins/imagemap/imap_polygon.c | 34 +++++-----
plug-ins/imagemap/imap_preferences.c | 85 ++++++++++++------------
plug-ins/imagemap/imap_preview.c | 35 +++++-----
plug-ins/imagemap/imap_rectangle.c | 41 ++++++------
plug-ins/imagemap/imap_settings.c | 37 +++++-----
plug-ins/imagemap/imap_table.c | 81 ----------------------
plug-ins/imagemap/imap_table.h | 39 -----------
plug-ins/imagemap/imap_ui_grid.c | 108 ++++++++++++++++++++++++++++++
plug-ins/imagemap/imap_ui_grid.h | 52 ++++++++++++++
17 files changed, 402 insertions(+), 367 deletions(-)
---
diff --git a/plug-ins/imagemap/Makefile.am b/plug-ins/imagemap/Makefile.am
index 018a959..dd99c49 100644
--- a/plug-ins/imagemap/Makefile.am
+++ b/plug-ins/imagemap/Makefile.am
@@ -126,8 +126,8 @@ imagemap_SOURCES = \
imap_statusbar.h \
imap_string.c \
imap_string.h \
- imap_table.c \
- imap_table.h \
+ imap_ui_grid.c \
+ imap_ui_grid.h \
imap_taglist.c \
imap_taglist.h
diff --git a/plug-ins/imagemap/imap_circle.c b/plug-ins/imagemap/imap_circle.c
index e040ebf..e612436 100644
--- a/plug-ins/imagemap/imap_circle.c
+++ b/plug-ins/imagemap/imap_circle.c
@@ -32,7 +32,7 @@
#include "imap_misc.h"
#include "imap_object_popup.h"
#include "imap_stock.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -247,36 +247,36 @@ static gpointer
circle_create_info_widget(GtkWidget *frame)
{
CircleProperties_t *props = g_new(CircleProperties_t, 1);
- GtkWidget *table, *label;
+ GtkWidget *grid, *label;
gint max_width = get_image_width();
gint max_height = get_image_height();
- table = gtk_table_new(3, 3, FALSE);
- gtk_container_add(GTK_CONTAINER(frame), table);
+ grid = gtk_grid_new ();
+ gtk_container_add (GTK_CONTAINER(frame), grid);
- gtk_table_set_row_spacings(GTK_TABLE(table), 6);
- gtk_table_set_col_spacings(GTK_TABLE(table), 6);
- gtk_widget_show(table);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+ gtk_widget_show (grid);
- label = create_label_in_table(table, 0, 0, _("Center _x:"));
- props->x = create_spin_button_in_table(table, label, 0, 1, 1, 0,
+ label = create_label_in_grid (grid, 0, 0, _("Center _x:"));
+ props->x = create_spin_button_in_grid (grid, label, 0, 1, 1, 0,
max_width - 1);
g_signal_connect(props->x, "value-changed",
G_CALLBACK (x_changed_cb), (gpointer) props);
- create_label_in_table(table, 0, 2, _("pixels"));
+ create_label_in_grid (grid, 0, 2, _("pixels"));
- label = create_label_in_table(table, 1, 0, _("Center _y:"));
- props->y = create_spin_button_in_table(table, label, 1, 1, 1, 0,
+ label = create_label_in_grid (grid, 1, 0, _("Center _y:"));
+ props->y = create_spin_button_in_grid (grid, label, 1, 1, 1, 0,
max_height - 1);
g_signal_connect(props->y, "value-changed",
G_CALLBACK (y_changed_cb), (gpointer) props);
- create_label_in_table(table, 1, 2, _("pixels"));
+ create_label_in_grid (grid, 1, 2, _("pixels"));
- label = create_label_in_table(table, 2, 0, _("_Radius:"));
- props->r = create_spin_button_in_table(table, label, 2, 1, 1, 1, G_MAXINT);
+ label = create_label_in_grid (grid, 2, 0, _("_Radius:"));
+ props->r = create_spin_button_in_grid (grid, label, 2, 1, 1, 1, G_MAXINT);
g_signal_connect(props->r, "value-changed",
G_CALLBACK (r_changed_cb), (gpointer) props);
- create_label_in_table(table, 2, 2, _("pixels"));
+ create_label_in_grid (grid, 2, 2, _("pixels"));
return props;
}
diff --git a/plug-ins/imagemap/imap_cmd_gimp_guides.c b/plug-ins/imagemap/imap_cmd_gimp_guides.c
index 2a2ea92..ddbfb3f 100644
--- a/plug-ins/imagemap/imap_cmd_gimp_guides.c
+++ b/plug-ins/imagemap/imap_cmd_gimp_guides.c
@@ -33,7 +33,7 @@
#include "imap_default_dialog.h"
#include "imap_main.h"
#include "imap_rectangle.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -140,16 +140,16 @@ make_gimp_guides_dialog(void)
{
GimpGuidesDialog_t *data = g_new(GimpGuidesDialog_t, 1);
DefaultDialog_t *dialog;
- GtkWidget *table, *frame, *hbox, *vbox;
+ GtkWidget *grid, *frame, *hbox, *vbox;
GtkWidget *label;
dialog = data->dialog = make_default_dialog(_("Use Gimp Guides"));
default_dialog_set_ok_cb(dialog, gimp_guides_ok_cb, data);
- table = default_dialog_add_table(dialog, 3, 2);
+ grid = default_dialog_add_grid (dialog);
frame = gimp_frame_new(_("Create"));
gtk_widget_show(frame);
- gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 0, 1);
+ gtk_grid_attach (GTK_GRID (grid), frame, 0, 0, 1, 1);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add(GTK_CONTAINER(frame), hbox);
@@ -167,7 +167,7 @@ make_gimp_guides_dialog(void)
frame = gimp_frame_new(_("Add Additional Guides"));
gtk_widget_show(frame);
- gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 1, 2);
+ gtk_grid_attach (GTK_GRID (grid), frame, 0, 1, 1, 1);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_container_add(GTK_CONTAINER(frame), vbox);
@@ -190,7 +190,7 @@ make_gimp_guides_dialog(void)
gtk_widget_show(data->lower_border);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
- gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 2, 2, 3);
+ gtk_grid_attach (GTK_GRID (grid), hbox, 0, 2, 2, 1);
gtk_widget_show(hbox);
label = gtk_label_new_with_mnemonic(_("_Base URL:"));
diff --git a/plug-ins/imagemap/imap_cmd_guides.c b/plug-ins/imagemap/imap_cmd_guides.c
index 4c465f9..47ed1f9 100644
--- a/plug-ins/imagemap/imap_cmd_guides.c
+++ b/plug-ins/imagemap/imap_cmd_guides.c
@@ -29,7 +29,7 @@
#include "imap_default_dialog.h"
#include "imap_main.h"
#include "imap_rectangle.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -131,7 +131,7 @@ make_guides_dialog (void)
{
GuidesDialog_t *data = g_new(GuidesDialog_t, 1);
DefaultDialog_t *dialog;
- GtkWidget *table;
+ GtkWidget *grid;
GtkWidget *label;
GtkWidget *hbox;
@@ -158,48 +158,48 @@ make_guides_dialog (void)
data->guide_bounds, FALSE, FALSE, 0);
gtk_widget_show (data->guide_bounds);
- table = default_dialog_add_table (dialog, 4, 4);
+ grid = default_dialog_add_grid (dialog);
- label = create_label_in_table (table, 0, 0, _("_Width:"));
- data->width = create_spin_button_in_table (table, label, 0, 1, 32, 1, 100);
+ label = create_label_in_grid (grid, 0, 0, _("_Width:"));
+ data->width = create_spin_button_in_grid (grid, label, 0, 1, 32, 1, 100);
g_signal_connect (data->width, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
- label = create_label_in_table(table, 0, 2, _("_Left start at:"));
- data->left = create_spin_button_in_table (table, label, 0, 3, 0, 0, 100);
+ label = create_label_in_grid (grid, 0, 2, _("_Left start at:"));
+ data->left = create_spin_button_in_grid (grid, label, 0, 3, 0, 0, 100);
g_signal_connect (data->left, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
- label = create_label_in_table(table, 1, 0, _("_Height:"));
- data->height = create_spin_button_in_table (table, label, 1, 1, 32, 1, 100);
+ label = create_label_in_grid (grid, 1, 0, _("_Height:"));
+ data->height = create_spin_button_in_grid (grid, label, 1, 1, 32, 1, 100);
g_signal_connect (data->height, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
- label = create_label_in_table (table, 1, 2, _("_Top start at:"));
- data->top = create_spin_button_in_table (table, label, 1, 3, 0, 0, 100);
+ label = create_label_in_grid (grid, 1, 2, _("_Top start at:"));
+ data->top = create_spin_button_in_grid (grid, label, 1, 3, 0, 0, 100);
g_signal_connect (data->top, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
- label = create_label_in_table (table, 2, 0, _("_Horz. spacing:"));
- data->horz_spacing = create_spin_button_in_table (table, label, 2, 1, 0, 0,
+ label = create_label_in_grid (grid, 2, 0, _("_Horz. spacing:"));
+ data->horz_spacing = create_spin_button_in_grid (grid, label, 2, 1, 0, 0,
100);
g_signal_connect (data->horz_spacing, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
- label = create_label_in_table(table, 2, 2, _("_No. across:"));
- data->no_across = create_spin_button_in_table(table, label, 2, 3, 0, 0,
+ label = create_label_in_grid (grid, 2, 2, _("_No. across:"));
+ data->no_across = create_spin_button_in_grid (grid, label, 2, 3, 0, 0,
100);
g_signal_connect (data->no_across, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
- label = create_label_in_table(table, 3, 0, _("_Vert. spacing:"));
- data->vert_spacing = create_spin_button_in_table(table, label, 3, 1, 0, 0,
+ label = create_label_in_grid (grid, 3, 0, _("_Vert. spacing:"));
+ data->vert_spacing = create_spin_button_in_grid (grid, label, 3, 1, 0, 0,
100);
g_signal_connect (data->vert_spacing, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
- label = create_label_in_table(table, 3, 2, _("No. _down:"));
- data->no_down = create_spin_button_in_table (table, label, 3, 3, 0, 0, 100);
+ label = create_label_in_grid (grid, 3, 2, _("No. _down:"));
+ data->no_down = create_spin_button_in_grid (grid, label, 3, 3, 0, 0, 100);
g_signal_connect (data->no_down, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
diff --git a/plug-ins/imagemap/imap_default_dialog.c b/plug-ins/imagemap/imap_default_dialog.c
index 64d2028..50f86b2 100644
--- a/plug-ins/imagemap/imap_default_dialog.c
+++ b/plug-ins/imagemap/imap_default_dialog.c
@@ -170,15 +170,15 @@ default_dialog_set_label(DefaultDialog_t *dialog, const gchar *text)
}
GtkWidget*
-default_dialog_add_table(DefaultDialog_t *dialog, gint rows, gint cols)
+default_dialog_add_grid (DefaultDialog_t *dialog)
{
- GtkWidget *table = gtk_table_new (rows, cols, FALSE);
+ GtkWidget *grid = gtk_grid_new ();
- gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_table_set_col_spacings (GTK_TABLE (table), 6);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), table, TRUE, TRUE, 0);
- gtk_widget_show (table);
+ gtk_box_pack_start (GTK_BOX (dialog->vbox), grid, TRUE, TRUE, 0);
+ gtk_widget_show (grid);
- return table;
+ return grid;
}
diff --git a/plug-ins/imagemap/imap_default_dialog.h b/plug-ins/imagemap/imap_default_dialog.h
index bb646bf..79991c4 100644
--- a/plug-ins/imagemap/imap_default_dialog.h
+++ b/plug-ins/imagemap/imap_default_dialog.h
@@ -53,7 +53,6 @@ void default_dialog_hide_apply_button(DefaultDialog_t *dialog);
void default_dialog_hide_help_button(DefaultDialog_t *dialog);
void default_dialog_set_title(DefaultDialog_t *dialog, const gchar *title);
void default_dialog_set_label(DefaultDialog_t *dialog, const gchar *text);
-GtkWidget *default_dialog_add_table(DefaultDialog_t *dialog, gint rows,
- gint cols);
+GtkWidget *default_dialog_add_grid (DefaultDialog_t *dialog);
#endif /* _IMAP_DEFAULT_DIALOG_H */
diff --git a/plug-ins/imagemap/imap_edit_area_info.c b/plug-ins/imagemap/imap_edit_area_info.c
index 19f7d35..248510e 100644
--- a/plug-ins/imagemap/imap_edit_area_info.c
+++ b/plug-ins/imagemap/imap_edit_area_info.c
@@ -34,7 +34,7 @@
#include "imap_edit_area_info.h"
#include "imap_main.h"
#include "imap_stock.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -192,96 +192,96 @@ static void
create_link_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
{
BrowseWidget_t *browse;
- GtkWidget *table, *label;
- GtkWidget *subtable, *frame;
+ GtkWidget *grid, *label;
+ GtkWidget *subgrid, *frame;
GSList *group;
- table = gtk_table_new(11, 1, FALSE);
- gtk_container_set_border_width(GTK_CONTAINER(table), 12);
- gtk_table_set_row_spacings(GTK_TABLE(table), 6);
- gtk_widget_show(table);
+ grid = gtk_grid_new ();
+ gtk_container_set_border_width (GTK_CONTAINER (grid), 12);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_widget_show (grid);
- frame = gimp_frame_new(_("Link Type"));
- gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 2, 0, 1);
- gtk_widget_show(frame);
+ frame = gimp_frame_new (_("Link Type"));
+ gtk_grid_attach (GTK_GRID (grid), frame, 0, 0, 2, 1);
+ gtk_widget_show (frame);
- subtable = gtk_table_new(2, 4, FALSE);
- gtk_container_add (GTK_CONTAINER(frame), subtable);
- gtk_widget_show(subtable);
+ subgrid = gtk_grid_new ();
+ gtk_container_add (GTK_CONTAINER (frame), subgrid);
+ gtk_widget_show (subgrid);
- dialog->web_site = create_radio_button_in_table(subtable, NULL, 0, 0,
+ dialog->web_site = create_radio_button_in_grid (subgrid, NULL, 0, 0,
_("_Web Site"));
g_signal_connect(dialog->web_site, "toggled",
G_CALLBACK (select_web_cb), (gpointer) dialog);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->web_site));
- dialog->ftp_site = create_radio_button_in_table(subtable, group, 0, 1,
+ dialog->ftp_site = create_radio_button_in_grid (subgrid, group, 0, 1,
_("_Ftp Site"));
g_signal_connect(dialog->ftp_site, "toggled",
G_CALLBACK (select_ftp_cb), (gpointer) dialog);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->ftp_site));
- dialog->gopher = create_radio_button_in_table(subtable, group, 0, 2,
+ dialog->gopher = create_radio_button_in_grid (subgrid, group, 0, 2,
_("_Gopher"));
g_signal_connect(dialog->gopher, "toggled",
G_CALLBACK (select_gopher_cb), (gpointer) dialog);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->gopher));
- dialog->other = create_radio_button_in_table(subtable, group, 0, 3,
+ dialog->other = create_radio_button_in_grid (subgrid, group, 0, 3,
_("Ot_her"));
g_signal_connect(dialog->other, "toggled",
G_CALLBACK (select_other_cb), (gpointer) dialog);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->other));
- dialog->file = create_radio_button_in_table(subtable, group, 1, 0,
+ dialog->file = create_radio_button_in_grid (subgrid, group, 1, 0,
_("F_ile"));
g_signal_connect(dialog->file, "toggled",
G_CALLBACK (select_file_cb), (gpointer) dialog);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->file));
- dialog->wais = create_radio_button_in_table(subtable, group, 1, 1,
+ dialog->wais = create_radio_button_in_grid (subgrid, group, 1, 1,
_("WAI_S"));
g_signal_connect(dialog->wais, "toggled",
G_CALLBACK (select_wais_cb), (gpointer) dialog);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->wais));
- dialog->telnet = create_radio_button_in_table(subtable, group, 1, 2,
+ dialog->telnet = create_radio_button_in_grid (subgrid, group, 1, 2,
_("Tel_net"));
g_signal_connect(dialog->telnet, "toggled",
G_CALLBACK (select_telnet_cb), (gpointer) dialog);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->telnet));
- dialog->email = create_radio_button_in_table(subtable, group, 1, 3,
+ dialog->email = create_radio_button_in_grid (subgrid, group, 1, 3,
_("e-_mail"));
g_signal_connect(dialog->email, "toggled",
G_CALLBACK (select_email_cb), (gpointer) dialog);
- label = create_label_in_table(
- table, 2, 0,
+ label = create_label_in_grid (
+ grid, 2, 0,
_("_URL to activate when this area is clicked: (required)"));
browse = browse_widget_new( _("Select HTML file"));
browse_widget_set_filter(browse, relative_filter, (gpointer) dialog);
- gtk_table_attach_defaults(GTK_TABLE(table), browse->hbox, 0, 1, 3, 4);
+ gtk_grid_attach (GTK_GRID (grid), browse->hbox, 0, 3, 1, 1);
dialog->url = browse->file;
g_signal_connect(dialog->url, "changed", G_CALLBACK(url_changed),
dialog);
gtk_label_set_mnemonic_widget(GTK_LABEL(label), dialog->url);
- dialog->relative_link = create_check_button_in_table(table, 4, 0,
+ dialog->relative_link = create_check_button_in_grid (grid, 4, 0,
_("Relati_ve link"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->relative_link),
TRUE);
- label = create_label_in_table(
- table, 6, 0,
+ label = create_label_in_grid (
+ grid, 6, 0,
_("_Target frame name/ID: (optional - used for FRAMES only)"));
- dialog->target = create_entry_in_table(table, label, 7, 0);
+ dialog->target = create_entry_in_grid (grid, label, 7, 0);
- label = create_label_in_table(table, 9, 0, _("ALT te_xt: (optional)"));
- dialog->comment = create_entry_in_table(table, label, 10, 0);
+ label = create_label_in_grid (grid, 9, 0, _("ALT te_xt: (optional)"));
+ dialog->comment = create_entry_in_grid (grid, label, 10, 0);
- append_page (notebook, table, GIMP_ICON_WEB, _("_Link"));
+ append_page (notebook, grid, GIMP_ICON_WEB, _("_Link"));
}
static void
@@ -334,28 +334,28 @@ create_info_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
static void
create_java_script_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
{
- GtkWidget *vbox, *table, *label;
+ GtkWidget *vbox, *grid, *label;
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
gtk_widget_show(vbox);
- table = gtk_table_new(11, 1, FALSE);
- gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
- gtk_container_set_border_width(GTK_CONTAINER(table), 12);
- gtk_table_set_row_spacings(GTK_TABLE(table), 6);
- gtk_widget_show(table);
+ grid = gtk_grid_new ();
+ gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (grid), 12);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_widget_show (grid);
- label = create_label_in_table(table, 0, 0, "o_nMouseover:");
- dialog->mouse_over = create_entry_in_table(table, label, 1, 0);
+ label = create_label_in_grid (grid, 0, 0, "o_nMouseover:");
+ dialog->mouse_over = create_entry_in_grid (grid, label, 1, 0);
- label = create_label_in_table(table, 3, 0, "on_Mouseout:");
- dialog->mouse_out = create_entry_in_table(table, label, 4, 0);
+ label = create_label_in_grid (grid, 3, 0, "on_Mouseout:");
+ dialog->mouse_out = create_entry_in_grid (grid, label, 4, 0);
- label = create_label_in_table(table, 6, 0, "on_Focus (HTML 4.0):");
- dialog->focus = create_entry_in_table(table, label, 7, 0);
+ label = create_label_in_grid (grid, 6, 0, "on_Focus (HTML 4.0):");
+ dialog->focus = create_entry_in_grid (grid, label, 7, 0);
- label = create_label_in_table(table, 9, 0, "on_Blur (HTML 4.0):");
- dialog->blur = create_entry_in_table(table, label, 10, 0);
+ label = create_label_in_grid (grid, 9, 0, "on_Blur (HTML 4.0):");
+ dialog->blur = create_entry_in_grid (grid, label, 10, 0);
append_page (notebook, vbox, IMAP_STOCK_JAVA, _("_JavaScript"));
}
diff --git a/plug-ins/imagemap/imap_grid.c b/plug-ins/imagemap/imap_grid.c
index 3a57139..bf14d99 100644
--- a/plug-ins/imagemap/imap_grid.c
+++ b/plug-ins/imagemap/imap_grid.c
@@ -33,7 +33,7 @@
#include "imap_main.h"
#include "imap_menu.h"
#include "imap_preview.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -187,7 +187,7 @@ create_grid_settings_dialog(void)
{
GridDialog_t *data = g_new(GridDialog_t, 1);
DefaultDialog_t *dialog;
- GtkWidget *main_table, *table, *label;
+ GtkWidget *main_grid, *grid, *label;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *button;
@@ -195,17 +195,17 @@ create_grid_settings_dialog(void)
data->dialog = dialog = make_default_dialog(_("Grid Settings"));
default_dialog_set_ok_cb(dialog, grid_settings_ok_cb, (gpointer) data);
- main_table = default_dialog_add_table(dialog, 4, 2);
+ main_grid = default_dialog_add_grid (dialog);
data->snap = gtk_check_button_new_with_mnemonic(_("_Snap-to grid enabled"));
g_signal_connect(data->snap, "toggled",
G_CALLBACK (snap_toggled_cb), data);
- gtk_table_attach_defaults(GTK_TABLE(main_table), data->snap, 0, 1, 0, 1);
+ gtk_grid_attach (GTK_GRID (main_grid), data->snap, 0, 0, 1, 1);
gtk_widget_show(data->snap);
data->type_frame = frame = gimp_frame_new(_("Grid Visibility and Type"));
gtk_widget_show(frame);
- gtk_table_attach_defaults(GTK_TABLE(main_table), frame, 0, 2, 1, 2);
+ gtk_grid_attach (GTK_GRID (main_grid), frame, 0, 1, 2, 1);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox);
@@ -236,55 +236,55 @@ create_grid_settings_dialog(void)
gtk_widget_show(button);
data->granularity_frame = frame = gimp_frame_new(_("Grid Granularity"));
- gtk_table_attach_defaults(GTK_TABLE(main_table), frame, 0, 1, 2, 3);
- table = gtk_table_new(2, 4, FALSE);
- gtk_table_set_row_spacings(GTK_TABLE(table), 6);
- gtk_table_set_col_spacings(GTK_TABLE(table), 6);
- gtk_container_add(GTK_CONTAINER(frame), table);
-
- label = create_label_in_table(table, 0, 0, _("_Width"));
- data->width = create_spin_button_in_table(table, label, 0, 1, 15, 1, 100);
+ gtk_grid_attach (GTK_GRID (main_grid), frame, 0, 2, 1, 1);
+ grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+ gtk_container_add(GTK_CONTAINER(frame), grid);
+
+ label = create_label_in_grid (grid, 0, 0, _("_Width"));
+ data->width = create_spin_button_in_grid (grid, label, 0, 1, 15, 1, 100);
g_signal_connect(data->width, "value-changed",
G_CALLBACK (width_changed_cb), (gpointer) data);
- create_label_in_table(table, 0, 3, _("pixels"));
+ create_label_in_grid (grid, 0, 3, _("pixels"));
- label = create_label_in_table(table, 1, 0, _("_Height"));
- data->height = create_spin_button_in_table(table, label, 1, 1, 15, 1, 100);
+ label = create_label_in_grid (grid, 1, 0, _("_Height"));
+ data->height = create_spin_button_in_grid (grid, label, 1, 1, 15, 1, 100);
g_signal_connect(data->height, "value-changed",
G_CALLBACK (height_changed_cb), (gpointer) data);
- create_label_in_table(table, 1, 3, _("pixels"));
+ create_label_in_grid (grid, 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_grid_attach (GTK_GRID (grid), chain_button, 2, 0, 1, 2);
gtk_widget_show(chain_button);
- gtk_widget_show(table);
+ gtk_widget_show(grid);
gtk_widget_show(frame);
data->offset_frame = frame = gimp_frame_new(_("Grid Offset"));
- gtk_table_attach_defaults(GTK_TABLE(main_table), frame, 1, 2, 2, 3);
- table = gtk_table_new(2, 3, FALSE);
- gtk_table_set_row_spacings(GTK_TABLE(table), 6);
- gtk_table_set_col_spacings(GTK_TABLE(table), 6);
- 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, label, 0, 0, 0, 0, 100);
+ gtk_grid_attach (GTK_GRID (main_grid), frame, 1, 2, 1, 1);
+ grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+ gtk_container_add(GTK_CONTAINER(frame), grid);
+
+ label = create_label_in_grid (grid, 0, 2, _("pixels from l_eft"));
+ data->left = create_spin_button_in_grid (grid, label, 0, 0, 0, 0, 100);
g_signal_connect(data->left, "value-changed",
G_CALLBACK (left_changed_cb), (gpointer) data);
- label = create_label_in_table(table, 1, 2, _("pixels from _top"));
- data->top = create_spin_button_in_table(table, label, 1, 0, 0, 0, 100);
+ label = create_label_in_grid (grid, 1, 2, _("pixels from _top"));
+ data->top = create_spin_button_in_grid (grid, label, 1, 0, 0, 0, 100);
g_signal_connect(data->top, "value-changed",
G_CALLBACK (top_changed_cb), (gpointer) data);
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_grid_attach (GTK_GRID (grid), chain_button, 1, 0, 1, 2);
gtk_widget_show(chain_button);
- data->preview = create_check_button_in_table(main_table, 3, 0,
+ data->preview = create_check_button_in_grid (main_grid, 3, 0,
_("_Preview"));
g_signal_connect(data->preview, "toggled",
G_CALLBACK (toggle_preview_cb), (gpointer) data);
@@ -292,7 +292,7 @@ create_grid_settings_dialog(void)
snap_toggled_cb(data->snap, data);
- gtk_widget_show(table);
+ gtk_widget_show(grid);
gtk_widget_show(frame);
return data;
diff --git a/plug-ins/imagemap/imap_polygon.c b/plug-ins/imagemap/imap_polygon.c
index b30e47b..4e7bd6e 100644
--- a/plug-ins/imagemap/imap_polygon.c
+++ b/plug-ins/imagemap/imap_polygon.c
@@ -35,7 +35,7 @@
#include "imap_object_popup.h"
#include "imap_polygon.h"
#include "imap_stock.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -441,7 +441,7 @@ static gpointer
polygon_create_info_widget(GtkWidget *frame)
{
PolygonProperties_t *props = g_new(PolygonProperties_t, 1);
- GtkWidget *hbox, *swin, *table, *label;
+ GtkWidget *hbox, *swin, *grid, *label;
GtkWidget *view;
gint max_width = get_image_width();
gint max_height = get_image_height();
@@ -487,50 +487,50 @@ polygon_create_info_widget(GtkWidget *frame)
gtk_container_add (GTK_CONTAINER (swin), view);
- table = gtk_table_new(6, 3, FALSE);
- gtk_table_set_row_spacings(GTK_TABLE(table), 6);
- gtk_table_set_col_spacings(GTK_TABLE(table), 6);
- gtk_box_pack_start(GTK_BOX(hbox), table, FALSE, FALSE, FALSE);
- gtk_widget_show(table);
+ grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+ gtk_box_pack_start (GTK_BOX(hbox), grid, FALSE, FALSE, FALSE);
+ gtk_widget_show (grid);
- label = create_label_in_table(table, 0, 0, "_x:");
- props->x = create_spin_button_in_table(table, label, 0, 1, 1, 0,
+ label = create_label_in_grid (grid, 0, 0, "_x:");
+ props->x = create_spin_button_in_grid (grid, label, 0, 1, 1, 0,
max_width - 1);
g_signal_connect(props->x, "changed",
G_CALLBACK(x_changed_cb), (gpointer) props);
gtk_widget_set_size_request(props->x, 64, -1);
- create_label_in_table(table, 0, 2, _("pixels"));
+ create_label_in_grid (grid, 0, 2, _("pixels"));
- label = create_label_in_table(table, 1, 0, "_y:");
- props->y = create_spin_button_in_table(table, label, 1, 1, 1, 0,
+ label = create_label_in_grid (grid, 1, 0, "_y:");
+ props->y = create_spin_button_in_grid (grid, label, 1, 1, 1, 0,
max_height - 1);
g_signal_connect(props->y, "changed",
G_CALLBACK(y_changed_cb), (gpointer) props);
gtk_widget_set_size_request(props->y, 64, -1);
- create_label_in_table(table, 1, 2, _("pixels"));
+ create_label_in_grid (grid, 1, 2, _("pixels"));
props->update = gtk_button_new_with_mnemonic(_("_Update"));
g_signal_connect(props->update, "clicked",
G_CALLBACK(update_button_clicked), props);
- gtk_table_attach_defaults(GTK_TABLE(table), props->update, 1, 2, 2, 3);
+ gtk_grid_attach (GTK_GRID (grid), props->update, 1, 2, 1, 1);
gtk_widget_show(props->update);
props->insert = gtk_button_new_with_mnemonic(_("_Insert"));
g_signal_connect(props->insert, "clicked",
G_CALLBACK(insert_button_clicked), props);
- gtk_table_attach_defaults(GTK_TABLE(table), props->insert, 1, 2, 3, 4);
+ gtk_grid_attach (GTK_GRID (grid), props->insert, 1, 3, 1, 1);
gtk_widget_show(props->insert);
props->append = gtk_button_new_with_mnemonic(_("A_ppend"));
g_signal_connect(props->append, "clicked",
G_CALLBACK(append_button_clicked), props);
- gtk_table_attach_defaults(GTK_TABLE(table), props->append, 1, 2, 4, 5);
+ gtk_grid_attach (GTK_GRID (grid), props->append, 1, 4, 1, 1);
gtk_widget_show(props->append);
props->remove = gtk_button_new_with_mnemonic(_("_Remove"));
g_signal_connect(props->remove, "clicked",
G_CALLBACK(remove_button_clicked), props);
- gtk_table_attach_defaults(GTK_TABLE(table), props->remove, 1, 2, 5, 6);
+ gtk_grid_attach (GTK_GRID (grid), props->remove, 1, 5, 1, 1);
gtk_widget_show(props->remove);
props->timeout = 0;
diff --git a/plug-ins/imagemap/imap_preferences.c b/plug-ins/imagemap/imap_preferences.c
index 3cdaea5..5c64182 100644
--- a/plug-ins/imagemap/imap_preferences.c
+++ b/plug-ins/imagemap/imap_preferences.c
@@ -37,7 +37,7 @@
#include "imap_misc.h"
#include "imap_mru.h"
#include "imap_preferences.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -333,37 +333,37 @@ set_button_colors(PreferencesDialog_t *dialog, ColorSelData_t *colors)
}
static GtkWidget*
-create_tab(GtkWidget *notebook, const gchar *label, gint rows, gint cols)
+create_tab (GtkWidget *notebook, const gchar *label)
{
- GtkWidget *table;
+ GtkWidget *grid;
GtkWidget *vbox;
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
- gtk_widget_show(vbox);
+ gtk_widget_show (vbox);
- table = gtk_table_new(rows, cols, FALSE);
- gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
- gtk_container_set_border_width(GTK_CONTAINER(table), 12);
- gtk_table_set_row_spacings(GTK_TABLE(table), 6);
- gtk_table_set_col_spacings(GTK_TABLE(table), 6);
- gtk_widget_show(table);
+ grid = gtk_grid_new ();
+ gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER(grid), 12);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+ gtk_widget_show (grid);
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox,
- gtk_label_new_with_mnemonic(label));
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox,
+ gtk_label_new_with_mnemonic (label));
- return table;
+ return grid;
}
static void
create_general_tab(PreferencesDialog_t *data, GtkWidget *notebook)
{
- GtkWidget *table = create_tab(notebook, _("General"), 7, 2);
+ GtkWidget *grid = create_tab (notebook, _("General"));
GtkWidget *frame;
GtkWidget *hbox;
frame = gimp_frame_new( _("Default Map Type"));
gtk_widget_show(frame);
- gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 2, 0, 1);
+ gtk_grid_attach (GTK_GRID (grid), frame, 0, 0, 2, 1);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox);
@@ -380,17 +380,17 @@ create_general_tab(PreferencesDialog_t *data, GtkWidget *notebook)
gtk_widget_show(data->csim);
data->prompt_for_area_info =
- create_check_button_in_table(table, 1, 0, _("_Prompt for area info"));
+ create_check_button_in_grid (grid, 1, 0, _("_Prompt for area info"));
data->require_default_url =
- create_check_button_in_table(table, 2, 0, _("_Require default URL"));
+ create_check_button_in_grid (grid, 2, 0, _("_Require default URL"));
data->show_area_handle =
- create_check_button_in_table(table, 3, 0, _("Show area _handles"));
+ create_check_button_in_grid (grid, 3, 0, _("Show area _handles"));
data->keep_circles_round =
- create_check_button_in_table(table, 4, 0, _("_Keep NCSA circles true"));
+ create_check_button_in_grid (grid, 4, 0, _("_Keep NCSA circles true"));
data->show_url_tip =
- create_check_button_in_table(table, 5, 0, _("Show area URL _tip"));
+ create_check_button_in_grid (grid, 5, 0, _("Show area URL _tip"));
data->use_doublesized =
- create_check_button_in_table(table, 6, 0,
+ create_check_button_in_grid (grid, 6, 0,
_("_Use double-sized grab handles"));
gtk_widget_show(frame);
}
@@ -398,29 +398,28 @@ create_general_tab(PreferencesDialog_t *data, GtkWidget *notebook)
static void
create_menu_tab(PreferencesDialog_t *data, GtkWidget *notebook)
{
- GtkWidget *table = create_tab(notebook, _("Menu"), 2, 2);
+ GtkWidget *grid = create_tab (notebook, _("Menu"));
GtkWidget *label;
- label = create_label_in_table(table, 0, 0,
+ label = create_label_in_grid (grid, 0, 0,
_("Number of _undo levels (1 - 99):"));
- data->undo_levels = create_spin_button_in_table(table, label, 0, 1, 1, 1,
+ data->undo_levels = create_spin_button_in_grid (grid, label, 0, 1, 1, 1,
99);
- label = create_label_in_table(table, 1, 0,
+ label = create_label_in_grid (grid, 1, 0,
_("Number of M_RU entries (1 - 16):"));
- data->mru_size = create_spin_button_in_table(table, label, 1, 1, 1, 1, 16);
+ data->mru_size = create_spin_button_in_grid (grid, label, 1, 1, 1, 1, 16);
}
static GtkWidget*
-create_color_field(PreferencesDialog_t *data, GtkWidget *table, gint row,
- gint col)
+create_color_field (PreferencesDialog_t *data, GtkWidget *grid, gint row,
+ gint col)
{
GimpRGB color = {0.0, 0.0, 0.0, 1.0};
GtkWidget *area = gimp_color_button_new (_("Select Color"), 16, 8, &color,
GIMP_COLOR_AREA_FLAT);
gimp_color_button_set_update (GIMP_COLOR_BUTTON (area), TRUE);
- gtk_table_attach_defaults (GTK_TABLE (table), area, col, col + 1, row,
- row + 1);
+ gtk_grid_attach (GTK_GRID (grid), area, col, row, 1, 1);
gtk_widget_show (area);
return area;
@@ -429,32 +428,32 @@ create_color_field(PreferencesDialog_t *data, GtkWidget *table, gint row,
static void
create_colors_tab(PreferencesDialog_t *data, GtkWidget *notebook)
{
- GtkWidget *table = create_tab(notebook, _("Colors"), 3, 3);
+ GtkWidget *grid = create_tab (notebook, _("Colors"));
- create_label_in_table(table, 0, 0, _("Normal:"));
- data->normal_fg = create_color_field(data, table, 0, 1);
- data->normal_bg = create_color_field(data, table, 0, 2);
+ create_label_in_grid (grid, 0, 0, _("Normal:"));
+ data->normal_fg = create_color_field(data, grid, 0, 1);
+ data->normal_bg = create_color_field(data, grid, 0, 2);
- create_label_in_table(table, 1, 0, _("Selected:"));
- data->selected_fg = create_color_field(data, table, 1, 1);
- data->selected_bg = create_color_field(data, table, 1, 2);
+ create_label_in_grid (grid, 1, 0, _("Selected:"));
+ data->selected_fg = create_color_field(data, grid, 1, 1);
+ data->selected_bg = create_color_field(data, grid, 1, 2);
- create_label_in_table(table, 2, 0, _("Interaction:"));
- data->interactive_fg = create_color_field(data, table, 2, 1);
- data->interactive_bg = create_color_field(data, table, 2, 2);
+ create_label_in_grid (grid, 2, 0, _("Interaction:"));
+ data->interactive_fg = create_color_field(data, grid, 2, 1);
+ data->interactive_bg = create_color_field(data, grid, 2, 2);
}
#ifdef _NOT_READY_YET_
static void
create_contiguous_regions_tab(PreferencesDialog_t *data, GtkWidget *notebook)
{
- GtkWidget *table = create_tab(notebook, _("Co_ntiguous Region"), 2, 2);
+ GtkWidget *grid = create_tab (notebook, _("Co_ntiguous Region"));
GtkWidget *label;
- label = create_label_in_table(table, 0, 0,
+ label = create_label_in_grid (grid, 0, 0,
_("_Threshold:"));
data->auto_convert =
- create_check_button_in_table(table, 1, 0, _("_Automatically convert"));
+ create_check_button_in_grid (grid, 1, 0, _("_Automatically convert"));
}
#endif
diff --git a/plug-ins/imagemap/imap_preview.c b/plug-ins/imagemap/imap_preview.c
index 6fad781..5dd1652 100644
--- a/plug-ins/imagemap/imap_preview.c
+++ b/plug-ins/imagemap/imap_preview.c
@@ -442,7 +442,7 @@ make_preview (GimpDrawable *drawable)
GtkWidget *viewport;
GtkWidget *button, *arrow;
GtkWidget *ruler;
- GtkWidget *table;
+ GtkWidget *grid;
GtkWidget *scrollbar;
gint width, height;
@@ -474,16 +474,16 @@ make_preview (GimpDrawable *drawable)
gtk_widget_set_size_request (preview, data->widget_width,
data->widget_height);
- /* The main table */
- data->window = table = gtk_table_new (3, 3, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (table), 1);
- gtk_table_set_row_spacings (GTK_TABLE (table), 1);
+ /* The main grid */
+ data->window = grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 1);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 1);
/* Create button with arrow */
button = gtk_button_new ();
gtk_widget_set_can_focus (button, FALSE);
- gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1,
- GTK_FILL, GTK_FILL, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1);
+ // GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_set_events (button,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
gtk_widget_show (button);
@@ -502,8 +502,8 @@ make_preview (GimpDrawable *drawable)
G_CALLBACK (GTK_WIDGET_GET_CLASS (ruler)->motion_notify_event),
ruler);
- gtk_table_attach (GTK_TABLE (table), ruler, 1, 2, 0, 1,
- GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
+ gtk_widget_set_hexpand (ruler, TRUE);
+ gtk_grid_attach (GTK_GRID (grid), ruler, 1, 0, 1, 1);
gtk_widget_show (ruler);
/* Create vertical ruler */
@@ -511,8 +511,8 @@ make_preview (GimpDrawable *drawable)
g_signal_connect_swapped (preview, "motion-notify-event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (ruler)->motion_notify_event),
ruler);
- gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 2,
- GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
+ gtk_widget_set_vexpand (ruler, TRUE);
+ gtk_grid_attach (GTK_GRID (grid), ruler, 0, 1, 1, 1);
gtk_widget_show (ruler);
window = gtk_scrolled_window_new (NULL, NULL);
@@ -521,8 +521,7 @@ make_preview (GimpDrawable *drawable)
width = (data->width > 600) ? 600 : data->width;
height = (data->height > 400) ? 400 : data->height;
gtk_widget_set_size_request (window, width, height);
- gtk_table_attach (GTK_TABLE (table), window, 1, 2, 1, 2,
- GTK_FILL, GTK_FILL, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), window, 1, 1, 1, 1);
gtk_widget_show (window);
viewport = gtk_viewport_new (NULL, NULL);
@@ -550,13 +549,13 @@ make_preview (GimpDrawable *drawable)
gtk_container_add (GTK_CONTAINER (viewport), preview);
scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, hadj);
- gtk_table_attach(GTK_TABLE(table), scrollbar, 1, 2, 2, 3,
- GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), scrollbar, 1, 2, 1, 1);
+ // GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK, 0, 0);
gtk_widget_show (scrollbar);
scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, vadj);
- gtk_table_attach (GTK_TABLE (table), scrollbar, 2, 3, 1, 2,
- GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), scrollbar, 2, 1, 1, 1);
+ // GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK, 0, 0);
gtk_widget_show (scrollbar);
gtk_widget_show (preview);
@@ -565,7 +564,7 @@ make_preview (GimpDrawable *drawable)
data->height, FALSE, FALSE);
render_preview (data, &data->src_rgn);
- gtk_widget_show (table);
+ gtk_widget_show (grid);
return data;
}
diff --git a/plug-ins/imagemap/imap_rectangle.c b/plug-ins/imagemap/imap_rectangle.c
index 35e7975..dc5fa4e 100644
--- a/plug-ins/imagemap/imap_rectangle.c
+++ b/plug-ins/imagemap/imap_rectangle.c
@@ -34,7 +34,7 @@
#include "imap_object_popup.h"
#include "imap_rectangle.h"
#include "imap_stock.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -371,48 +371,47 @@ static gpointer
rectangle_create_info_widget(GtkWidget *frame)
{
RectangleProperties_t *props = g_new(RectangleProperties_t, 1);
- GtkWidget *table, *label, *chain_button;
+ GtkWidget *grid, *label, *chain_button;
gint max_width = get_image_width();
gint max_height = get_image_height();
- table = gtk_table_new(4, 4, FALSE);
- gtk_container_add(GTK_CONTAINER(frame), table);
+ grid = gtk_grid_new ();
+ gtk_container_add (GTK_CONTAINER (frame), grid);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+ gtk_widget_show(grid);
- gtk_table_set_row_spacings(GTK_TABLE(table), 6);
- gtk_table_set_col_spacings(GTK_TABLE(table), 6);
- gtk_widget_show(table);
-
- label = create_label_in_table(table, 0, 0, _("Upper left _x:"));
- props->x = create_spin_button_in_table(table, label, 0, 1, 1, 0,
+ label = create_label_in_grid (grid, 0, 0, _("Upper left _x:"));
+ props->x = create_spin_button_in_grid (grid, label, 0, 1, 1, 0,
max_width - 1);
g_signal_connect(props->x, "value-changed",
G_CALLBACK(x_changed_cb), (gpointer) props);
- create_label_in_table(table, 0, 3, _("pixels"));
+ create_label_in_grid (grid, 0, 3, _("pixels"));
- label = create_label_in_table(table, 1, 0, _("Upper left _y:"));
- props->y = create_spin_button_in_table(table, label, 1, 1, 1, 0,
+ label = create_label_in_grid (grid, 1, 0, _("Upper left _y:"));
+ props->y = create_spin_button_in_grid (grid, label, 1, 1, 1, 0,
max_height - 1);
g_signal_connect(props->y, "value-changed",
G_CALLBACK(y_changed_cb), (gpointer) props);
- create_label_in_table(table, 1, 3, _("pixels"));
+ create_label_in_grid (grid, 1, 3, _("pixels"));
- label = create_label_in_table(table, 2, 0, _("_Width:"));
- props->width = create_spin_button_in_table(table, label, 2, 1, 1, 1,
+ label = create_label_in_grid (grid, 2, 0, _("_Width:"));
+ props->width = create_spin_button_in_grid (grid, label, 2, 1, 1, 1,
max_width);
g_signal_connect(props->width, "value-changed",
G_CALLBACK(width_changed_cb), (gpointer) props);
- create_label_in_table(table, 2, 3, _("pixels"));
+ create_label_in_grid (grid, 2, 3, _("pixels"));
- label = create_label_in_table(table, 3, 0, _("_Height:"));
- props->height = create_spin_button_in_table(table, label, 3, 1, 1, 1,
+ label = create_label_in_grid (grid, 3, 0, _("_Height:"));
+ props->height = create_spin_button_in_grid (grid, label, 3, 1, 1, 1,
max_height);
g_signal_connect(props->height, "value-changed",
G_CALLBACK(height_changed_cb), (gpointer) props);
- create_label_in_table(table, 3, 3, _("pixels"));
+ create_label_in_grid (grid, 3, 3, _("pixels"));
chain_button = gimp_chain_button_new(GIMP_CHAIN_RIGHT);
props->chain_button = chain_button;
- gtk_table_attach_defaults(GTK_TABLE(table), chain_button, 2, 3, 2, 4);
+ gtk_grid_attach (GTK_GRID (grid), chain_button, 2, 2, 1, 2);
gtk_widget_show(chain_button);
return props;
diff --git a/plug-ins/imagemap/imap_settings.c b/plug-ins/imagemap/imap_settings.c
index 4a9f83f..4515ef7 100644
--- a/plug-ins/imagemap/imap_settings.c
+++ b/plug-ins/imagemap/imap_settings.c
@@ -29,7 +29,7 @@
#include "imap_main.h"
#include "imap_settings.h"
#include "imap_string.h"
-#include "imap_table.h"
+#include "imap_ui_grid.h"
#include "libgimp/stdplugins-intl.h"
@@ -82,28 +82,27 @@ static SettingsDialog_t*
create_settings_dialog(void)
{
SettingsDialog_t *data = g_new(SettingsDialog_t, 1);
- GtkWidget *table, *view, *frame, *hbox, *label, *swin;
+ GtkWidget *grid, *view, *frame, *hbox, *label, *swin;
DefaultDialog_t *dialog;
dialog = data->dialog = make_default_dialog(_("Settings for this Mapfile"));
default_dialog_set_ok_cb(dialog, settings_ok_cb, (gpointer) data);
- table = default_dialog_add_table(dialog, 9, 2);
+ grid = default_dialog_add_grid (dialog);
- create_label_in_table(table, 0, 0, _("Filename:"));
- data->filename = create_label_in_table(table, 0, 1, "");
+ create_label_in_grid (grid, 0, 0, _("Filename:"));
+ data->filename = create_label_in_grid (grid, 0, 1, "");
- create_label_in_table(table, 1, 0, _("Image name:"));
+ create_label_in_grid (grid, 1, 0, _("Image name:"));
data->imagename = browse_widget_new(_("Select Image File"));
- gtk_table_attach_defaults(GTK_TABLE(table), data->imagename->hbox, 1, 2,
- 1, 2);
+ gtk_grid_attach (GTK_GRID (grid), data->imagename->hbox, 1, 1, 1, 1);
- label = create_label_in_table(table, 2, 0, _("_Title:"));
- data->title = create_entry_in_table(table, label, 2, 1);
- label = create_label_in_table(table, 3, 0, _("Aut_hor:"));
- data->author = create_entry_in_table(table, label, 3, 1);
- label = create_label_in_table(table, 4, 0, _("Default _URL:"));
- data->default_url = create_entry_in_table(table, label, 4, 1);
- label = create_label_in_table(table, 5, 0, _("_Description:"));
+ label = create_label_in_grid (grid, 2, 0, _("_Title:"));
+ data->title = create_entry_in_grid (grid, label, 2, 1);
+ label = create_label_in_grid (grid, 3, 0, _("Aut_hor:"));
+ data->author = create_entry_in_grid (grid, label, 3, 1);
+ label = create_label_in_grid (grid, 4, 0, _("Default _URL:"));
+ data->default_url = create_entry_in_grid (grid, label, 4, 1);
+ label = create_label_in_grid (grid, 5, 0, _("_Description:"));
data->description = gtk_text_buffer_new(NULL);
@@ -116,9 +115,9 @@ create_settings_dialog(void)
swin = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(swin),
GTK_SHADOW_IN);
- gtk_table_attach(GTK_TABLE(table), swin, 1, 2, 5, 8,
- GTK_EXPAND | GTK_SHRINK | GTK_FILL,
- GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), swin, 1, 5, 1, 3);
+ // GTK_EXPAND | GTK_SHRINK | GTK_FILL,
+ // GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
@@ -127,7 +126,7 @@ create_settings_dialog(void)
frame = gimp_frame_new(_("Map File Format"));
gtk_widget_show(frame);
- gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 2, 9, 10);
+ gtk_grid_attach (GTK_GRID (grid), frame, 0, 9, 2, 1);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox);
diff --git a/plug-ins/imagemap/imap_ui_grid.c b/plug-ins/imagemap/imap_ui_grid.c
new file mode 100644
index 0000000..32de07a
--- /dev/null
+++ b/plug-ins/imagemap/imap_ui_grid.c
@@ -0,0 +1,108 @@
+/*
+ * This is a plug-in for GIMP.
+ *
+ * Generates clickable image maps.
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "config.h"
+
+#include <libgimp/gimp.h>
+#include <libgimp/gimpui.h>
+
+#include "imap_ui_grid.h"
+
+static GtkWidget*
+add_widget_to_grid (GtkWidget *grid,
+ gint row,
+ gint col,
+ GtkWidget *w)
+{
+ gtk_grid_attach (GTK_GRID (grid), w, col, row, 1, 1);
+ gtk_widget_show (w);
+ return w;
+}
+
+GtkWidget*
+create_spin_button_in_grid (GtkWidget *grid,
+ GtkWidget *label,
+ gint row,
+ gint col,
+ gint value,
+ gint min,
+ gint max)
+{
+ GtkAdjustment *adj = gtk_adjustment_new (value, min, max, 1, 1, 1);
+ GtkWidget *button = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0);
+
+ gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (button), TRUE);
+ if (label)
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
+
+ return add_widget_to_grid (grid, row, col, button);
+}
+
+GtkWidget*
+create_check_button_in_grid (GtkWidget *grid,
+ gint row,
+ gint col,
+ const char *text)
+{
+ GtkWidget *button = gtk_check_button_new_with_mnemonic (text);
+
+ return add_widget_to_grid (grid, row, col, button);
+}
+
+GtkWidget*
+create_radio_button_in_grid (GtkWidget *grid,
+ GSList *group,
+ gint row,
+ gint col,
+ const char *text)
+{
+ GtkWidget *button = gtk_radio_button_new_with_mnemonic (group, text);
+
+ return add_widget_to_grid (grid, row, col, button);
+}
+
+GtkWidget*
+create_label_in_grid (GtkWidget *grid,
+ gint row,
+ gint col,
+ const char *text)
+{
+ GtkWidget *label = gtk_label_new_with_mnemonic (text);
+
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+
+ return add_widget_to_grid (grid, row, col, label);
+}
+
+GtkWidget*
+create_entry_in_grid (GtkWidget *grid,
+ GtkWidget *label,
+ gint row,
+ gint col)
+{
+ GtkWidget *entry = gtk_entry_new ();
+
+ if (label)
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
+
+ return add_widget_to_grid (grid, row, col, entry);
+}
diff --git a/plug-ins/imagemap/imap_ui_grid.h b/plug-ins/imagemap/imap_ui_grid.h
new file mode 100644
index 0000000..fbd580c
--- /dev/null
+++ b/plug-ins/imagemap/imap_ui_grid.h
@@ -0,0 +1,52 @@
+/*
+ * This is a plug-in for GIMP.
+ *
+ * Generates clickable image maps.
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef _IMAP_UI_GRID_H
+#define _IMAP_UI_GRID_H
+
+GtkWidget * create_spin_button_in_grid (GtkWidget *grid,
+ GtkWidget *label,
+ gint row,
+ gint col,
+ gint value,
+ gint min,
+ gint max);
+GtkWidget * create_check_button_in_grid (GtkWidget *grid,
+ gint row,
+ gint col,
+ const char *text);
+GtkWidget * create_radio_button_in_grid (GtkWidget *grid,
+ GSList *group,
+ gint row,
+ gint col,
+ const char *text);
+GtkWidget * create_label_in_grid (GtkWidget *grid,
+ gint row,
+ gint col,
+ const char *text);
+GtkWidget * create_entry_in_grid (GtkWidget *grid,
+ GtkWidget *label,
+ gint row,
+ gint col);
+
+#endif /* _IMAP_UI_GRID_H */
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]