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.
This commit is contained in:
Sven Neumann
2004-10-25 16:11:40 +00:00
committed by Sven Neumann
parent 865f4d8b21
commit 4762ab0a05
11 changed files with 87 additions and 51 deletions

View File

@ -1,3 +1,15 @@
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> 2004-10-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpobject.c: #include "libgimpbase/gimpbase.h", not * app/core/gimpobject.c: #include "libgimpbase/gimpbase.h", not

View File

@ -152,25 +152,25 @@ make_gimp_guides_dialog(void)
gtk_widget_show(frame); gtk_widget_show(frame);
gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 0, 1); 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_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox); gtk_widget_show(hbox);
data->alternate = data->alternate =
gtk_radio_button_new_with_mnemonic_from_widget(NULL, _("Al_ternate")); 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); gtk_widget_show(data->alternate);
data->all = gtk_radio_button_new_with_mnemonic_from_widget( data->all = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(data->alternate), _("A_ll")); 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); gtk_widget_show(data->all);
frame = gimp_frame_new(_("Add Additional Guides")); frame = gimp_frame_new(_("Add Additional Guides"));
gtk_widget_show(frame); gtk_widget_show(frame);
gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 1, 2); 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_container_add(GTK_CONTAINER(frame), vbox);
gtk_widget_show(vbox); gtk_widget_show(vbox);

View File

@ -454,12 +454,10 @@ create_edit_area_info_dialog(Object_t *obj)
default_dialog_set_cancel_cb(data->dialog, edit_area_cancel_cb, data); default_dialog_set_cancel_cb(data->dialog, edit_area_cancel_cb, data);
data->notebook = notebook = gtk_notebook_new(); data->notebook = notebook = gtk_notebook_new();
gtk_container_set_border_width(GTK_CONTAINER(notebook), 12);
g_signal_connect_after(notebook, "switch_page", g_signal_connect_after(notebook, "switch_page",
G_CALLBACK(switch_page), (gpointer) data); G_CALLBACK(switch_page), (gpointer) data);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(data->dialog->dialog)->vbox), gtk_box_pack_start(GTK_BOX(data->dialog->vbox), notebook, TRUE, TRUE, 0);
notebook, TRUE, TRUE, 10);
create_link_tab(data, notebook); create_link_tab(data, notebook);
create_info_tab(data, notebook); create_info_tab(data, notebook);
create_java_script_tab(data, notebook); create_java_script_tab(data, notebook);

View File

@ -1213,6 +1213,12 @@ factory_file_open_dialog(void)
return command_new(do_file_open_dialog); return command_new(do_file_open_dialog);
} }
static void
imap_help (void)
{
gimp_standard_help_func ("plug-in-imagemap", NULL);
}
static Command_t* static Command_t*
factory_save(void) factory_save(void)
{ {
@ -1388,6 +1394,12 @@ factory_use_gimp_guides_dialog(void)
return gimp_guides_command_new(_shapes, _drawable); return gimp_guides_command_new(_shapes, _drawable);
} }
static Command_t*
factory_help(void)
{
return command_new(imap_help);
}
static Command_t* static Command_t*
factory_about_dialog(void) factory_about_dialog(void)
{ {
@ -1406,6 +1418,8 @@ factory_move_down(void)
return move_down_command_new(_shapes); return move_down_command_new(_shapes);
} }
static gint static gint
dialog(GimpDrawable *drawable) dialog(GimpDrawable *drawable)
{ {
@ -1471,6 +1485,7 @@ dialog(GimpDrawable *drawable)
menu_set_grid_settings_command(menu, factory_grid_settings_dialog); menu_set_grid_settings_command(menu, factory_grid_settings_dialog);
menu_set_create_guides_command(menu, factory_create_guides_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_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); menu_set_about_command(menu, factory_about_dialog);
/* Create popup */ /* Create popup */

View File

@ -24,6 +24,7 @@
#include "config.h" #include "config.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "imap_circle.h" #include "imap_circle.h"
#include "imap_file.h" #include "imap_file.h"
@ -394,9 +395,15 @@ make_tools_menu(GtkWidget *menu_bar)
static void static void
make_help_menu(GtkWidget *menu_bar) make_help_menu(GtkWidget *menu_bar)
{ {
GtkWidget *help_menu = make_menu_bar_item(menu_bar, _("_Help")); GtkWidget *item;
make_item_with_label(help_menu, _("About ImageMap..."), menu_command, GtkWidget *help_menu = make_menu_bar_item(menu_bar, _("_Help"));
&_menu.cmd_about);
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* Menu_t*

View File

@ -82,6 +82,7 @@ typedef struct {
CommandFactory_t cmd_create_guides; CommandFactory_t cmd_create_guides;
CommandFactory_t cmd_use_gimp_guides; CommandFactory_t cmd_use_gimp_guides;
CommandFactory_t cmd_help;
CommandFactory_t cmd_about; CommandFactory_t cmd_about;
} Menu_t; } Menu_t;
@ -135,6 +136,8 @@ typedef struct {
((menu)->cmd_create_guides = (command)) ((menu)->cmd_create_guides = (command))
#define menu_set_use_gimp_guides_command(menu, command) \ #define menu_set_use_gimp_guides_command(menu, command) \
((menu)->cmd_use_gimp_guides = (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) \ #define menu_set_about_command(menu, command) \
((menu)->cmd_about = (command)) ((menu)->cmd_about = (command))

View File

@ -38,7 +38,7 @@ init_accel_group(GtkWidget *window)
} }
void void
add_accelerator(GtkWidget *widget, guchar accelerator_key, add_accelerator(GtkWidget *widget, guint accelerator_key,
guint8 accelerator_mods) guint8 accelerator_mods)
{ {
gtk_widget_add_accelerator(widget, "activate", accelerator_group, gtk_widget_add_accelerator(widget, "activate", accelerator_group,

View File

@ -47,7 +47,7 @@ GtkWidget *make_sub_menu(GtkWidget *parent, gchar *label);
GtkWidget *make_menu_bar_item(GtkWidget *menu_bar, gchar *label); GtkWidget *make_menu_bar_item(GtkWidget *menu_bar, gchar *label);
void menu_command(GtkWidget *widget, gpointer data); 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); guint8 accelerator_mods);

View File

@ -82,9 +82,7 @@ create_base_alert(const gchar *stock_id)
default_dialog_hide_apply_button(dialog); default_dialog_hide_apply_button(dialog);
hbox = gtk_hbox_new (FALSE, 12); hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER(hbox), 12); gtk_box_pack_start(GTK_BOX(dialog->vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox), hbox,
TRUE, TRUE, 0);
gtk_widget_show(hbox); gtk_widget_show(hbox);
image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_DIALOG); image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_DIALOG);

View File

@ -113,6 +113,8 @@ create_settings_dialog()
gtk_widget_set_size_request(view, -1, 128); gtk_widget_set_size_request(view, -1, 128);
gtk_widget_show(view); gtk_widget_show(view);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), view);
swin = gtk_scrolled_window_new(NULL, NULL); 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_SHADOW_IN);
@ -127,29 +129,29 @@ create_settings_dialog()
frame = gimp_frame_new(_("Map file format")); frame = gimp_frame_new(_("Map file format"));
gtk_widget_show(frame); gtk_widget_show(frame);
gtk_table_attach_defaults(GTK_TABLE(table), frame, 1, 2, 9, 10); gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 2, 9, 10);
hbox = gtk_hbox_new(FALSE, 1); hbox = gtk_hbox_new(FALSE, 6);
gtk_container_add(GTK_CONTAINER(frame), hbox); gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox); gtk_widget_show(hbox);
data->ncsa = gtk_radio_button_new_with_mnemonic_from_widget(NULL, "_NCSA"); 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); 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); gtk_widget_show(data->ncsa);
data->cern = gtk_radio_button_new_with_mnemonic_from_widget( data->cern = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(data->ncsa), "C_ERN"); 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); 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); gtk_widget_show(data->cern);
data->csim = gtk_radio_button_new_with_mnemonic_from_widget( data->csim = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(data->cern), "C_SIM"); 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); 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); gtk_widget_show(data->csim);
return data; return data;

View File

@ -56,7 +56,8 @@ do_source_dialog(void)
static GtkWidget *text; static GtkWidget *text;
static GtkTextBuffer *buffer; static GtkTextBuffer *buffer;
if (!dialog) { if (!dialog)
{
GtkWidget *swin; GtkWidget *swin;
dialog = make_default_dialog(_("View Source")); dialog = make_default_dialog(_("View Source"));