Commit 4762ab0a authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

plug-ins/imagemap/imap_cmd_gimp_guides.c

2004-10-25  Sven Neumann  <sven@gimp.org>

	* plug-ins/imagemap/imap_cmd_gimp_guides.c
	* plug-ins/imagemap/imap_edit_area_info.c
	* plug-ins/imagemap/imap_main.c
	* plug-ins/imagemap/imap_menu.[ch]
	* plug-ins/imagemap/imap_menu_funcs.[ch]
	* plug-ins/imagemap/imap_misc.c
	* plug-ins/imagemap/imap_settings.c
	* plug-ins/imagemap/imap_source.c: added a menu entry for Help.
	Did more minor layout adjustments for HIG compliance.
parent 865f4d8b
2004-10-25 Sven Neumann <sven@gimp.org>
* plug-ins/imagemap/imap_cmd_gimp_guides.c
* plug-ins/imagemap/imap_edit_area_info.c
* plug-ins/imagemap/imap_main.c
* plug-ins/imagemap/imap_menu.[ch]
* plug-ins/imagemap/imap_menu_funcs.[ch]
* plug-ins/imagemap/imap_misc.c
* plug-ins/imagemap/imap_settings.c
* plug-ins/imagemap/imap_source.c: added a menu entry for Help.
Did more minor layout adjustments for HIG compliance.
2004-10-25 Michael Natterer <mitch@gimp.org>
 
* app/core/gimpobject.c: #include "libgimpbase/gimpbase.h", not
......
......@@ -152,25 +152,25 @@ make_gimp_guides_dialog(void)
gtk_widget_show(frame);
gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 0, 1);
hbox = gtk_hbox_new(FALSE, 12);
hbox = gtk_hbox_new( FALSE, 6);
gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox);
data->alternate =
gtk_radio_button_new_with_mnemonic_from_widget(NULL, _("Al_ternate"));
gtk_box_pack_start(GTK_BOX(hbox), data->alternate, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), data->alternate, FALSE, FALSE, 0);
gtk_widget_show(data->alternate);
data->all = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(data->alternate), _("A_ll"));
gtk_box_pack_start(GTK_BOX(hbox), data->all, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), data->all, FALSE, FALSE, 0);
gtk_widget_show(data->all);
frame = gimp_frame_new(_("Add Additional Guides"));
gtk_widget_show(frame);
gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 1, 2);
vbox = gtk_vbox_new(FALSE, 1);
vbox = gtk_vbox_new(FALSE, 2);
gtk_container_add(GTK_CONTAINER(frame), vbox);
gtk_widget_show(vbox);
......
......@@ -454,12 +454,10 @@ create_edit_area_info_dialog(Object_t *obj)
default_dialog_set_cancel_cb(data->dialog, edit_area_cancel_cb, data);
data->notebook = notebook = gtk_notebook_new();
gtk_container_set_border_width(GTK_CONTAINER(notebook), 12);
g_signal_connect_after(notebook, "switch_page",
G_CALLBACK(switch_page), (gpointer) data);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(data->dialog->dialog)->vbox),
notebook, TRUE, TRUE, 10);
gtk_box_pack_start(GTK_BOX(data->dialog->vbox), notebook, TRUE, TRUE, 0);
create_link_tab(data, notebook);
create_info_tab(data, notebook);
create_java_script_tab(data, notebook);
......
......@@ -1213,6 +1213,12 @@ factory_file_open_dialog(void)
return command_new(do_file_open_dialog);
}
static void
imap_help (void)
{
gimp_standard_help_func ("plug-in-imagemap", NULL);
}
static Command_t*
factory_save(void)
{
......@@ -1388,6 +1394,12 @@ factory_use_gimp_guides_dialog(void)
return gimp_guides_command_new(_shapes, _drawable);
}
static Command_t*
factory_help(void)
{
return command_new(imap_help);
}
static Command_t*
factory_about_dialog(void)
{
......@@ -1406,6 +1418,8 @@ factory_move_down(void)
return move_down_command_new(_shapes);
}
static gint
dialog(GimpDrawable *drawable)
{
......@@ -1471,6 +1485,7 @@ dialog(GimpDrawable *drawable)
menu_set_grid_settings_command(menu, factory_grid_settings_dialog);
menu_set_create_guides_command(menu, factory_create_guides_dialog);
menu_set_use_gimp_guides_command(menu, factory_use_gimp_guides_dialog);
menu_set_help_command(menu, factory_help);
menu_set_about_command(menu, factory_about_dialog);
/* Create popup */
......
......@@ -24,6 +24,7 @@
#include "config.h"
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "imap_circle.h"
#include "imap_file.h"
......@@ -184,7 +185,7 @@ make_file_menu(GtkWidget *menu_bar)
make_item_with_image(file_menu, GTK_STOCK_OPEN, menu_command,
&_menu.cmd_open);
_menu.open_recent = make_sub_menu(file_menu, _("Open recent"));
make_item_with_image(file_menu, GTK_STOCK_SAVE, menu_command,
make_item_with_image(file_menu, GTK_STOCK_SAVE, menu_command,
&_menu.cmd_save);
item = make_item_with_image(file_menu, GTK_STOCK_SAVE_AS, menu_command,
&_menu.cmd_save_as);
......@@ -205,7 +206,7 @@ command_list_changed(Command_t *command, gpointer data)
/* Set undo entry */
if (_menu.undo)
gtk_widget_destroy(_menu.undo);
scratch = g_strdup_printf (_("_Undo %s"),
scratch = g_strdup_printf (_("_Undo %s"),
command && command->name ? command->name : "");
_menu.undo = insert_item_with_label(_menu.edit_menu, 1, scratch,
menu_command, &_menu.cmd_undo);
......@@ -221,7 +222,7 @@ command_list_changed(Command_t *command, gpointer data)
command = command_list_get_redo_command();
if (_menu.redo)
gtk_widget_destroy(_menu.redo);
scratch = g_strdup_printf (_("_Redo %s"),
scratch = g_strdup_printf (_("_Redo %s"),
command && command->name ? command->name : "");
_menu.redo = insert_item_with_label(_menu.edit_menu, 2, scratch,
menu_command, &_menu.cmd_redo);
......@@ -270,8 +271,8 @@ make_edit_menu(GtkWidget *menu_bar)
item = make_item_with_label(edit_menu, _("Select _all"), menu_command,
&_menu.cmd_select_all);
add_accelerator(item, 'A', GDK_CONTROL_MASK);
_menu.deselect_all = make_item_with_label(edit_menu, _("Deselect _all"),
menu_command,
_menu.deselect_all = make_item_with_label(edit_menu, _("Deselect _all"),
menu_command,
&_menu.cmd_deselect_all);
add_accelerator(_menu.deselect_all, 'A', GDK_SHIFT_MASK|GDK_CONTROL_MASK);
make_separator(edit_menu);
......@@ -318,9 +319,9 @@ make_view_menu(GtkWidget *menu_bar)
make_separator(view_menu);
_menu.zoom_in = make_item_with_image(view_menu, GTK_STOCK_ZOOM_IN,
_menu.zoom_in = make_item_with_image(view_menu, GTK_STOCK_ZOOM_IN,
menu_command, &_menu.cmd_zoom_in);
_menu.zoom_out = make_item_with_image(view_menu, GTK_STOCK_ZOOM_OUT,
_menu.zoom_out = make_item_with_image(view_menu, GTK_STOCK_ZOOM_OUT,
menu_command, &_menu.cmd_zoom_out);
gtk_widget_set_sensitive(_menu.zoom_out, FALSE);
......@@ -360,7 +361,7 @@ make_mapping_menu(GtkWidget *menu_bar)
_menu.arrow = make_radio_item(menu, NULL, _("Arrow"), menu_arrow, NULL);
group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(_menu.arrow));
#ifdef _NOT_READY_YET_
_menu.fuzzy_select = make_radio_item(menu, group,
_menu.fuzzy_select = make_radio_item(menu, group,
_("Select contiguous region"),
menu_fuzzy_select, NULL);
group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(_menu.fuzzy_select));
......@@ -394,9 +395,15 @@ make_tools_menu(GtkWidget *menu_bar)
static void
make_help_menu(GtkWidget *menu_bar)
{
GtkWidget *help_menu = make_menu_bar_item(menu_bar, _("_Help"));
make_item_with_label(help_menu, _("About ImageMap..."), menu_command,
&_menu.cmd_about);
GtkWidget *item;
GtkWidget *help_menu = make_menu_bar_item(menu_bar, _("_Help"));
item = make_item_with_label(help_menu, _("_Contents"), menu_command,
&_menu.cmd_help);
add_accelerator(item, GDK_F1, 0);
make_item_with_label(help_menu, _("_About ImageMap"), menu_command,
&_menu.cmd_about);
}
Menu_t*
......
......@@ -49,7 +49,7 @@ typedef struct {
GtkWidget *zoom[8];
GtkWidget *zoom_in;
GtkWidget *zoom_out;
gint nr_off_mru_items;
CommandFactory_t cmd_open;
......@@ -58,7 +58,7 @@ typedef struct {
CommandFactory_t cmd_preferences;
CommandFactory_t cmd_close;
CommandFactory_t cmd_quit;
CommandFactory_t cmd_undo;
CommandFactory_t cmd_redo;
CommandFactory_t cmd_cut;
......@@ -68,20 +68,21 @@ typedef struct {
CommandFactory_t cmd_deselect_all;
CommandFactory_t cmd_clear;
CommandFactory_t cmd_edit_area_info;
CommandFactory_t cmd_area_list;
CommandFactory_t cmd_source;
CommandFactory_t cmd_color;
CommandFactory_t cmd_gray;
CommandFactory_t cmd_zoom_in;
CommandFactory_t cmd_zoom_out;
CommandFactory_t cmd_edit_map_info;
CommandFactory_t cmd_grid_settings;
CommandFactory_t cmd_create_guides;
CommandFactory_t cmd_use_gimp_guides;
CommandFactory_t cmd_help;
CommandFactory_t cmd_about;
} Menu_t;
......@@ -135,6 +136,8 @@ typedef struct {
((menu)->cmd_create_guides = (command))
#define menu_set_use_gimp_guides_command(menu, command) \
((menu)->cmd_use_gimp_guides = (command))
#define menu_set_help_command(menu, command) \
((menu)->cmd_help = (command))
#define menu_set_about_command(menu, command) \
((menu)->cmd_about = (command))
......
......@@ -38,7 +38,7 @@ init_accel_group(GtkWidget *window)
}
void
add_accelerator(GtkWidget *widget, guchar accelerator_key,
add_accelerator(GtkWidget *widget, guint accelerator_key,
guint8 accelerator_mods)
{
gtk_widget_add_accelerator(widget, "activate", accelerator_group,
......
......@@ -27,18 +27,18 @@
typedef void (*MenuCallback)(GtkWidget *widget, gpointer data);
void init_accel_group(GtkWidget *window);
GtkWidget *make_item_with_label(GtkWidget *parent, gchar *label,
GtkWidget *make_item_with_label(GtkWidget *parent, gchar *label,
MenuCallback activate, gpointer data);
GtkWidget *make_item_with_image(GtkWidget *parent, const gchar *stock_id,
GtkWidget *make_item_with_image(GtkWidget *parent, const gchar *stock_id,
MenuCallback activate, gpointer data);
GtkWidget *prepend_item_with_label(GtkWidget *parent, gchar *label,
GtkWidget *prepend_item_with_label(GtkWidget *parent, gchar *label,
MenuCallback activate, gpointer data);
GtkWidget *insert_item_with_label(GtkWidget *parent, gint position,
gchar *label, MenuCallback activate,
GtkWidget *insert_item_with_label(GtkWidget *parent, gint position,
gchar *label, MenuCallback activate,
gpointer data);
GtkWidget *make_check_item(GtkWidget *parent, gchar *label,
GtkWidget *make_check_item(GtkWidget *parent, gchar *label,
MenuCallback activate, gpointer data);
GtkWidget *make_radio_item(GtkWidget *parent, GSList *group, gchar *label,
GtkWidget *make_radio_item(GtkWidget *parent, GSList *group, gchar *label,
MenuCallback activate, gpointer data);
void make_separator(GtkWidget *parent);
......@@ -47,7 +47,7 @@ GtkWidget *make_sub_menu(GtkWidget *parent, gchar *label);
GtkWidget *make_menu_bar_item(GtkWidget *menu_bar, gchar *label);
void menu_command(GtkWidget *widget, gpointer data);
void add_accelerator(GtkWidget *widget, guchar accelerator_key,
void add_accelerator(GtkWidget *widget, guint accelerator_key,
guint8 accelerator_mods);
......
......@@ -82,9 +82,7 @@ create_base_alert(const gchar *stock_id)
default_dialog_hide_apply_button(dialog);
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER(hbox), 12);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox), hbox,
TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(dialog->vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show(hbox);
image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_DIALOG);
......
......@@ -62,7 +62,7 @@ settings_ok_cb(gpointer data)
GTK_ENTRY(param->imagename->file)));
g_strreplace(&info->title, gtk_entry_get_text(GTK_ENTRY(param->title)));
g_strreplace(&info->author, gtk_entry_get_text(GTK_ENTRY(param->author)));
g_strreplace(&info->default_url,
g_strreplace(&info->default_url,
gtk_entry_get_text(GTK_ENTRY(param->default_url)));
gtk_text_buffer_get_bounds(param->description, &start, &end);
description = gtk_text_buffer_get_text(param->description, &start, &end,
......@@ -96,7 +96,7 @@ create_settings_dialog()
create_label_in_table(table, 1, 0, _("Image name:"));
data->imagename = browse_widget_new(_("Select Image File"));
gtk_table_attach_defaults(GTK_TABLE(table), data->imagename->hbox, 1, 2,
gtk_table_attach_defaults(GTK_TABLE(table), data->imagename->hbox, 1, 2,
1, 2);
label = create_label_in_table(table, 2, 0, _("_Title:"));
......@@ -113,43 +113,45 @@ create_settings_dialog()
gtk_widget_set_size_request(view, -1, 128);
gtk_widget_show(view);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), view);
swin = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(swin),
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_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
GTK_POLICY_NEVER,
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_widget_show(swin);
gtk_container_add(GTK_CONTAINER(swin), view);
frame = gimp_frame_new(_("Map file format"));
gtk_widget_show(frame);
gtk_table_attach_defaults(GTK_TABLE(table), frame, 1, 2, 9, 10);
hbox = gtk_hbox_new(FALSE, 1);
gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 2, 9, 10);
hbox = gtk_hbox_new(FALSE, 6);
gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox);
data->ncsa = gtk_radio_button_new_with_mnemonic_from_widget(NULL, "_NCSA");
g_signal_connect(data->ncsa, "toggled",
g_signal_connect(data->ncsa, "toggled",
G_CALLBACK(type_toggled_cb), (gpointer) NCSA);
gtk_box_pack_start(GTK_BOX(hbox), data->ncsa, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), data->ncsa, FALSE, FALSE, 0);
gtk_widget_show(data->ncsa);
data->cern = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(data->ncsa), "C_ERN");
g_signal_connect(data->cern, "toggled",
g_signal_connect(data->cern, "toggled",
G_CALLBACK(type_toggled_cb), (gpointer) CERN);
gtk_box_pack_start(GTK_BOX(hbox), data->cern, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), data->cern, FALSE, FALSE, 0);
gtk_widget_show(data->cern);
data->csim = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(data->cern), "C_SIM");
g_signal_connect(data->csim, "toggled",
g_signal_connect(data->csim, "toggled",
G_CALLBACK(type_toggled_cb), (gpointer) CSIM);
gtk_box_pack_start(GTK_BOX(hbox), data->csim, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), data->csim, FALSE, FALSE, 0);
gtk_widget_show(data->csim);
return data;
......
......@@ -56,7 +56,8 @@ do_source_dialog(void)
static GtkWidget *text;
static GtkTextBuffer *buffer;
if (!dialog) {
if (!dialog)
{
GtkWidget *swin;
dialog = make_default_dialog(_("View Source"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment