From 243618bd273e68e59c9d6ec593e9e494aacfd64c Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 26 Sep 2003 16:52:53 +0000 Subject: [project @ 2003-09-26 16:52:53 by jmb] Add Help option to Iconbar menu svn path=/import/netsurf/; revision=317 --- riscos/gui.c | 15 +++++++++++++++ riscos/gui.h | 1 + riscos/menus.c | 11 +++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/riscos/gui.c b/riscos/gui.c index f67ebb338..3d10ba4f7 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -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); +} + diff --git a/riscos/gui.h b/riscos/gui.h index 3250d46a3..6e5e56c77 100644 --- a/riscos/gui.h +++ b/riscos/gui.h @@ -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); diff --git a/riscos/menus.c b/riscos/menus.c index 484459839..523185c2c 100644 --- a/riscos/menus.c +++ b/riscos/menus.c @@ -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); } } - -- cgit v1.2.3