mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-27 16:59:36 +03:00
[project @ 2004-07-25 19:25:26 by atimmins]
Updated to support paned config dialog. svn path=/import/netsurf/; revision=1143
This commit is contained in:
parent
ab4ca31552
commit
b02f6fa9a0
@ -6,6 +6,7 @@
|
||||
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
|
||||
* Copyright 2003 John M Bell <jmb202@ecs.soton.ac.uk>
|
||||
* Copyright 2004 Richard Wilson <not_ginger_matt@users.sourceforge.net>
|
||||
* Copyright 2004 Andrew Timmins <atimmins@blueyonder.co.uk>
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@ -392,10 +393,10 @@ void ro_gui_dialog_click_config(wimp_pointer *pointer)
|
||||
set_theme_choices();
|
||||
break;
|
||||
case ICON_CONFIG_BROWSER:
|
||||
ro_gui_dialog_open(dialog_config_br);
|
||||
ro_gui_dialog_update_config(dialog_config_br);
|
||||
break;
|
||||
case ICON_CONFIG_PROXY:
|
||||
ro_gui_dialog_open(dialog_config_prox);
|
||||
ro_gui_dialog_update_config(dialog_config_prox);
|
||||
break;
|
||||
case ICON_CONFIG_THEME:
|
||||
ro_gui_dialog_open_config_th();
|
||||
@ -410,12 +411,19 @@ void ro_gui_dialog_click_config(wimp_pointer *pointer)
|
||||
|
||||
void ro_gui_save_options(void)
|
||||
{
|
||||
/* NCOS doesnt have the fancy Universal Boot vars; so select
|
||||
* the path to the choices file based on the build options */
|
||||
#ifndef NCOS
|
||||
xosfile_create_dir("<Choices$Write>.WWW", 0);
|
||||
xosfile_create_dir("<Choices$Write>.WWW.NetSurf", 0);
|
||||
options_write("<Choices$Write>.WWW.NetSurf.Choices");
|
||||
#else
|
||||
xosfile_create_dir("<User$Path>.Choices.NetSurf", 0);
|
||||
xosfile_create_dir("<User$Path>.Choices.NetSurf.Choices", 0);
|
||||
options_write("<User$Path>.Choices.NetSurf.Choices");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle clicks in the Browser Choices dialog.
|
||||
*/
|
||||
@ -497,6 +505,71 @@ void ro_gui_dialog_click_config_prox(wimp_pointer *pointer)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and open the Choices dialog.
|
||||
*/
|
||||
|
||||
void ro_gui_dialog_open_config(void)
|
||||
{
|
||||
wimp_window_state state;
|
||||
|
||||
ro_gui_dialog_open(dialog_config);
|
||||
|
||||
state.w = dialog_config;
|
||||
xwimp_get_window_state(&state);
|
||||
state.w = dialog_config_prox;
|
||||
state.visible.x0 += 0;
|
||||
state.visible.y1 -= 0;
|
||||
state.xscroll = 0;
|
||||
state.yscroll = 0;
|
||||
state.next = wimp_TOP;
|
||||
if (xwimp_open_window_nested((wimp_open *)&state, dialog_config,
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
|
||||
<< wimp_CHILD_XORIGIN_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_YORIGIN_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
|
||||
<< wimp_CHILD_LS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_BS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_RS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT << wimp_CHILD_TS_EDGE_SHIFT)) {
|
||||
LOG(("Unable to open config proxy pane window"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the pane in the Choices dialog.
|
||||
*/
|
||||
|
||||
void ro_gui_dialog_update_config(wimp_w w)
|
||||
{
|
||||
wimp_window_state state;
|
||||
|
||||
state.w = dialog_config;
|
||||
xwimp_get_window_state(&state);
|
||||
state.w = w;
|
||||
state.visible.x0 += 0;
|
||||
state.visible.y1 -= 0;
|
||||
state.xscroll = 0;
|
||||
state.yscroll = 0;
|
||||
state.next = wimp_TOP;
|
||||
if (xwimp_open_window_nested((wimp_open *)&state, dialog_config,
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
|
||||
<< wimp_CHILD_XORIGIN_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_YORIGIN_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
|
||||
<< wimp_CHILD_LS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_BS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_RS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT << wimp_CHILD_TS_EDGE_SHIFT)) {
|
||||
LOG(("Unable to update config pane window"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and open the Theme Choices dialog.
|
||||
@ -512,13 +585,12 @@ void ro_gui_dialog_open_config_th(void)
|
||||
if (!theme_list)
|
||||
return;
|
||||
|
||||
ro_gui_dialog_open(dialog_config_th);
|
||||
// ro_gui_dialog_open(dialog_config_th_pane);
|
||||
ro_gui_dialog_update_config(dialog_config_th);
|
||||
|
||||
state.w = dialog_config_th;
|
||||
xwimp_get_window_state(&state);
|
||||
state.w = dialog_config_th_pane;
|
||||
state.visible.x0 += 24;
|
||||
state.visible.x0 += 12;
|
||||
state.visible.y1 -= 12;
|
||||
state.xscroll = 0;
|
||||
state.yscroll = 0;
|
||||
@ -694,7 +766,7 @@ void ro_gui_redraw_config_th_pane_plot(wimp_draw *redraw)
|
||||
if (error)
|
||||
break;
|
||||
error = xos_plot(os_PLOT_RECTANGLE | os_PLOT_BY,
|
||||
600, -THEME_HEIGHT);
|
||||
705, -THEME_HEIGHT);
|
||||
if (error)
|
||||
break;
|
||||
error = xwimptextop_set_colour(os_COLOUR_BLACK,
|
||||
|
@ -183,7 +183,7 @@ void gui_init(int argc, char** argv)
|
||||
messages_load(path);
|
||||
messages_load("<NetSurf$Dir>.Resources.LangNames");
|
||||
|
||||
/* Totally pedantic But base the taskname on the buid options!
|
||||
/* Totally pedantic, but base the taskname on the buid options.
|
||||
*/
|
||||
#ifndef ncos
|
||||
error = xwimp_initialise(wimp_VERSION_RO38, "NetSurf",
|
||||
|
@ -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 Andrew Timmins <atimmins@blueyonder.co.uk>
|
||||
*/
|
||||
|
||||
#ifndef _NETSURF_RISCOS_GUI_H_
|
||||
@ -266,9 +267,10 @@ void ro_gui_debugwin_redraw(wimp_draw *redraw);
|
||||
|
||||
#define ICON_CONFIG_SAVE 0
|
||||
#define ICON_CONFIG_CANCEL 1
|
||||
#define ICON_CONFIG_BROWSER 2
|
||||
#define ICON_CONFIG_PROXY 3
|
||||
#define ICON_CONFIG_THEME 4
|
||||
#define ICON_CONFIG_BROWSER 7
|
||||
#define ICON_CONFIG_PROXY 6
|
||||
#define ICON_CONFIG_THEME 8
|
||||
#define ICON_CONFIG_MISC 9
|
||||
|
||||
#define ICON_CONFIG_BR_OK 0
|
||||
#define ICON_CONFIG_BR_CANCEL 1
|
||||
|
@ -592,7 +592,7 @@ void ro_gui_menu_selection(wimp_selection *selection)
|
||||
ro_gui_open_help_page("docs");
|
||||
break;
|
||||
case 2: /* Choices */
|
||||
ro_gui_dialog_open(dialog_config);
|
||||
ro_gui_dialog_open_config();
|
||||
break;
|
||||
case 3: /* Quit */
|
||||
netsurf_quit = true;
|
||||
|
@ -42,14 +42,14 @@
|
||||
#define WITH_URI
|
||||
/* ANT URL protocol support */
|
||||
#define WITH_URL
|
||||
/* Keyboard navigation support */
|
||||
#define WITH_KEYBOARD_NAVIGATION
|
||||
#endif
|
||||
#ifdef ncos
|
||||
/* Kiosk style browsing support */
|
||||
#define WITH_KIOSK_BROWSING
|
||||
/* Kiosk style browsing themes support */
|
||||
#define WITH_KIOSK_THEMES
|
||||
/* Keyboard navigation support */
|
||||
#define WITH_KEYBOARD_NAVIGATION
|
||||
#endif
|
||||
|
||||
#if defined(riscos) || defined(ncos) || defined(debug)
|
||||
|
Loading…
Reference in New Issue
Block a user