mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
toolbars to control web browser
svn path=/trunk/; revision=8085
This commit is contained in:
parent
77d84e17ca
commit
97ea59d7c9
4 changed files with 81 additions and 24 deletions
|
@ -127,7 +127,12 @@
|
|||
#define ID_DRIVE_FIRST 0x9006
|
||||
#define ID_ABOUT_WINDOWS 40002
|
||||
#define ID_ABOUT_EXPLORER 40003
|
||||
#define ID_DESKTOPBAR_SETTINGS 40005
|
||||
#define ID_DESKTOPBAR_SETTINGS 40004
|
||||
#define ID_BROWSE_BACK 40005
|
||||
#define ID_BROWSE_FORWARD 40006
|
||||
#define ID_BROWSE_HOME 40007
|
||||
#define ID_BROWSE_SEARCH 40008
|
||||
#define ID_STOP 40009
|
||||
#define ID_WINDOW_NEW 0xE130
|
||||
#define ID_WINDOW_ARRANGE 0xE131
|
||||
#define ID_WINDOW_CASCADE 0xE132
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 958 B After Width: | Height: | Size: 1.6 KiB |
|
@ -73,7 +73,15 @@ MainFrame::MainFrame(HWND hwnd)
|
|||
/*TODO
|
||||
{4, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
|
||||
{5, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
|
||||
*/ };
|
||||
*/
|
||||
{0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
|
||||
{7, ID_BROWSE_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
|
||||
{8, ID_BROWSE_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
|
||||
{9, ID_BROWSE_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
|
||||
{10, ID_BROWSE_SEARCH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
|
||||
{11, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
|
||||
{12, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
|
||||
};
|
||||
|
||||
_htoolbar = CreateToolbarEx(hwnd, WS_CHILD|WS_VISIBLE,
|
||||
IDW_TOOLBAR, 2, g_Globals._hInstance, IDB_TOOLBAR, toolbarBtns,
|
||||
|
@ -130,7 +138,7 @@ MainFrame::MainFrame(HWND hwnd)
|
|||
}
|
||||
|
||||
// insert Registry button
|
||||
SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Registry\0"));
|
||||
SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Reg.\0"));
|
||||
|
||||
drivebarBtn.idCommand = ID_DRIVE_REGISTRY;
|
||||
SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
|
||||
|
@ -634,12 +642,6 @@ int MainFrame::Command(int id, int code)
|
|||
break;
|
||||
|
||||
default:
|
||||
/*@todo if (wParam >= PM_FIRST_LANGUAGE && wParam <= PM_LAST_LANGUAGE)
|
||||
STRING_SelectLanguageByNumber(wParam - PM_FIRST_LANGUAGE);
|
||||
else */if ((id<IDW_FIRST_CHILD || id>=IDW_FIRST_CHILD+0x100) &&
|
||||
(id<SC_SIZE || id>SC_RESTORE))
|
||||
MessageBox(_hwnd, TEXT("Not yet implemented"), ResString(IDS_TITLE), MB_OK);
|
||||
|
||||
#ifndef _NO_MDI
|
||||
return DefFrameProc(_hwnd, _hmdiclient, WM_COMMAND, MAKELONG(id,code), 0);
|
||||
#else
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include "../utility/utility.h"
|
||||
#include "../explorer.h"
|
||||
|
||||
#include "../explorer_intres.h"
|
||||
|
||||
#include "webchild.h"
|
||||
|
||||
//#include <mshtml.h>
|
||||
|
@ -223,7 +225,9 @@ WebChildWindow::~WebChildWindow()
|
|||
|
||||
LRESULT WebChildWindow::WndProc(UINT message, WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
if (message == WM_ERASEBKGND) {
|
||||
try {
|
||||
switch(message) {
|
||||
case WM_ERASEBKGND:
|
||||
if (!_control) {
|
||||
HDC hdc = (HDC)wparam;
|
||||
ClientRect rect(_hwnd);
|
||||
|
@ -237,6 +241,52 @@ LRESULT WebChildWindow::WndProc(UINT message, WPARAM wparam, LPARAM lparam)
|
|||
}
|
||||
|
||||
return TRUE;
|
||||
} else
|
||||
|
||||
case PM_DISPATCH_COMMAND: {
|
||||
if (_control) {
|
||||
HRESULT hr = E_FAIL;
|
||||
|
||||
switch(LOWORD(wparam)) {
|
||||
case ID_BROWSE_BACK:
|
||||
hr = _control->GoBack();
|
||||
break;
|
||||
|
||||
case ID_BROWSE_FORWARD:
|
||||
hr = _control->GoForward();
|
||||
break;
|
||||
|
||||
case ID_BROWSE_HOME:
|
||||
hr = _control->GoHome();
|
||||
break;
|
||||
|
||||
case ID_BROWSE_SEARCH:
|
||||
hr = _control->GoSearch();
|
||||
break;
|
||||
|
||||
case ID_REFRESH:
|
||||
hr = _control->Refresh();
|
||||
break;
|
||||
|
||||
case ID_STOP:
|
||||
hr = _control->Stop();
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (FAILED(hr) && hr!=E_FAIL)
|
||||
THROW_EXCEPTION(hr);
|
||||
}
|
||||
|
||||
return TRUE;}
|
||||
|
||||
default:
|
||||
return super::WndProc(message, wparam, lparam);
|
||||
}
|
||||
} catch(COMException& e) {
|
||||
HandleException(e, _hwnd);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue