Commit 396b0ad1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added border implementation.

parent 2a782684
...@@ -91,6 +91,8 @@ struct HTMLDocument { ...@@ -91,6 +91,8 @@ struct HTMLDocument {
HWND hwnd; HWND hwnd;
HWND tooltips_hwnd; HWND tooltips_hwnd;
DOCHOSTUIINFO hostinfo;
USERMODE usermode; USERMODE usermode;
READYSTATE readystate; READYSTATE readystate;
BOOL in_place_active; BOOL in_place_active;
......
...@@ -84,6 +84,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite ...@@ -84,6 +84,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
This->hostui = NULL; This->hostui = NULL;
} }
memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
if(!pClientSite) if(!pClientSite)
return S_OK; return S_OK;
...@@ -96,11 +98,12 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite ...@@ -96,11 +98,12 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO)); memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
hostinfo.cbSize = sizeof(DOCHOSTUIINFO); hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
hres = IDocHostUIHandler_GetHostInfo(pDocHostUIHandler, &hostinfo); hres = IDocHostUIHandler_GetHostInfo(pDocHostUIHandler, &hostinfo);
if(SUCCEEDED(hres)) if(SUCCEEDED(hres)) {
/* FIXME: use hostinfo */
TRACE("hostinfo = {%u %08x %08x %s %s}\n", TRACE("hostinfo = {%u %08x %08x %s %s}\n",
hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick, hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS)); debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
memcpy(&This->hostinfo, &hostinfo, sizeof(DOCHOSTUIINFO));
}
if(!This->has_key_path) { if(!This->has_key_path) {
hres = IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler, &key_path, 0); hres = IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler, &key_path, 0);
...@@ -693,4 +696,6 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This) ...@@ -693,4 +696,6 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This)
This->has_key_path = FALSE; This->has_key_path = FALSE;
This->container_locked = FALSE; This->container_locked = FALSE;
memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
} }
...@@ -49,29 +49,37 @@ typedef struct { ...@@ -49,29 +49,37 @@ typedef struct {
WNDPROC proc; WNDPROC proc;
} tooltip_data; } tooltip_data;
static void paint_disabled(HWND hwnd) { static void paint_document(HTMLDocument *This)
HDC hdc; {
PAINTSTRUCT ps; PAINTSTRUCT ps;
HBRUSH brush;
RECT rect; RECT rect;
HFONT font; HDC hdc;
WCHAR wszHTMLDisabled[100];
GetClientRect(This->hwnd, &rect);
hdc = BeginPaint(This->hwnd, &ps);
if(!(This->hostinfo.dwFlags & (DOCHOSTUIFLAG_NO3DOUTERBORDER|DOCHOSTUIFLAG_NO3DBORDER)))
DrawEdge(hdc, &rect, EDGE_SUNKEN, BF_RECT|BF_ADJUST);
if(!This->nscontainer) {
WCHAR wszHTMLDisabled[100];
HFONT font;
LoadStringW(hInst, IDS_HTMLDISABLED, wszHTMLDisabled, sizeof(wszHTMLDisabled)/sizeof(WCHAR)); LoadStringW(hInst, IDS_HTMLDISABLED, wszHTMLDisabled, sizeof(wszHTMLDisabled)/sizeof(WCHAR));
font = CreateFontA(25,0,0,0,400,0,0,0,ANSI_CHARSET,0,0,DEFAULT_QUALITY,DEFAULT_PITCH,NULL); font = CreateFontA(25,0,0,0,400,0,0,0,ANSI_CHARSET,0,0,DEFAULT_QUALITY,DEFAULT_PITCH,NULL);
brush = CreateSolidBrush(RGB(255,255,255));
GetClientRect(hwnd, &rect);
hdc = BeginPaint(hwnd, &ps); SelectObject(hdc, font);
SelectObject(hdc, font); SelectObject(hdc, GetSysColorBrush(COLOR_WINDOW));
SelectObject(hdc, brush);
Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom);
DrawTextW(hdc, wszHTMLDisabled,-1, &rect, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
EndPaint(hwnd, &ps);
DeleteObject(font); Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom);
DeleteObject(brush); DrawTextW(hdc, wszHTMLDisabled,-1, &rect, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
DeleteObject(font);
}
EndPaint(This->hwnd, &ps);
} }
static void activate_gecko(HTMLDocument *This) static void activate_gecko(HTMLDocument *This)
...@@ -106,14 +114,22 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ...@@ -106,14 +114,22 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
activate_gecko(This); activate_gecko(This);
break; break;
case WM_PAINT: case WM_PAINT:
if(!This->nscontainer) paint_document(This);
paint_disabled(hwnd);
break; break;
case WM_SIZE: case WM_SIZE:
TRACE("(%p)->(WM_SIZE)\n", This); TRACE("(%p)->(WM_SIZE)\n", This);
if(This->nscontainer) if(This->nscontainer) {
SetWindowPos(This->nscontainer->hwnd, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam), INT ew=0, eh=0;
SWP_NOZORDER | SWP_NOACTIVATE);
if(!(This->hostinfo.dwFlags & (DOCHOSTUIFLAG_NO3DOUTERBORDER|DOCHOSTUIFLAG_NO3DBORDER))) {
ew = GetSystemMetrics(SM_CXEDGE);
eh = GetSystemMetrics(SM_CYEDGE);
}
SetWindowPos(This->nscontainer->hwnd, NULL, ew, eh,
LOWORD(lParam) - 2*ew, HIWORD(lParam) - 2*eh,
SWP_NOZORDER | SWP_NOACTIVATE);
}
} }
return DefWindowProcW(hwnd, msg, wParam, lParam); return DefWindowProcW(hwnd, msg, wParam, lParam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment