[project @ 2003-09-26 16:52:53 by jmb]

Add Help option to Iconbar menu

svn path=/import/netsurf/; revision=317
This commit is contained in:
John Mark Bell 2003-09-26 16:52:53 +00:00
parent 92f3368c87
commit 243618bd27
3 changed files with 23 additions and 4 deletions

View File

@ -44,6 +44,7 @@ gui_window *window_list = 0;
int gadget_subtract_x;
int gadget_subtract_y;
const char* HOME_URL = "file:///%3CNetSurf$Dir%3E/Resources/intro";
const char* HELP_URL = "file:///%3CNetSurf$Dir%3E/Docs/en/index";
struct ro_gui_drag_info;
typedef enum {
@ -1960,3 +1961,17 @@ void ro_gui_screen_size(int *width, int *height)
*height = (ywind_limit + 1) << yeig_factor;
}
void ro_gui_open_help_page (void)
{
struct browser_window *bw;
bw = create_browser_window(browser_TITLE | browser_TOOLBAR |
browser_SCROLL_X_ALWAYS |
browser_SCROLL_Y_ALWAYS, 640, 480);
gui_window_show(bw->window);
browser_window_open_location(bw, HELP_URL);
wimp_set_caret_position(bw->window->data.browser.toolbar,
ro_theme_icon(current_theme, THEME_TOOLBAR,
"TOOLBAR_URL"),
0,0,-1, (int) strlen(bw->window->url) - 1);
}

View File

@ -64,6 +64,7 @@ struct gui_window
/* in gui.c */
void ro_gui_copy_selection(gui_window* g);
void ro_gui_open_help_page(void);
/* in menus.c */
void ro_gui_menus_init(void);

View File

@ -31,15 +31,16 @@ gui_window *current_gui;
(wimp_COLOUR_WHITE << wimp_ICON_BG_COLOUR_SHIFT))
/* iconbar menu */
wimp_menu *iconbar_menu = (wimp_menu *) & (wimp_MENU(3)) {
wimp_menu *iconbar_menu = (wimp_menu *) & (wimp_MENU(4)) {
{ "NetSurf" }, 7,2,7,0, 200, 44, 0,
{
{ 0, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "Info" } },
{ 0, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "Choices" } },
{ 0, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "Help" } },
{ wimp_MENU_LAST, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "Quit" } }
}
};
int iconbar_menu_height = 3 * 44;
int iconbar_menu_height = 4 * 44;
/* browser window menu structure - based on Style Guide */
/*wimp_menu *browser_page_menu = (wimp_menu *) & (wimp_MENU(4)) {*/
@ -168,7 +169,10 @@ void ro_gui_menu_selection(wimp_selection *selection)
case 1: /* Choices */
ro_gui_dialog_open(dialog_config);
break;
case 2: /* Quit */
case 2: /* Help */
ro_gui_open_help_page();
break;
case 3: /* Quit */
netsurf_quit = 1;
break;
}
@ -230,4 +234,3 @@ void ro_gui_menu_selection(wimp_selection *selection)
ro_gui_create_menu(current_menu, current_menu_x, current_menu_y, current_gui);
}
}