rationalise windows resource script

make window options dialog into a property sheet

svn path=/trunk/netsurf/; revision=11929
This commit is contained in:
Vincent Sanders 2011-03-06 23:27:09 +00:00
parent a88963d82e
commit b925439a14
22 changed files with 1171 additions and 1000 deletions

View File

@ -67,7 +67,7 @@ BOOL CALLBACK nsws_about_event_callback(HWND hwnd, UINT msg, WPARAM wparam,
{
switch(msg) {
case WM_INITDIALOG: {
HWND content = GetDlgItem(hwnd, NSWS_ID_ABOUT_CONTENT);
HWND content = GetDlgItem(hwnd, IDC_ABOUT_CONTENT);
/* modify label NSWS_ID_ABOUT_CONTENT */
size_t len;
char *newcontent, *authors, *artists, *documenters;
@ -165,7 +165,7 @@ BOOL CALLBACK nsws_about_event_callback(HWND hwnd, UINT msg, WPARAM wparam,
void nsws_about_dialog_init(HINSTANCE hinst, HWND parent)
{
int ret = DialogBox(hinst, MAKEINTRESOURCE(NSWS_ID_ABOUT_DIALOG), parent,
int ret = DialogBox(hinst, MAKEINTRESOURCE(IDD_DLG_ABOUT), parent,
nsws_about_event_callback);
if (ret == -1) {
warn_user(messages_get("NoMemory"), 0);

View File

@ -40,7 +40,7 @@ void *bitmap_create(int width, int height, unsigned int state)
{
struct bitmap *bitmap;
BITMAPV5HEADER *pbmi;
BITMAP *windib;
HBITMAP windib;
uint8_t *pixdata;
LOG(("width %d, height %d, state %u",width,height,state));
@ -61,7 +61,7 @@ void *bitmap_create(int width, int height, unsigned int state)
pbmi->bV5BlueMask = 0xff0000; /* blue mask */
pbmi->bV5AlphaMask = 0xff000000; /* alpha mask */
windib = CreateDIBSection(NULL, (BITMAPINFO *)pbmi, DIB_RGB_COLORS, &pixdata, NULL, 0);
windib = CreateDIBSection(NULL, (BITMAPINFO *)pbmi, DIB_RGB_COLORS, (void **)&pixdata, NULL, 0);
if (windib == NULL) {

View File

@ -23,7 +23,7 @@
#include "desktop/plotters.h"
struct bitmap {
BITMAP *windib;
HBITMAP windib;
BITMAPV5HEADER *pbmi;
int width;
int height;

View File

@ -137,8 +137,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
bool nsws_download_window_up(struct gui_download_window *w)
{
w->hwnd = CreateDialog(hinstance, MAKEINTRESOURCE(
NSWS_ID_DOWNLOAD_DIALOG),
w->hwnd = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_DLG_DOWNLOAD),
gui_window_main_window(w->window),
nsws_download_event_callback);
if (w->hwnd == NULL) {
@ -155,7 +154,7 @@ BOOL CALLBACK nsws_download_event_callback(HWND hwnd, UINT msg, WPARAM wparam,
HWND sub;
switch(msg){
case WM_INITDIALOG:
sub = GetDlgItem(hwnd, NSWS_ID_DOWNLOAD_LABEL);
sub = GetDlgItem(hwnd, IDC_DOWNLOAD_LABEL);
nsws_download_update_label((void *)download1);
nsws_download_update_progress((void *)download1);
return TRUE;
@ -182,7 +181,7 @@ void nsws_download_update_label(void *p)
schedule_remove(nsws_download_update_label, p);
return;
}
HWND sub = GetDlgItem(w->hwnd, NSWS_ID_DOWNLOAD_LABEL);
HWND sub = GetDlgItem(w->hwnd, IDC_DOWNLOAD_LABEL);
char *size = human_friendly_bytesize(w->downloaded);
int i = 0, temp = w->time_remaining;
if (temp == -1) {
@ -230,7 +229,7 @@ void nsws_download_update_progress(void *p)
schedule_remove(nsws_download_update_progress, p);
return;
}
HWND sub = GetDlgItem(w->hwnd, NSWS_ID_DOWNLOAD_PROGRESS);
HWND sub = GetDlgItem(w->hwnd, IDC_DOWNLOAD_PROGRESS);
SendMessage(sub, PBM_SETPOS, (WPARAM)(w->progress / 100), 0);
if (w->progress < 10000)
schedule(50, nsws_download_update_progress, p);

View File

@ -233,7 +233,7 @@ nsws_window_urlbar_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
switch (msg) {
case WM_CHAR:
if (wparam == 13) {
SendMessage(gw->main, WM_COMMAND, NSWS_ID_LAUNCH_URL, 0);
SendMessage(gw->main, WM_COMMAND, IDC_MAIN_LAUNCH_URL, 0);
return 0;
}
break;
@ -289,7 +289,7 @@ nsws_window_toolbar_command(struct gui_window *gw,
switch(identifier) {
case NSWS_ID_URLBAR:
case IDC_MAIN_URLBAR:
switch (notification_code) {
case EN_CHANGE:
LOG(("EN_CHANGE"));
@ -411,23 +411,23 @@ static void nsws_window_update_forward_back(struct gui_window *w)
bool back = history_back_available(w->bw->history);
if (w->mainmenu != NULL) {
EnableMenuItem(w->mainmenu, NSWS_ID_NAV_FORWARD,
EnableMenuItem(w->mainmenu, IDM_NAV_FORWARD,
(forward ? MF_ENABLED : MF_GRAYED));
EnableMenuItem(w->mainmenu, NSWS_ID_NAV_BACK,
EnableMenuItem(w->mainmenu, IDM_NAV_BACK,
(back ? MF_ENABLED : MF_GRAYED));
EnableMenuItem(w->rclick, NSWS_ID_NAV_FORWARD,
EnableMenuItem(w->rclick, IDM_NAV_FORWARD,
(forward ? MF_ENABLED : MF_GRAYED));
EnableMenuItem(w->rclick, NSWS_ID_NAV_BACK,
EnableMenuItem(w->rclick, IDM_NAV_BACK,
(back ? MF_ENABLED : MF_GRAYED));
}
if (w->toolbar != NULL) {
SendMessage(w->toolbar, TB_SETSTATE,
(WPARAM) NSWS_ID_NAV_FORWARD,
(WPARAM) IDM_NAV_FORWARD,
MAKELONG((forward ? TBSTATE_ENABLED :
TBSTATE_INDETERMINATE), 0));
SendMessage(w->toolbar, TB_SETSTATE,
(WPARAM) NSWS_ID_NAV_BACK,
(WPARAM) IDM_NAV_BACK,
MAKELONG((back ? TBSTATE_ENABLED :
TBSTATE_INDETERMINATE), 0));
}
@ -454,31 +454,31 @@ static void nsws_update_edit(struct gui_window *w)
del = false;
}
EnableMenuItem(w->mainmenu,
NSWS_ID_EDIT_PASTE,
IDM_EDIT_PASTE,
(paste ? MF_ENABLED : MF_GRAYED));
EnableMenuItem(w->rclick,
NSWS_ID_EDIT_PASTE,
IDM_EDIT_PASTE,
(paste ? MF_ENABLED : MF_GRAYED));
EnableMenuItem(w->mainmenu,
NSWS_ID_EDIT_COPY,
IDM_EDIT_COPY,
(copy ? MF_ENABLED : MF_GRAYED));
EnableMenuItem(w->rclick,
NSWS_ID_EDIT_COPY,
IDM_EDIT_COPY,
(copy ? MF_ENABLED : MF_GRAYED));
if (del == true) {
EnableMenuItem(w->mainmenu, NSWS_ID_EDIT_CUT, MF_ENABLED);
EnableMenuItem(w->mainmenu, NSWS_ID_EDIT_DELETE, MF_ENABLED);
EnableMenuItem(w->rclick, NSWS_ID_EDIT_CUT, MF_ENABLED);
EnableMenuItem(w->rclick, NSWS_ID_EDIT_DELETE, MF_ENABLED);
EnableMenuItem(w->mainmenu, IDM_EDIT_CUT, MF_ENABLED);
EnableMenuItem(w->mainmenu, IDM_EDIT_DELETE, MF_ENABLED);
EnableMenuItem(w->rclick, IDM_EDIT_CUT, MF_ENABLED);
EnableMenuItem(w->rclick, IDM_EDIT_DELETE, MF_ENABLED);
} else {
EnableMenuItem(w->mainmenu, NSWS_ID_EDIT_CUT, MF_GRAYED);
EnableMenuItem(w->mainmenu, NSWS_ID_EDIT_DELETE, MF_GRAYED);
EnableMenuItem(w->rclick, NSWS_ID_EDIT_CUT, MF_GRAYED);
EnableMenuItem(w->rclick, NSWS_ID_EDIT_DELETE, MF_GRAYED);
EnableMenuItem(w->mainmenu, IDM_EDIT_CUT, MF_GRAYED);
EnableMenuItem(w->mainmenu, IDM_EDIT_DELETE, MF_GRAYED);
EnableMenuItem(w->rclick, IDM_EDIT_CUT, MF_GRAYED);
EnableMenuItem(w->rclick, IDM_EDIT_DELETE, MF_GRAYED);
}
}
@ -523,33 +523,33 @@ static void nsws_window_set_accels(struct gui_window *w)
for (i = 0; i < nitems; i++)
accels[i].fVirt = FCONTROL | FVIRTKEY;
accels[0].key = 0x51; /* Q */
accels[0].cmd = NSWS_ID_FILE_QUIT;
accels[0].cmd = IDM_FILE_QUIT;
accels[1].key = 0x4E; /* N */
accels[1].cmd = NSWS_ID_FILE_OPEN_WINDOW;
accels[1].cmd = IDM_FILE_OPEN_WINDOW;
accels[2].key = VK_LEFT;
accels[2].cmd = NSWS_ID_NAV_BACK;
accels[2].cmd = IDM_NAV_BACK;
accels[3].key = VK_RIGHT;
accels[3].cmd = NSWS_ID_NAV_FORWARD;
accels[3].cmd = IDM_NAV_FORWARD;
accels[4].key = VK_UP;
accels[4].cmd = NSWS_ID_NAV_HOME;
accels[4].cmd = IDM_NAV_HOME;
accels[5].key = VK_BACK;
accels[5].cmd = NSWS_ID_NAV_STOP;
accels[5].cmd = IDM_NAV_STOP;
accels[6].key = VK_SPACE;
accels[6].cmd = NSWS_ID_NAV_RELOAD;
accels[6].cmd = IDM_NAV_RELOAD;
accels[7].key = 0x4C; /* L */
accels[7].cmd = NSWS_ID_FILE_OPEN_LOCATION;
accels[7].cmd = IDM_FILE_OPEN_LOCATION;
accels[8].key = 0x57; /* w */
accels[8].cmd = NSWS_ID_FILE_CLOSE_WINDOW;
accels[8].cmd = IDM_FILE_CLOSE_WINDOW;
accels[9].key = 0x41; /* A */
accels[9].cmd = NSWS_ID_EDIT_SELECT_ALL;
accels[9].cmd = IDM_EDIT_SELECT_ALL;
accels[10].key = VK_F8;
accels[10].cmd = NSWS_ID_VIEW_SOURCE;
accels[10].cmd = IDM_VIEW_SOURCE;
accels[11].key = VK_RETURN;
accels[11].fVirt = FVIRTKEY;
accels[11].cmd = NSWS_ID_LAUNCH_URL;
accels[11].cmd = IDC_MAIN_LAUNCH_URL;
accels[12].key = VK_F11;
accels[12].fVirt = FVIRTKEY;
accels[12].cmd = NSWS_ID_VIEW_FULLSCREEN;
accels[12].cmd = IDM_VIEW_FULLSCREEN;
w->acceltable = CreateAcceleratorTable(accels, nitems);
}
@ -593,7 +593,7 @@ nsws_window_throbber_create(struct gui_window *w)
NSWS_THROBBER_WIDTH,
NSWS_THROBBER_WIDTH,
w->main,
(HMENU) NSWS_ID_THROBBER,
(HMENU) IDC_MAIN_THROBBER,
hinstance,
NULL);
@ -650,7 +650,7 @@ nsws_window_urlbar_create(struct gui_window *gw, HWND hwndparent)
urlwidth,
urlheight,
hwndparent,
(HMENU)NSWS_ID_URLBAR,
(HMENU)IDC_MAIN_URLBAR,
hinstance,
0);
@ -681,11 +681,11 @@ nsws_window_toolbar_create(struct gui_window *gw, HWND hWndParent)
HWND hWndToolbar;
/* Toolbar buttons */
TBBUTTON tbButtons[] = {
{0, NSWS_ID_NAV_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{1, NSWS_ID_NAV_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{2, NSWS_ID_NAV_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{3, NSWS_ID_NAV_RELOAD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{4, NSWS_ID_NAV_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{0, IDM_NAV_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{1, IDM_NAV_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{2, IDM_NAV_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{3, IDM_NAV_RELOAD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{4, IDM_NAV_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
};
WNDPROC toolproc;
@ -716,13 +716,13 @@ nsws_window_toolbar_create(struct gui_window *gw, HWND hWndParent)
gw->toolbuttonc = sizeof(tbButtons) / sizeof(TBBUTTON);
/* Create the standard image list and assign to toolbar. */
nsws_set_imagelist(hWndToolbar, TB_SETIMAGELIST, NSWS_ID_TOOLBAR_BITMAP, gw->toolbuttonsize, gw->toolbuttonc);
nsws_set_imagelist(hWndToolbar, TB_SETIMAGELIST, IDR_TOOLBAR_BITMAP, gw->toolbuttonsize, gw->toolbuttonc);
/* Create the disabled image list and assign to toolbar. */
nsws_set_imagelist(hWndToolbar, TB_SETDISABLEDIMAGELIST, NSWS_ID_TOOLBAR_GREY_BITMAP, gw->toolbuttonsize, gw->toolbuttonc);
nsws_set_imagelist(hWndToolbar, TB_SETDISABLEDIMAGELIST, IDR_TOOLBAR_BITMAP_GREY, gw->toolbuttonsize, gw->toolbuttonc);
/* Create the hot image list and assign to toolbar. */
nsws_set_imagelist(hWndToolbar, TB_SETHOTIMAGELIST, NSWS_ID_TOOLBAR_HOT_BITMAP, gw->toolbuttonsize, gw->toolbuttonc);
nsws_set_imagelist(hWndToolbar, TB_SETHOTIMAGELIST, IDR_TOOLBAR_BITMAP_HOT, gw->toolbuttonsize, gw->toolbuttonc);
/* Add buttons. */
SendMessage(hWndToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
@ -1265,7 +1265,7 @@ nsws_window_resize(struct gui_window *w,
if (w->toolbar != NULL) {
SendMessage(w->toolbar, TB_SETSTATE,
(WPARAM) NSWS_ID_NAV_STOP,
(WPARAM) IDM_NAV_STOP,
MAKELONG(TBSTATE_INDETERMINATE, 0));
}
@ -1284,7 +1284,7 @@ nsws_window_command(struct gui_window *gw,
switch(identifier) {
case NSWS_ID_FILE_QUIT:
case IDM_FILE_QUIT:
{
struct gui_window *w;
w = window_list;
@ -1295,40 +1295,37 @@ nsws_window_command(struct gui_window *gw,
break;
}
case NSWS_ID_FILE_OPEN_LOCATION:
case IDM_FILE_OPEN_LOCATION:
SetFocus(gw->urlbar);
break;
case NSWS_ID_FILE_OPEN_WINDOW:
case IDM_FILE_OPEN_WINDOW:
browser_window_create(NULL, gw->bw, NULL, false, false);
break;
case NSWS_ID_FILE_CLOSE_WINDOW:
case IDM_FILE_CLOSE_WINDOW:
PostMessage(gw->main, WM_CLOSE, 0, 0);
break;
case NSWS_ID_FILE_SAVE_PAGE:
case IDM_FILE_SAVE_PAGE:
break;
case NSWS_ID_FILE_SAVEAS_TEXT:
case IDM_FILE_SAVEAS_TEXT:
break;
case NSWS_ID_FILE_SAVEAS_PDF:
case IDM_FILE_SAVEAS_PDF:
break;
case NSWS_ID_FILE_SAVEAS_DRAWFILE:
case IDM_FILE_SAVEAS_POSTSCRIPT:
break;
case NSWS_ID_FILE_SAVEAS_POSTSCRIPT:
case IDM_FILE_PRINT_PREVIEW:
break;
case NSWS_ID_FILE_PRINT_PREVIEW:
case IDM_FILE_PRINT:
break;
case NSWS_ID_FILE_PRINT:
break;
case NSWS_ID_EDIT_CUT:
case IDM_EDIT_CUT:
OpenClipboard(gw->main);
EmptyClipboard();
CloseClipboard();
@ -1339,7 +1336,7 @@ nsws_window_command(struct gui_window *gw,
}
break;
case NSWS_ID_EDIT_COPY:
case IDM_EDIT_COPY:
OpenClipboard(gw->main);
EmptyClipboard();
CloseClipboard();
@ -1350,7 +1347,7 @@ nsws_window_command(struct gui_window *gw,
}
break;
case NSWS_ID_EDIT_PASTE: {
case IDM_EDIT_PASTE: {
OpenClipboard(gw->main);
HANDLE h = GetClipboardData(CF_TEXT);
if (h != NULL) {
@ -1366,28 +1363,28 @@ nsws_window_command(struct gui_window *gw,
break;
}
case NSWS_ID_EDIT_DELETE:
case IDM_EDIT_DELETE:
if (GetFocus() == gw->urlbar)
SendMessage(gw->urlbar, WM_CUT, 0, 0);
else
browser_window_key_press(gw->bw, KEY_DELETE_RIGHT);
break;
case NSWS_ID_EDIT_SELECT_ALL:
case IDM_EDIT_SELECT_ALL:
if (GetFocus() == gw->urlbar)
SendMessage(gw->urlbar, EM_SETSEL, 0, -1);
else
selection_select_all(gw->bw->sel);
break;
case NSWS_ID_EDIT_SEARCH:
case IDM_EDIT_SEARCH:
break;
case NSWS_ID_EDIT_PREFERENCES:
nsws_prefs_dialog_init(gw->main);
case IDM_EDIT_PREFERENCES:
nsws_prefs_dialog_init(hinstance, gw->main);
break;
case NSWS_ID_NAV_BACK:
case IDM_NAV_BACK:
if ((gw->bw != NULL) &&
(history_back_available(gw->bw->history))) {
history_back(gw->bw, gw->bw->history);
@ -1395,7 +1392,7 @@ nsws_window_command(struct gui_window *gw,
nsws_window_update_forward_back(gw);
break;
case NSWS_ID_NAV_FORWARD:
case IDM_NAV_FORWARD:
if ((gw->bw != NULL) &&
(history_forward_available(gw->bw->history))) {
history_forward(gw->bw, gw->bw->history);
@ -1403,26 +1400,26 @@ nsws_window_command(struct gui_window *gw,
nsws_window_update_forward_back(gw);
break;
case NSWS_ID_NAV_HOME:
case IDM_NAV_HOME:
browser_window_go(gw->bw, default_page, 0, true);
break;
case NSWS_ID_NAV_STOP:
case IDM_NAV_STOP:
browser_window_stop(gw->bw);
break;
case NSWS_ID_NAV_RELOAD:
case IDM_NAV_RELOAD:
browser_window_reload(gw->bw, true);
break;
case NSWS_ID_NAV_LOCALHISTORY:
case IDM_NAV_LOCALHISTORY:
nsws_localhistory_init(gw);
break;
case NSWS_ID_NAV_GLOBALHISTORY:
case IDM_NAV_GLOBALHISTORY:
break;
case NSWS_ID_VIEW_ZOOMPLUS: {
case IDM_VIEW_ZOOMPLUS: {
int x, y;
gui_window_get_scroll(gw, &x, &y);
if (gw->bw != NULL) {
@ -1434,7 +1431,7 @@ nsws_window_command(struct gui_window *gw,
break;
}
case NSWS_ID_VIEW_ZOOMMINUS: {
case IDM_VIEW_ZOOMMINUS: {
int x, y;
gui_window_get_scroll(gw, &x, &y);
if (gw->bw != NULL) {
@ -1447,7 +1444,7 @@ nsws_window_command(struct gui_window *gw,
break;
}
case NSWS_ID_VIEW_ZOOMNORMAL: {
case IDM_VIEW_ZOOMNORMAL: {
int x, y;
gui_window_get_scroll(gw, &x, &y);
if (gw->bw != NULL) {
@ -1459,10 +1456,10 @@ nsws_window_command(struct gui_window *gw,
break;
}
case NSWS_ID_VIEW_SOURCE:
case IDM_VIEW_SOURCE:
break;
case NSWS_ID_VIEW_SAVE_WIN_METRICS: {
case IDM_VIEW_SAVE_WIN_METRICS: {
RECT r;
GetWindowRect(gw->main, &r);
option_window_x = r.left;
@ -1473,7 +1470,7 @@ nsws_window_command(struct gui_window *gw,
break;
}
case NSWS_ID_VIEW_FULLSCREEN: {
case IDM_VIEW_FULLSCREEN: {
RECT rdesk;
if (gw->fullscreen == NULL) {
HWND desktop = GetDesktopWindow();
@ -1511,36 +1508,36 @@ nsws_window_command(struct gui_window *gw,
break;
}
case NSWS_ID_VIEW_DOWNLOADS:
case IDM_VIEW_DOWNLOADS:
break;
case NSWS_ID_VIEW_TOGGLE_DEBUG_RENDERING:
case IDM_VIEW_TOGGLE_DEBUG_RENDERING:
html_redraw_debug = !html_redraw_debug;
if (gw->bw != NULL) {
browser_window_reformat(gw->bw, gw->width, gw->height);
}
break;
case NSWS_ID_VIEW_DEBUGGING_SAVE_BOXTREE:
case IDM_VIEW_DEBUGGING_SAVE_BOXTREE:
break;
case NSWS_ID_VIEW_DEBUGGING_SAVE_DOMTREE:
case IDM_VIEW_DEBUGGING_SAVE_DOMTREE:
break;
case NSWS_ID_HELP_CONTENTS:
case IDM_HELP_CONTENTS:
break;
case NSWS_ID_HELP_GUIDE:
case IDM_HELP_GUIDE:
break;
case NSWS_ID_HELP_INFO:
case IDM_HELP_INFO:
break;
case NSWS_ID_HELP_ABOUT:
case IDM_HELP_ABOUT:
nsws_about_dialog_init(hinstance, gw->main);
break;
case NSWS_ID_LAUNCH_URL:
case IDC_MAIN_LAUNCH_URL:
{
if (GetFocus() != gw->urlbar)
break;
@ -1570,6 +1567,7 @@ nsws_window_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
gw = nsws_get_gui_window(hwnd);
if ((msg!=WM_SETCURSOR) && (msg!=WM_MOUSEMOVE) &&(msg!=WM_NCHITTEST))
LOG(("%s, hwnd %p, gw %p", msg_num_to_name(msg), hwnd, gw));
if (gw == NULL) {
@ -1641,12 +1639,12 @@ static void create_local_windows_classes(void) {
w.cbClsExtra = 0;
w.cbWndExtra = 0;
w.hInstance = hinstance;
w.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(NSWS_ID_NETSURF32_ICON)); /* -> NetSurf */
w.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDR_NETSURF32_ICON)); /* -> NetSurf */
w.hCursor = NULL;
w.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
w.lpszMenuName = NULL;
w.lpszClassName = windowclassname_main;
w.hIconSm = LoadIcon(hinstance, MAKEINTRESOURCE(NSWS_ID_NETSURF16_ICON)); /* -> NetSurf */
w.hIconSm = LoadIcon(hinstance, MAKEINTRESOURCE(IDR_NETSURF16_ICON)); /* -> NetSurf */
RegisterClassEx(&w);
/* drawable area */
@ -1671,7 +1669,7 @@ static HWND nsws_window_statusbar_create(struct gui_window *w)
WS_CHILD | WS_VISIBLE,
0, 0, 0, 0,
w->main,
(HMENU)NSWS_ID_STATUSBAR,
(HMENU)IDC_MAIN_STATUSBAR,
hinstance,
NULL);
SendMessage(hwnd, SB_SETTEXT, 0, (LPARAM)"NetSurf");
@ -1712,8 +1710,8 @@ static HWND nsws_window_create(struct gui_window *gw)
#endif
InitCommonControlsEx(&icc);
gw->mainmenu = LoadMenu(hinstance, MAKEINTRESOURCE(NSWS_ID_MAINMENU));
gw->rclick = LoadMenu(hinstance, MAKEINTRESOURCE(NSWS_ID_CTXMENU));
gw->mainmenu = LoadMenu(hinstance, MAKEINTRESOURCE(IDR_MENU_MAIN));
gw->rclick = LoadMenu(hinstance, MAKEINTRESOURCE(IDR_MENU_CONTEXT));
LOG(("creating window for hInstance %p", hinstance));
hwnd = CreateWindowEx(0,
@ -2289,18 +2287,18 @@ void gui_window_start_throbber(struct gui_window *w)
nsws_window_update_forward_back(w);
if (w->mainmenu != NULL) {
EnableMenuItem(w->mainmenu, NSWS_ID_NAV_STOP, MF_ENABLED);
EnableMenuItem(w->mainmenu, NSWS_ID_NAV_RELOAD, MF_GRAYED);
EnableMenuItem(w->mainmenu, IDM_NAV_STOP, MF_ENABLED);
EnableMenuItem(w->mainmenu, IDM_NAV_RELOAD, MF_GRAYED);
}
if (w->rclick != NULL) {
EnableMenuItem(w->rclick, NSWS_ID_NAV_STOP, MF_ENABLED);
EnableMenuItem(w->rclick, NSWS_ID_NAV_RELOAD, MF_GRAYED);
EnableMenuItem(w->rclick, IDM_NAV_STOP, MF_ENABLED);
EnableMenuItem(w->rclick, IDM_NAV_RELOAD, MF_GRAYED);
}
if (w->toolbar != NULL) {
SendMessage(w->toolbar, TB_SETSTATE, (WPARAM) NSWS_ID_NAV_STOP,
SendMessage(w->toolbar, TB_SETSTATE, (WPARAM) IDM_NAV_STOP,
MAKELONG(TBSTATE_ENABLED, 0));
SendMessage(w->toolbar, TB_SETSTATE,
(WPARAM) NSWS_ID_NAV_RELOAD,
(WPARAM) IDM_NAV_RELOAD,
MAKELONG(TBSTATE_INDETERMINATE, 0));
}
w->throbbing = true;
@ -2313,18 +2311,18 @@ void gui_window_stop_throbber(struct gui_window *w)
return;
nsws_window_update_forward_back(w);
if (w->mainmenu != NULL) {
EnableMenuItem(w->mainmenu, NSWS_ID_NAV_STOP, MF_GRAYED);
EnableMenuItem(w->mainmenu, NSWS_ID_NAV_RELOAD, MF_ENABLED);
EnableMenuItem(w->mainmenu, IDM_NAV_STOP, MF_GRAYED);
EnableMenuItem(w->mainmenu, IDM_NAV_RELOAD, MF_ENABLED);
}
if (w->rclick != NULL) {
EnableMenuItem(w->rclick, NSWS_ID_NAV_STOP, MF_GRAYED);
EnableMenuItem(w->rclick, NSWS_ID_NAV_RELOAD, MF_ENABLED);
EnableMenuItem(w->rclick, IDM_NAV_STOP, MF_GRAYED);
EnableMenuItem(w->rclick, IDM_NAV_RELOAD, MF_ENABLED);
}
if (w->toolbar != NULL) {
SendMessage(w->toolbar, TB_SETSTATE, (WPARAM) NSWS_ID_NAV_STOP,
SendMessage(w->toolbar, TB_SETSTATE, (WPARAM) IDM_NAV_STOP,
MAKELONG(TBSTATE_INDETERMINATE, 0));
SendMessage(w->toolbar, TB_SETSTATE,
(WPARAM) NSWS_ID_NAV_RELOAD,
(WPARAM) IDM_NAV_RELOAD,
MAKELONG(TBSTATE_ENABLED, 0));
}
w->throbbing = false;
@ -2582,13 +2580,15 @@ static void gui_init(int argc, char** argv)
nsws_window_init_pointers();
LOG(("argc %d, argv %p", argc, argv));
/* ensure homepage option has a default */
if (option_homepage_url == NULL || option_homepage_url[0] == '\0')
option_homepage_url = strdup(default_page);
/* If there is a url specified on the command line use it */
if (argc > 1)
addr = argv[1];
else if (option_homepage_url != NULL && option_homepage_url[0]
!= '\0')
else
addr = option_homepage_url;
else
addr = default_page;
LOG(("calling browser_window_create"));
bw = browser_window_create(addr, 0, 0, true, false);

File diff suppressed because it is too large Load Diff

View File

@ -19,8 +19,6 @@
#ifndef _NETSURF_WINDOWS_PREFS_H_
#define _NETSURF_WINDOWS_PREFS_H_
#include <windows.h>
void nsws_prefs_dialog_init(HWND parent);
void nsws_prefs_dialog_init(HINSTANCE hinst, HWND parent);
#endif

BIN
windows/res/banner.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
windows/res/home.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
windows/res/netsurf.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,225 +1,264 @@
// Generated by ResEdit 1.4.8
// Copyright (C) 2006-2009
// http://www.resedit.net
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "../resourceid.h"
IDR_NETSURF32_ICON ICON DISCARDABLE "NetSurf32.ico"
IDR_NETSURF16_ICON ICON DISCARDABLE "NetSurf16.ico"
IDR_TOOLBAR_BITMAP BITMAP DISCARDABLE "toolbar.bmp"
IDR_TOOLBAR_BITMAP_GREY BITMAP DISCARDABLE "toolbarg.bmp"
IDR_TOOLBAR_BITMAP_HOT BITMAP DISCARDABLE "toolbarh.bmp"
IDR_NETSURF_BANNER BITMAP DISCARDABLE "banner.bmp"
IDR_HOME_BITMAP BITMAP DISCARDABLE "home.bmp"
//
// Bitmap resources
//
NSWS_ID_TOOLBAR_BITMAP BITMAP "toolbar.bmp"
IDR_THROBBER_FRAME0_BITMAP BITMAP DISCARDABLE "throbber/throbber0.bmp"
IDR_THROBBER_FRAME1_BITMAP BITMAP DISCARDABLE "throbber/throbber1.bmp"
IDR_THROBBER_FRAME2_BITMAP BITMAP DISCARDABLE "throbber/throbber2.bmp"
IDR_THROBBER_FRAME3_BITMAP BITMAP DISCARDABLE "throbber/throbber3.bmp"
IDR_THROBBER_FRAME4_BITMAP BITMAP DISCARDABLE "throbber/throbber4.bmp"
IDR_THROBBER_FRAME5_BITMAP BITMAP DISCARDABLE "throbber/throbber5.bmp"
IDR_THROBBER_FRAME6_BITMAP BITMAP DISCARDABLE "throbber/throbber6.bmp"
IDR_THROBBER_FRAME7_BITMAP BITMAP DISCARDABLE "throbber/throbber7.bmp"
IDR_MENU_MAIN MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New Window",IDM_FILE_OPEN_WINDOW
MENUITEM "Open &Location",IDM_FILE_OPEN_LOCATION
MENUITEM "&Close",IDM_FILE_CLOSE_WINDOW
MENUITEM SEPARATOR
MENUITEM "&Save Page",IDM_FILE_SAVE_PAGE,GRAYED,HELP
POPUP "Save Page &As"
BEGIN
MENUITEM "Text",IDM_FILE_SAVEAS_TEXT,GRAYED
MENUITEM "PDF",IDM_FILE_SAVEAS_PDF,GRAYED
MENUITEM "Postscript",IDM_FILE_SAVEAS_POSTSCRIPT,GRAYED
END
MENUITEM SEPARATOR
MENUITEM "Print Pre&view",IDM_FILE_PRINT_PREVIEW
MENUITEM "&Print",IDM_FILE_PRINT
MENUITEM SEPARATOR
MENUITEM "E&xit",IDM_FILE_QUIT
END
POPUP "&Edit"
BEGIN
MENUITEM "Cu&t",IDM_EDIT_CUT
MENUITEM "&Copy",IDM_EDIT_COPY
MENUITEM "&Paste",IDM_EDIT_PASTE
MENUITEM "&Delete",IDM_EDIT_DELETE
MENUITEM SEPARATOR
MENUITEM "Select &All",IDM_EDIT_SELECT_ALL
MENUITEM SEPARATOR
MENUITEM "&Find",IDM_EDIT_SEARCH
END
POPUP "&View"
BEGIN
MENUITEM "Stop",IDM_NAV_STOP
MENUITEM "Reload",IDM_NAV_RELOAD
MENUITEM SEPARATOR
POPUP "&Zoom"
BEGIN
MENUITEM "Zoom &In",IDM_VIEW_ZOOMPLUS
MENUITEM "Zoom &Out",IDM_VIEW_ZOOMMINUS
MENUITEM "&Reset",IDM_VIEW_ZOOMNORMAL
END
MENUITEM SEPARATOR
MENUITEM "Page S&ource",IDM_VIEW_SOURCE
MENUITEM "&Full Screen",IDM_VIEW_FULLSCREEN
END
POPUP "&History"
BEGIN
MENUITEM "Back",IDM_NAV_BACK
MENUITEM "Forward",IDM_NAV_FORWARD
MENUITEM "Home",IDM_NAV_HOME
MENUITEM SEPARATOR
MENUITEM "Local History",IDM_NAV_LOCALHISTORY
MENUITEM "Global History",IDM_NAV_GLOBALHISTORY,GRAYED
END
POPUP "&Tools"
BEGIN
MENUITEM "&Downloads",IDM_VIEW_DOWNLOADS
MENUITEM "Save size and location",IDM_VIEW_SAVE_WIN_METRICS
POPUP "Debugging"
BEGIN
MENUITEM "Debug rendering",IDM_VIEW_TOGGLE_DEBUG_RENDERING
MENUITEM "Save Box Tree",IDM_VIEW_DEBUGGING_SAVE_BOXTREE,GRAYED
MENUITEM "Save DOM Tree",IDM_VIEW_DEBUGGING_SAVE_DOMTREE,GRAYED
END
MENUITEM SEPARATOR
MENUITEM "Options...",IDM_EDIT_PREFERENCES
END
POPUP "&Help"
BEGIN
MENUITEM "&Contents",IDM_HELP_CONTENTS,GRAYED
MENUITEM "G&uide",IDM_HELP_GUIDE,GRAYED
MENUITEM "&Info",IDM_HELP_INFO,GRAYED
MENUITEM SEPARATOR
MENUITEM "&About NetSurf",IDM_HELP_ABOUT
END
END
NSWS_ID_TOOLBAR_GREY_BITMAP BITMAP "toolbarg.bmp"
IDR_MENU_CONTEXT MENU
BEGIN
POPUP "Context"
BEGIN
MENUITEM "&Back",IDM_NAV_BACK
MENUITEM "F&orward",IDM_NAV_FORWARD
MENUITEM "&Home",IDM_NAV_HOME
MENUITEM "&Stop",IDM_NAV_STOP
MENUITEM "&Reload",IDM_NAV_RELOAD
MENUITEM SEPARATOR
MENUITEM "C&ut",IDM_EDIT_CUT,GRAYED
MENUITEM "&Copy",IDM_EDIT_COPY,GRAYED
MENUITEM "&Paste",IDM_EDIT_PASTE,GRAYED
MENUITEM "&Delete",IDM_EDIT_DELETE,GRAYED
END
END
NSWS_ID_TOOLBAR_HOT_BITMAP BITMAP "toolbarh.bmp"
//
// Menu resources
//
NSWS_ID_CTXMENU MENU
{
POPUP "Context"
{
MENUITEM "&Back", NSWS_ID_NAV_BACK
MENUITEM "F&orward", NSWS_ID_NAV_FORWARD
MENUITEM "&Home", NSWS_ID_NAV_HOME
MENUITEM "&Stop", NSWS_ID_NAV_STOP
MENUITEM "&Reload", NSWS_ID_NAV_RELOAD
MENUITEM SEPARATOR
MENUITEM "C&ut", NSWS_ID_EDIT_CUT, GRAYED
MENUITEM "&Copy", NSWS_ID_EDIT_COPY, GRAYED
MENUITEM "&Paste", NSWS_ID_EDIT_PASTE, GRAYED
MENUITEM "&Delete", NSWS_ID_EDIT_DELETE, GRAYED
}
}
NSWS_ID_MAINMENU MENU
{
POPUP "&File"
{
MENUITEM "&New Window", NSWS_ID_FILE_OPEN_WINDOW
MENUITEM "Open &Location", NSWS_ID_FILE_OPEN_LOCATION
MENUITEM "&Close", NSWS_ID_FILE_CLOSE_WINDOW
MENUITEM SEPARATOR
MENUITEM "&Save Page", NSWS_ID_FILE_SAVE_PAGE, HELP, GRAYED
POPUP "Save Page &As"
{
MENUITEM "Text", NSWS_ID_FILE_SAVEAS_TEXT, GRAYED
MENUITEM "PDF", NSWS_ID_FILE_SAVEAS_PDF, GRAYED
MENUITEM "Drawfile", NSWS_ID_FILE_SAVEAS_DRAWFILE, GRAYED
MENUITEM "Postscript", NSWS_ID_FILE_SAVEAS_POSTSCRIPT, GRAYED
}
MENUITEM SEPARATOR
MENUITEM "Print Pre&view", NSWS_ID_FILE_PRINT_PREVIEW
MENUITEM "&Print", NSWS_ID_FILE_PRINT
MENUITEM SEPARATOR
MENUITEM "E&xit", NSWS_ID_FILE_QUIT
}
POPUP "&Edit"
{
MENUITEM "Cu&t", NSWS_ID_EDIT_CUT
MENUITEM "&Copy", NSWS_ID_EDIT_COPY
MENUITEM "&Paste", NSWS_ID_EDIT_PASTE
MENUITEM "&Delete", NSWS_ID_EDIT_DELETE
MENUITEM SEPARATOR
MENUITEM "Select &All", NSWS_ID_EDIT_SELECT_ALL
MENUITEM SEPARATOR
MENUITEM "&Find", NSWS_ID_EDIT_SEARCH
}
POPUP "&View"
{
MENUITEM "Stop", NSWS_ID_NAV_STOP
MENUITEM "Reload", NSWS_ID_NAV_RELOAD
MENUITEM SEPARATOR
POPUP "&Zoom"
{
MENUITEM "Zoom &In", NSWS_ID_VIEW_ZOOMPLUS
MENUITEM "Zoom &Out", NSWS_ID_VIEW_ZOOMMINUS
MENUITEM "&Reset", NSWS_ID_VIEW_ZOOMNORMAL
}
MENUITEM SEPARATOR
MENUITEM "Page S&ource", NSWS_ID_VIEW_SOURCE
MENUITEM "&Full Screen", NSWS_ID_VIEW_FULLSCREEN
}
POPUP "&History"
{
MENUITEM "Back", NSWS_ID_NAV_BACK
MENUITEM "Forward", NSWS_ID_NAV_FORWARD
MENUITEM "Home", NSWS_ID_NAV_HOME
MENUITEM SEPARATOR
MENUITEM "Local History", NSWS_ID_NAV_LOCALHISTORY
MENUITEM "Global History", NSWS_ID_NAV_GLOBALHISTORY, GRAYED
}
POPUP "&Tools"
{
MENUITEM "&Downloads", NSWS_ID_VIEW_DOWNLOADS
MENUITEM "Save size and location", NSWS_ID_VIEW_SAVE_WIN_METRICS
POPUP "Debugging"
{
MENUITEM "Debug rendering", NSWS_ID_VIEW_TOGGLE_DEBUG_RENDERING
MENUITEM "Save Box Tree", NSWS_ID_VIEW_DEBUGGING_SAVE_BOXTREE, GRAYED
MENUITEM "Save DOM Tree", NSWS_ID_VIEW_DEBUGGING_SAVE_DOMTREE, GRAYED
}
MENUITEM SEPARATOR
MENUITEM "Options...", NSWS_ID_EDIT_PREFERENCES
}
POPUP "&Help"
{
MENUITEM "&Contents", NSWS_ID_HELP_CONTENTS, GRAYED
MENUITEM "G&uide", NSWS_ID_HELP_GUIDE, GRAYED
MENUITEM "&Info", NSWS_ID_HELP_INFO, GRAYED
MENUITEM SEPARATOR
MENUITEM "&About NetSurf", NSWS_ID_HELP_ABOUT
}
}
//
// Dialog resources
//
NSWS_ID_ABOUT_DIALOG DIALOG 0, 0, 400, 350
STYLE DS_MODALFRAME | DS_SETFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
IDD_DLG_ABOUT DIALOGEX 10,10,309,180
CAPTION "About NetSurf"
FONT 8, "MS Sans Serif"
{
DEFPUSHBUTTON "&OK", IDOK, 345, 317, 41, 16
GROUPBOX "About NetSurf", IDC_STATIC, 10, 10, 380, 328
CTEXT "content", NSWS_ID_ABOUT_CONTENT, 20, 20, 361, 292, SS_CENTER
}
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU
EXSTYLE WS_EX_DLGMODALFRAME
BEGIN
CONTROL IDR_NETSURF_BANNER,IDC_IMG1,"Static",SS_BITMAP,0,0,308,86
CONTROL "",IDC_ABOUT_CONTENT,"Static",WS_CHILDWINDOW|WS_VISIBLE,10,93,288,63
CONTROL "&OK",IDOK,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,246,160,54,15
CONTROL "&Credits",IDC_BTN_CREDITS,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,10,160,54,15
CONTROL "&Licence",IDC_BTN_LICENCE,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,70,160,54,15
END
IDD_DLG_DOWNLOAD DIALOGEX 0,0,201,84
CAPTION "Download"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_POPUP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_MODALFRAME|DS_SETFONT
EXSTYLE WS_EX_DLGMODALFRAME
BEGIN
CONTROL "downloading [file] [size] from [domain] to [destination]",IDC_DOWNLOAD_LABEL,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_CENTER,6,6,189,35
CONTROL "progress",IDC_DOWNLOAD_PROGRESS,PROGRESS_CLASS,WS_VISIBLE,6,50,189,10
CONTROL "&OK",IDOK,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,141,66,54,15
CONTROL "&Cancel",IDCANCEL,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,81,66,54,15
END
IDD_DLG_OPTIONS_GENERAL DIALOGEX 0,0,220,200
CAPTION "General"
FONT 8,"MS Shell Dlg"
STYLE DS_CONTROL|DS_SHELLFONT
BEGIN
/* home page entry */
CONTROL "Home Page",IDC_STATIC,"Static",SS_LEFT,7,7,40,8
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,47,11,166,1
CONTROL IDR_HOME_BITMAP,IDC_STATIC,"Static",SS_BITMAP,15,19,24,24
CONTROL "",IDC_PREFS_HOMEPAGE,"Edit",WS_TABSTOP|ES_OEMCONVERT|ES_AUTOHSCROLL,43,19,170,14,WS_EX_CLIENTEDGE
/* Content control */
CONTROL "Content Control",IDC_STATIC,"Static",SS_LEFT,7,40,60,8
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,67,44,146,1
CONTROL "Hide Images",IDC_PREFS_IMAGES,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,43,52,67,10
CONTROL "Hide Advertisements",IDC_PREFS_ADVERTS,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,43,66,81,10
CONTROL "Send referer",IDC_PREFS_REFERER,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,43,80,55,10
END
IDD_DLG_OPTIONS_CONNECTIONS DIALOGEX 0,0,220,200
CAPTION "Connections"
FONT 8,"MS Shell Dlg"
STYLE DS_CONTROL|DS_SHELLFONT
BEGIN
/* proxy divider */
CONTROL "Proxy",IDC_STATIC,"Static",SS_LEFT,7,7,30,8
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,37,11,176,1
/* proxy controls */
CONTROL "Type:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,22,40,8
CONTROL "",IDC_PREFS_PROXYTYPE,"ComboBox",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|CBS_DROPDOWNLIST,80,19,60,60
CONTROL "Server:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,39,28,8
CONTROL "",IDC_PREFS_PROXYHOST,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_OEMCONVERT|ES_AUTOHSCROLL,80,36,80,14,WS_EX_CLIENTEDGE
CONTROL "Port:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,164,39,16,8
CONTROL "",IDC_PREFS_PROXYPORT,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_OEMCONVERT|ES_AUTOHSCROLL,182,36,24,14,WS_EX_CLIENTEDGE
CONTROL "Username:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,60,35,8
CONTROL "",IDC_PREFS_PROXYNAME,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_OEMCONVERT|ES_AUTOHSCROLL,80,57,45,14,WS_EX_CLIENTEDGE
CONTROL "Password:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,132,60,34,8
CONTROL "",IDC_PREFS_PROXYPASS,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_OEMCONVERT|ES_AUTOHSCROLL|ES_PASSWORD,168,57,45,14,WS_EX_CLIENTEDGE
/* fetcher divider */
CONTROL "Fetchers",IDC_STATIC,"Static",SS_LEFT,7,78,40,8
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,42,82,171,1
/* max fetchers */
CONTROL "Max Fetchers:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP,43,96,64,8
CONTROL "",IDC_PREFS_FETCHERS,"Edit",ES_NUMBER|ES_RIGHT|WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|WS_BORDER,111,93,30,14
CONTROL "Max Fetchers",IDC_PREFS_FETCHERS_SPIN,UPDOWN_CLASS,UDS_AUTOBUDDY|UDS_ALIGNRIGHT|WS_VISIBLE,341,122,11,15
/* fetchers per host */
CONTROL "Fetches per host:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP,43,118,64,8
CONTROL "",IDC_PREFS_FETCH_HOST,"Edit",ES_NUMBER|ES_RIGHT|WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|WS_BORDER,111,114,30,14
CONTROL "Fetches per host",IDC_PREFS_FETCH_HOST_SPIN,UPDOWN_CLASS,UDS_AUTOBUDDY|UDS_ALIGNRIGHT|WS_VISIBLE,341,140,11,15
/* cached fetchers */
CONTROL "Cached Fetches:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP,43,138,64,8
CONTROL "",IDC_PREFS_FETCH_HANDLES,"Edit",ES_NUMBER|ES_RIGHT|WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|WS_BORDER,111,135,30,14
CONTROL "Cached Fetches",IDC_PREFS_FETCH_HANDLES_SPIN,UPDOWN_CLASS,UDS_AUTOBUDDY|UDS_ALIGNRIGHT|WS_VISIBLE,341,158,11,15
END
IDD_DLG_OPTIONS_APPERANCE DIALOGEX 10,10,220,200
CAPTION "Apperance"
FONT 8,"MS Shell Dlg"
STYLE DS_CONTROL|DS_SHELLFONT
BEGIN
/* proxy separator */
CONTROL "Fonts",IDC_STATIC,"Static",SS_LEFT,7,7,20,8
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,27,11,186,1
/* font controls */
CONTROL "Sans-serif:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,22,44,8
CONTROL "Sans-serif",IDC_PREFS_SANS,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,89,19,50,14
CONTROL "Serif:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,40,24,8
CONTROL "Serif",IDC_PREFS_SERIF,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,89,37,50,14
CONTROL "Monospace:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,58,40,8
CONTROL "Monospace",IDC_PREFS_MONO,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,89,55,50,14
CONTROL "Cursive:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,76,32,8
CONTROL "Cursive",IDC_PREFS_CURSIVE,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,89,73,50,14
CONTROL "Fantasy:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,94,32,8
CONTROL "Fantasy",IDC_PREFS_FANTASY,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,89,91,50,14
CONTROL "Default:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,112,38,8
CONTROL "",IDC_PREFS_FONTDEF,"ComboBox",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|CBS_DROPDOWNLIST,89,109,50,60
CONTROL "Size:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,147,112,16,8
CONTROL "",IDC_PREFS_FONT_SIZE,"Edit",ES_NUMBER|WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,165,109,35,14,WS_EX_CLIENTEDGE
CONTROL "Font Size",IDC_PREFS_FONT_SIZE_SPIN,UPDOWN_CLASS,UDS_AUTOBUDDY|UDS_ALIGNRIGHT|WS_VISIBLE,75,137,11,15
CONTROL "Minimum Size:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,43,130,52,8
CONTROL "",IDC_PREFS_FONT_MINSIZE,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,97,127,35,14,WS_EX_CLIENTEDGE
CONTROL "Minimum Font Size",IDC_PREFS_FONT_MINSIZE_SPIN,UPDOWN_CLASS,UDS_AUTOBUDDY|UDS_ALIGNRIGHT|WS_VISIBLE,76,159,11,15
/* animation separator */
CONTROL "Animation",IDC_STATIC,"Static",SS_LEFT,7,148,36,8
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,43,152,170,1
CONTROL "Disable",IDC_PREFS_NOANIMATION,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,43,163,39,10
CONTROL "Minimum delay:",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP|SS_LEFT,55,180,56,8
CONTROL "",IDC_PREFS_ANIMATIONDELAY,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,113,177,35,14,WS_EX_CLIENTEDGE
CONTROL "Min delay",IDC_PREFS_ANIMATIONDELAY_SPIN,UPDOWN_CLASS,UDS_AUTOBUDDY|UDS_ALIGNRIGHT|WS_VISIBLE,43,210,11,15
NSWS_ID_DOWNLOAD_DIALOG DIALOG 0, 0, 200, 100
STYLE DS_MODALFRAME | DS_SETFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
CAPTION "download"
FONT 8, "MS Sans Serif"
{
PUSHBUTTON "&OK", IDOK, 150, 75, 30, 20
PUSHBUTTON "&Cancel", IDCANCEL, 110, 75, 35, 20
CTEXT "downloading [file] [size] from [domain] to [destination]", NSWS_ID_DOWNLOAD_LABEL, 6, 6, 189, 35, SS_CENTER
CONTROL "progress", NSWS_ID_DOWNLOAD_PROGRESS, PROGRESS_CLASS, 0, 6, 50, 189, 10
}
NSWS_ID_PREFS_DIALOG DIALOG 0, 0, 388, 205
STYLE DS_MODALFRAME | DS_SETFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
CAPTION "Edit preferences"
FONT 8, "MS Sans Serif"
{
PUSHBUTTON "&OK", IDOK, 297, 179, 34, 18
PUSHBUTTON "&Cancel", IDCANCEL, 336, 179, 45, 18
CTEXT "Home Page:", IDC_STATIC, 11, 17, 40, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_HOMEPAGE, 55, 15, 322, 12, ES_AUTOHSCROLL | ES_OEMCONVERT
AUTOCHECKBOX "Hide Advertisements", NSWS_ID_PREFS_ADVERTS, 203, 51, 81, 10
AUTOCHECKBOX "Disable Pop-ups", NSWS_ID_PREFS_POPUPS, 203, 63, 67, 10
AUTOCHECKBOX "Disable Plugins", NSWS_ID_PREFS_PLUGINS, 203, 76, 64, 10
AUTOCHECKBOX "Send referer", NSWS_ID_PREFS_REFERER, 203, 89, 55, 10
CTEXT "HTTP proxy", IDC_STATIC, 9, 51, 40, 10, SS_CENTER
COMBOBOX NSWS_ID_PREFS_PROXYTYPE, 52, 49, 131, 60, CBS_DROPDOWNLIST
CTEXT "Host:", IDC_STATIC, 31, 70, 18, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_PROXYHOST, 52, 69, 89, 12, ES_AUTOHSCROLL | ES_OEMCONVERT
EDITTEXT NSWS_ID_PREFS_PROXYPORT, 163, 69, 20, 12, ES_AUTOHSCROLL | ES_OEMCONVERT
CTEXT "Username:", IDC_STATIC, 14, 88, 35, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_PROXYNAME, 52, 86, 45, 12, ES_AUTOHSCROLL | ES_OEMCONVERT
CTEXT "Password:", IDC_STATIC, 101, 89, 34, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_PROXYPASS, 138, 86, 45, 12, ES_AUTOHSCROLL | ES_OEMCONVERT
CTEXT "Size", IDC_STATIC, 32, 140, 14, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_FONT_SIZE, 49, 137, 26, 15
CONTROL "Font Size", NSWS_ID_PREFS_FONT_SIZE_SPIN, UPDOWN_CLASS, UDS_NOTHOUSANDS, 75, 137, 11, 15
CTEXT "Min Size", IDC_STATIC, 18, 162, 28, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_FONT_MINSIZE, 49, 159, 26, 15
CONTROL "Font Size", NSWS_ID_PREFS_FONT_MINSIZE_SPIN, UPDOWN_CLASS, UDS_NOTHOUSANDS, 76, 159, 11, 15
CTEXT "Sans-serif:", IDC_STATIC, 125, 135, 34, 8, SS_CENTER
PUSHBUTTON "Sans", NSWS_ID_PREFS_SANS, 165, 132, 65, 15
CTEXT "Serif:", IDC_STATIC, 142, 119, 17, 8, SS_CENTER
PUSHBUTTON "Serif", NSWS_ID_PREFS_SERIF, 165, 116, 65, 15
CTEXT "Monospace:", IDC_STATIC, 119, 169, 40, 8, SS_CENTER
PUSHBUTTON "Monospace", NSWS_ID_PREFS_MONO, 165, 166, 65, 15
CTEXT "Cursive:", IDC_STATIC, 133, 152, 26, 8, SS_CENTER
PUSHBUTTON "Cursive", NSWS_ID_PREFS_CURSIVE, 165, 149, 65, 15
CTEXT "Fantasy:", IDC_STATIC, 131, 186, 28, 8, SS_CENTER
PUSHBUTTON "Fantasy", NSWS_ID_PREFS_FANTASY, 165, 183, 65, 15
CTEXT "Font default", IDC_STATIC, 8, 121, 38, 8, SS_CENTER
COMBOBOX NSWS_ID_PREFS_FONTDEF, 49, 118, 68, 60, CBS_DROPDOWNLIST
CTEXT "Max Fetchers", IDC_STATIC, 266, 122, 44, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_FETCHERS, 314, 120, 25, 15
CONTROL "Max Fetchers", NSWS_ID_PREFS_FETCHERS_SPIN, UPDOWN_CLASS, UDS_AUTOBUDDY | UDS_SETBUDDYINT, 340, 120, 11, 15
CTEXT "Fetches per host", IDC_STATIC, 256, 139, 54, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_FETCH_HOST, 314, 137, 25, 15
CONTROL "Fetches per host", NSWS_ID_PREFS_FETCH_HOST_SPIN, UPDOWN_CLASS, UDS_AUTOBUDDY | UDS_SETBUDDYINT, 341, 137, 11, 15
CTEXT "Cached Fetches", IDC_STATIC, 258, 157, 53, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_FETCH_HANDLES, 314, 154, 25, 15
CONTROL "cached Fetches", NSWS_ID_PREFS_FETCH_HANDLES_SPIN, UPDOWN_CLASS, UDS_AUTOBUDDY | UDS_SETBUDDYINT, 341, 154, 11, 15
AUTOCHECKBOX "Disable", NSWS_ID_PREFS_NOANIMATION, 307, 51, 39, 10
CTEXT "Min delay", IDC_STATIC, 308, 68, 31, 8, SS_CENTER
EDITTEXT NSWS_ID_PREFS_ANIMATIONDELAY, 343, 65, 20, 15
CONTROL "Min delay", NSWS_ID_PREFS_ANIMATIONDELAY_SPIN, UPDOWN_CLASS, UDS_NOTHOUSANDS, 363, 65, 11, 15
GROUPBOX "Startup", IDC_STATIC, 3, 2, 379, 31
GROUPBOX "Connection", IDC_STATIC, 4, 37, 186, 67
CTEXT "Port:", IDC_STATIC, 144, 71, 16, 8, SS_CENTER
GROUPBOX "Content", IDC_STATIC, 198, 37, 91, 68
GROUPBOX "Animation", IDC_STATIC, 298, 37, 85, 68
GROUPBOX "Fonts", IDC_STATIC, 3, 108, 234, 94
GROUPBOX "Fetchers", IDC_STATIC, 247, 108, 134, 69
}
//
// Icon resources
//
NSWS_ID_NETSURF32_ICON ICON "NetSurf32.ico"
NSWS_ID_NETSURF16_ICON ICON "NetSurf16.ico"
END

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -23,95 +23,115 @@
#define IDC_STATIC (-1)
#endif
#define NSWS_ID_NETSURF32_ICON 10
#define NSWS_ID_NETSURF16_ICON 11
#define IDR_NETSURF32_ICON 100
#define IDR_NETSURF16_ICON 101
#define IDR_TOOLBAR_BITMAP 102
#define IDR_TOOLBAR_BITMAP_GREY 103
#define IDR_TOOLBAR_BITMAP_HOT 104
#define IDR_NETSURF_BANNER 105
#define IDR_HOME_BITMAP 114
#define NSWS_ID_MAINMENU 101
#define NSWS_ID_CTXMENU 103
#define NSWS_ID_TOOLBAR_BITMAP 107
#define NSWS_ID_TOOLBAR_GREY_BITMAP 108
#define NSWS_ID_TOOLBAR_HOT_BITMAP 109
#define IDR_THROBBER_FRAME0_BITMAP 106
#define IDR_THROBBER_FRAME1_BITMAP 107
#define IDR_THROBBER_FRAME2_BITMAP 108
#define IDR_THROBBER_FRAME3_BITMAP 109
#define IDR_THROBBER_FRAME4_BITMAP 110
#define IDR_THROBBER_FRAME5_BITMAP 111
#define IDR_THROBBER_FRAME6_BITMAP 112
#define IDR_THROBBER_FRAME7_BITMAP 113
#define NSWS_ID_TOOLBAR 1111
#define NSWS_ID_URLBAR 1112
#define NSWS_ID_THROBBER 1113
#define NSWS_ID_DRAWINGAREA 1114
#define NSWS_ID_STATUSBAR 1115
#define NSWS_ID_LAUNCH_URL 1116
#define IDD_DLG_ABOUT 1000
#define IDC_IMG1 1001
#define IDC_ABOUT_CONTENT 1002
#define IDC_BTN_CREDITS 1004
#define IDC_BTN_LICENCE 1005
#define NSWS_ID_ABOUT_DIALOG 11111
#define NSWS_ID_ABOUT_CONTENT 11112
#define NSWS_ID_PREFS_DIALOG 11113
#define NSWS_ID_PREFS_HOMEPAGE 11114
#define NSWS_ID_PREFS_ADVERTS 11115
#define NSWS_ID_PREFS_POPUPS 11116
#define NSWS_ID_PREFS_PLUGINS 11117
#define NSWS_ID_PREFS_REFERER 11118
#define NSWS_ID_PREFS_PROXYTYPE 11119
#define NSWS_ID_PREFS_PROXYHOST 11120
#define NSWS_ID_PREFS_PROXYPORT 11121
#define NSWS_ID_PREFS_PROXYNAME 11122
#define NSWS_ID_PREFS_PROXYPASS 11123
#define NSWS_ID_PREFS_FONT_SIZE 11124
#define NSWS_ID_PREFS_FONT_SIZE_SPIN 11125
#define NSWS_ID_PREFS_FONT_MINSIZE 11126
#define NSWS_ID_PREFS_FONT_MINSIZE_SPIN 11127
#define NSWS_ID_PREFS_SANS 11128
#define NSWS_ID_PREFS_SERIF 11129
#define NSWS_ID_PREFS_MONO 11130
#define NSWS_ID_PREFS_CURSIVE 11131
#define NSWS_ID_PREFS_FANTASY 11132
#define NSWS_ID_PREFS_FONTDEF 11133
#define NSWS_ID_PREFS_FETCHERS 11134
#define NSWS_ID_PREFS_FETCHERS_SPIN 11135
#define NSWS_ID_PREFS_FETCH_HOST 11136
#define NSWS_ID_PREFS_FETCH_HOST_SPIN 11137
#define NSWS_ID_PREFS_FETCH_HANDLES 11138
#define NSWS_ID_PREFS_FETCH_HANDLES_SPIN 11139
#define NSWS_ID_PREFS_NOANIMATION 11140
#define NSWS_ID_PREFS_ANIMATIONDELAY 11141
#define NSWS_ID_PREFS_ANIMATIONDELAY_SPIN 11142
#define NSWS_ID_DOWNLOAD_DIALOG 11143
#define NSWS_ID_DOWNLOAD_LABEL 11144
#define NSWS_ID_DOWNLOAD_PROGRESS 11145
#define NSWS_ID_FILE_OPEN_WINDOW 40000
#define NSWS_ID_FILE_OPEN_LOCATION 40001
#define NSWS_ID_FILE_CLOSE_WINDOW 40002
#define NSWS_ID_FILE_SAVEAS_TEXT 40003
#define NSWS_ID_FILE_SAVEAS_PDF 40004
#define NSWS_ID_FILE_SAVEAS_DRAWFILE 40005
#define NSWS_ID_FILE_SAVEAS_POSTSCRIPT 40006
#define NSWS_ID_FILE_PRINT_PREVIEW 40007
#define NSWS_ID_FILE_PRINT 40008
#define NSWS_ID_FILE_QUIT 40009
#define NSWS_ID_FILE_SAVE_PAGE 40010
#define NSWS_ID_EDIT_CUT 40011
#define NSWS_ID_EDIT_COPY 40012
#define NSWS_ID_EDIT_PASTE 40013
#define NSWS_ID_EDIT_DELETE 40014
#define NSWS_ID_EDIT_SELECT_ALL 40015
#define NSWS_ID_EDIT_SEARCH 40016
#define NSWS_ID_EDIT_PREFERENCES 40017
#define NSWS_ID_HELP_CONTENTS 40018
#define NSWS_ID_HELP_GUIDE 40019
#define NSWS_ID_HELP_INFO 40020
#define NSWS_ID_HELP_ABOUT 40021
#define NSWS_ID_VIEW_FULLSCREEN 40022
#define NSWS_ID_VIEW_SOURCE 40023
#define NSWS_ID_VIEW_ZOOMPLUS 40024
#define NSWS_ID_VIEW_ZOOMMINUS 40025
#define NSWS_ID_VIEW_ZOOMNORMAL 40026
#define NSWS_ID_NAV_BACK 40027
#define NSWS_ID_NAV_FORWARD 40028
#define NSWS_ID_NAV_HOME 40029
#define NSWS_ID_NAV_STOP 40030
#define NSWS_ID_NAV_RELOAD 40031
#define NSWS_ID_NAV_LOCALHISTORY 40032
#define NSWS_ID_NAV_GLOBALHISTORY 40033
#define NSWS_ID_VIEW_DOWNLOADS 40034
#define NSWS_ID_VIEW_SAVE_WIN_METRICS 40035
#define NSWS_ID_VIEW_TOGGLE_DEBUG_RENDERING 40036
#define NSWS_ID_VIEW_DEBUGGING_SAVE_BOXTREE 40037
#define NSWS_ID_VIEW_DEBUGGING_SAVE_DOMTREE 40038
#define IDD_DLG_DOWNLOAD 1100
#define IDC_DOWNLOAD_LABEL 1101
#define IDC_DOWNLOAD_PROGRESS 1102
#define IDD_DLG_MAIN 1300
#define IDC_MAIN_TOOLBAR 1301
#define IDC_MAIN_URLBAR 1302
#define IDC_MAIN_THROBBER 1303
#define IDC_MAIN_DRAWINGAREA 1304
#define IDC_MAIN_STATUSBAR 1305
#define IDC_MAIN_LAUNCH_URL 1306
#define IDD_DLG_OPTIONS_GENERAL 1400
#define IDC_PREFS_HOMEPAGE 1401
#define IDC_PREFS_IMAGES 1402
#define IDC_PREFS_ADVERTS 1403
#define IDC_PREFS_REFERER 1404
#define IDD_DLG_OPTIONS_CONNECTIONS 1500
#define IDC_PREFS_FETCHERS 1501
#define IDC_PREFS_FETCHERS_SPIN 1502
#define IDC_PREFS_FETCH_HOST 1503
#define IDC_PREFS_FETCH_HOST_SPIN 1504
#define IDC_PREFS_FETCH_HANDLES 1505
#define IDC_PREFS_FETCH_HANDLES_SPIN 1506
#define IDD_DLG_OPTIONS_APPERANCE 1200
#define IDC_PREFS_PROXYTYPE 1206
#define IDC_PREFS_PROXYHOST 1207
#define IDC_PREFS_PROXYPORT 1208
#define IDC_PREFS_PROXYNAME 1209
#define IDC_PREFS_PROXYPASS 1210
#define IDC_PREFS_FONT_SIZE 1211
#define IDC_PREFS_FONT_MINSIZE 1212
#define IDC_PREFS_FONT_MINSIZE_SPIN 1213
#define IDC_PREFS_SANS 1214
#define IDC_PREFS_SERIF 1215
#define IDC_PREFS_FONT_SIZE_SPIN 1216
#define IDC_PREFS_MONO 1217
#define IDC_PREFS_CURSIVE 1218
#define IDC_PREFS_FANTASY 1219
#define IDC_PREFS_FONTDEF 1220
#define IDC_PREFS_NOANIMATION 1227
#define IDC_PREFS_ANIMATIONDELAY 1228
#define IDC_PREFS_ANIMATIONDELAY_SPIN 1229
#define IDR_MENU_MAIN 10000
#define IDM_FILE_OPEN_WINDOW 10001
#define IDM_FILE_OPEN_LOCATION 10002
#define IDM_FILE_CLOSE_WINDOW 10003
#define IDM_FILE_SAVE_PAGE 10004
#define IDM_FILE_SAVEAS_TEXT 10005
#define IDM_FILE_SAVEAS_PDF 10006
#define IDM_FILE_SAVEAS_POSTSCRIPT 10007
#define IDM_FILE_PRINT_PREVIEW 10008
#define IDM_FILE_PRINT 10009
#define IDM_FILE_QUIT 10010
#define IDM_EDIT_CUT 10011
#define IDM_EDIT_COPY 10012
#define IDM_EDIT_PASTE 10013
#define IDM_EDIT_DELETE 10014
#define IDM_EDIT_SELECT_ALL 10015
#define IDM_EDIT_SEARCH 10016
#define IDM_NAV_STOP 10017
#define IDM_NAV_RELOAD 10018
#define IDM_VIEW_ZOOMPLUS 10019
#define IDM_VIEW_ZOOMMINUS 10020
#define IDM_VIEW_ZOOMNORMAL 10021
#define IDM_VIEW_SOURCE 10022
#define IDM_VIEW_FULLSCREEN 10023
#define IDM_NAV_BACK 10024
#define IDM_NAV_FORWARD 10025
#define IDM_NAV_HOME 10026
#define IDM_NAV_LOCALHISTORY 10027
#define IDM_NAV_GLOBALHISTORY 10028
#define IDM_VIEW_DOWNLOADS 10029
#define IDM_VIEW_SAVE_WIN_METRICS 10030
#define IDM_VIEW_TOGGLE_DEBUG_RENDERING 10031
#define IDM_VIEW_DEBUGGING_SAVE_BOXTREE 10032
#define IDM_VIEW_DEBUGGING_SAVE_DOMTREE 10033
#define IDM_EDIT_PREFERENCES 10034
#define IDM_HELP_CONTENTS 10035
#define IDM_HELP_GUIDE 10036
#define IDM_HELP_INFO 10037
#define IDM_HELP_ABOUT 10038
#define IDR_MENU_CONTEXT 11000
#endif

View File

@ -1,3 +1,22 @@
/*
* Copyright 2011 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
* NetSurf is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* NetSurf is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <windows.h>
#include <stdio.h>
#include "windbg.h"
@ -610,3 +629,35 @@ const char *msg_num_to_name(int msg)
return str;
}
void win_perror(const char * lpszFunction)
{
/* Retrieve the system error message for the last-error code */
LPVOID lpMsgBuf;
LPVOID lpDisplayBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
/* Display the error message and exit the process */
lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, (lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof(TCHAR));
snprintf((LPTSTR)lpDisplayBuf,
LocalSize(lpDisplayBuf) / sizeof(TCHAR),
TEXT("%s failed with error %ld: %s"),
lpszFunction, dw, (char *)lpMsgBuf);
MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK);
LocalFree(lpMsgBuf);
LocalFree(lpDisplayBuf);
}

View File

@ -1 +1,25 @@
/*
* Copyright 2010 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
* NetSurf is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* NetSurf is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NETSURF_WINDOWS_WINDBG_H_
#define _NETSURF_WINDOWS_WINDBG_H_
const char *msg_num_to_name(int msg);
void win_perror(const char * lpszFunction);
#endif