[project @ 2004-05-23 12:22:05 by rjw]

Improved style guide compliance and (incomplete) option to save window starting characteristics.

svn path=/import/netsurf/; revision=891
This commit is contained in:
Richard Wilson 2004-05-23 12:22:05 +00:00
parent 38befac56a
commit 9d305e4ec0
7 changed files with 90 additions and 19 deletions

View File

@ -35,7 +35,7 @@ Home:Home page
Back:Back one page
Forward:Forward one page
Reload:Reload this page
View:View
View:Display
ScaleView:Scale view
Images:Images
ForeImg:Foreground images
@ -49,6 +49,9 @@ ToolAddress:Address bar
ToolThrob:Throbber
ToolStatus:Status bar
OptDefault:Set as default
Window:Window
WindowSave:Set as default position
WindowReset:Reset default position
Help:Help
HelpContent:Contents F1
HelpGuide:User guide
@ -186,7 +189,10 @@ HelpBrowserMenu3-2-0:\Stoggle the display of the toolbar buttons.|MURL bar uses
HelpBrowserMenu3-2-1:\Stoggle the display of the address (URL) bar.
HelpBrowserMenu3-2-2:\Stoggle the display of the throbber.|MURL bar uses the remaining space.
HelpBrowserMenu3-2-3:\Stoggle the display of the status bar.|MHorizontal scroll bar uses the remaining width.
HelpBrowserMenu3-3:\Smake your local display options the default options for NetSurf.
HelpBrowserMenu3-3:\Rcontrol the default window positioning.
HelpBrowserMenu3-3-0:\Sto make the current window position the default.
HelpBrowserMenu3-3-1:\Sto return to the default window positioning.
HelpBrowserMenu3-4:\Smake your local display options the default options for NetSurf.
HelpBrowserMenu4:\Rsee the help resources available.
HelpBrowserMenu4-0:\Sopen the documentation contents page in a new \w.
HelpBrowserMenu4-1:\Sopen the user guide in a new \w.
@ -202,6 +208,7 @@ HelpSaveAs1:This is the filename under which this document will be saved.
HelpSaveAs2:\Ssave the file with the current filename.|MIf a full path is not set, you must drag the icon to a directory.
HelpSaveAs3:\Sclose this \w without saving.
HelpScaleView:Use this window to change the scale the page is displayed at.
HelpScaleView1:Enter the scale you wish the page to be displayed at.
HelpScaleView2:\Sreduce the scale, 10% at a time.
HelpScaleView3:\Sincrease the scale, 10% at a time.

View File

@ -49,6 +49,9 @@ ToolAddress:Barre d'adresse
ToolThrob:Throbber
ToolStatus:Status bar
OptDefault:Définir par défaut
Window:Window
WindowSave:Set as default position
WindowReset:Reset default position
Help:Aide
HelpContent:Contenus F1
HelpGuide:Guide de l'utilisateur

View File

@ -186,15 +186,27 @@ static wimp_MENU(4) toolbar_menu = {
};
/* Window submenu
*/
static wimp_MENU(2) window_menu = {
{ "Window" }, 7,2,7,0, 300, 44, 0,
{
{ 0, wimp_NO_SUB_MENU, DEFAULT_FLAGS | wimp_ICON_SHADED, { "WindowSave" } },
{ wimp_MENU_LAST, wimp_NO_SUB_MENU, DEFAULT_FLAGS | wimp_ICON_SHADED, { "WindowReset" } }
}
};
/* View submenu
*/
static wimp_MENU(4) view_menu = {
static wimp_MENU(5) view_menu = {
{ "View" }, 7,2,7,0, 300, 44, 0,
{
{ wimp_MENU_GIVE_WARNING, (wimp_menu *)1, DEFAULT_FLAGS, { "ScaleView" } },
{ wimp_MENU_GIVE_WARNING, (wimp_menu *)&image_menu, DEFAULT_FLAGS, { "Images" } },
{ wimp_MENU_SEPARATE | wimp_MENU_GIVE_WARNING, (wimp_menu *)&toolbar_menu, DEFAULT_FLAGS, { "Toolbars" } },
{ wimp_MENU_LAST, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "OptDefault" } }
{ wimp_MENU_GIVE_WARNING, (wimp_menu *)1, DEFAULT_FLAGS, { "ScaleView" } },
{ wimp_MENU_GIVE_WARNING, (wimp_menu *)&image_menu, DEFAULT_FLAGS, { "Images" } },
{ wimp_MENU_GIVE_WARNING, (wimp_menu *)&toolbar_menu, DEFAULT_FLAGS, { "Toolbars" } },
{ wimp_MENU_SEPARATE, (wimp_menu *)&window_menu, DEFAULT_FLAGS | wimp_ICON_SHADED, { "Window" } },
{ wimp_MENU_LAST, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "OptDefault" } }
}
};
@ -263,6 +275,7 @@ static wimp_menu *browser_navigate_menu = (wimp_menu *)&navigate_menu;
static wimp_menu *browser_view_menu = (wimp_menu *)&view_menu;
static wimp_menu *browser_image_menu = (wimp_menu *)&image_menu;
static wimp_menu *browser_toolbar_menu = (wimp_menu *)&toolbar_menu;
static wimp_menu *browser_window_menu = (wimp_menu *)&window_menu;
static wimp_menu *browser_utilities_menu = (wimp_menu *)&utilities_menu;
static wimp_menu *browser_hotlist_menu = (wimp_menu *)&hotlist_menu;
static wimp_menu *browser_help_menu = (wimp_menu *)&help_menu;
@ -286,6 +299,7 @@ void ro_gui_menus_init(void)
translate_menu(browser_view_menu);
translate_menu(browser_image_menu);
translate_menu(browser_toolbar_menu);
translate_menu(browser_window_menu);
translate_menu(browser_utilities_menu);
translate_menu(browser_hotlist_menu);
translate_menu(browser_help_menu);
@ -531,7 +545,9 @@ void ro_gui_menu_selection(wimp_selection *selection)
}
ro_gui_menu_prepare_toolbars();
break;
case 3: /* Make default */
case 3: /* Window -> */
break;
case 4: /* Make default */
gui_window_default_options(current_gui->data.browser.bw);
break;
}

View File

@ -4,6 +4,7 @@
* http://www.opensource.org/licenses/gpl-license
* Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
* Copyright 2004 Richard Wilson <not_ginger_matt@users.sourceforge.net>
*/
/** \file
@ -32,6 +33,13 @@ extern bool option_toolbar_show_buttons;
extern bool option_toolbar_show_address;
extern bool option_toolbar_show_throbber;
extern bool option_animate_images;
extern int option_window_x;
extern int option_window_y;
extern int option_window_width;
extern int option_window_height;
extern int option_window_screen_width;
extern int option_window_screen_height;
#define EXTRA_OPTION_DEFINE \
bool option_use_mouse_gestures = false;\
@ -51,6 +59,12 @@ bool option_toolbar_show_buttons = true; \
bool option_toolbar_show_address = true; \
bool option_toolbar_show_throbber = true; \
bool option_animate_images = true;
int option_window_x = 0;
int option_window_y = 0;
int option_window_width = 0;
int option_window_height = 0;
int option_window_screen_width = 0;
int option_window_screen_height = 0;
#define EXTRA_OPTION_TABLE \
{ "use_mouse_gestures", OPTION_BOOL, &option_use_mouse_gestures },\
@ -69,6 +83,12 @@ bool option_animate_images = true;
{ "toolbar_show_buttons", OPTION_BOOL, &option_toolbar_show_buttons }, \
{ "toolbar_show_address", OPTION_BOOL, &option_toolbar_show_address }, \
{ "toolbar_show_throbber", OPTION_BOOL, &option_toolbar_show_throbber }, \
{ "animate_images", OPTION_BOOL, &option_animate_images }
{ "animate_images", OPTION_BOOL, &option_animate_images }, \
{ "window_x", OPTION_INTEGER, &option_window_x }, \
{ "window_y", OPTION_INTEGER, &option_window_y }, \
{ "window_width", OPTION_INTEGER, &option_window_width }, \
{ "window_height", OPTION_INTEGER, &option_window_height }, \
{ "window_screen_width", OPTION_INTEGER, &option_window_screen_width }, \
{ "window_screen_height", OPTION_INTEGER, &option_window_screen_height }
#endif

View File

@ -26,13 +26,13 @@
*/
static wimpextend_furniture_sizes furniture_sizes;
/**
* Gets the default horzontal scrollbar height
*/
int ro_get_hscroll_height(wimp_w w) {
wimp_version_no version;
/* Read the hscroll height
*/
furniture_sizes.w = w;
@ -54,6 +54,25 @@ int ro_get_hscroll_height(wimp_w w) {
return furniture_sizes.border_widths.y0;
}
/**
* Gets the default horzontal scrollbar height
*/
int ro_get_vscroll_width(wimp_w w) {
wimp_version_no version;
/* Read the hscroll height
*/
furniture_sizes.w = w;
furniture_sizes.border_widths.x1 = 38;
xwimpextend_get_furniture_sizes(&furniture_sizes);
/* Return the standard (unhacked) size
*/
return furniture_sizes.border_widths.x1;
}
/**
* Reads a modes EIG factors.
*

View File

@ -27,6 +27,7 @@ struct eig_factors {
int ro_get_hscroll_height(wimp_w w);
int ro_get_vscroll_width(wimp_w w);
struct eig_factors ro_read_eig_factors(os_mode mode);
void ro_convert_os_units_to_pixels(os_coord *os_units, os_mode mode);
void ro_convert_pixels_to_os_units(os_coord *pixels, os_mode mode);

View File

@ -63,22 +63,23 @@ bool gui_window_in_list(gui_window *g) {
gui_window *gui_create_browser_window(struct browser_window *bw, struct browser_window *clone)
{
int screen_width, screen_height, win_width, win_height;
int screen_width, screen_height, win_width, win_height, scroll_width;
wimp_window window;
wimp_window_state state;
gui_window* g = (gui_window*) xcalloc(1, sizeof(gui_window));
gui_window* g = (gui_window*)calloc(1, sizeof(gui_window));
if (!g) return NULL;
g->type = GUI_BROWSER_WINDOW;
g->data.browser.bw = bw;
ro_gui_screen_size(&screen_width, &screen_height);
win_width = screen_width * 3 / 4;
win_width = screen_width * 5 / 8;
if (1600 < win_width)
win_width = 1600;
win_height = win_width * 3 / 4;
win_height = win_width * 5 / 8;
window.visible.x0 = ((screen_width - win_width) / 2) + (48 * (window_count%5));
window.visible.x0 = (screen_width - win_width) / 2;
window.visible.y0 = ((screen_height - win_height) / 2) - (48 * (window_count%5));
window.visible.x1 = window.visible.x0 + win_width;
window.visible.y1 = window.visible.y0 + win_height;
@ -131,10 +132,14 @@ gui_window *gui_create_browser_window(struct browser_window *bw, struct browser_
bw->window = g;
gui_window_clone_options(bw, clone);
state.w = g->window;
wimp_get_window_state(&state);
state.next = wimp_TOP;
ro_gui_window_open(g, (wimp_open*)&state);
/* Open the window
*/
state.w = g->window;
wimp_get_window_state(&state);
scroll_width = ro_get_vscroll_width(g->window);
state.visible.x0 -= scroll_width;
state.next = wimp_TOP;
ro_gui_window_open(g, (wimp_open*)&state);
/* Set the caret position to the URL bar
*/