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 {
HWND hwnd;
HWND tooltips_hwnd;
DOCHOSTUIINFO hostinfo;
USERMODE usermode;
READYSTATE readystate;
BOOL in_place_active;
......
......@@ -84,6 +84,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
This->hostui = NULL;
}
memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
if(!pClientSite)
return S_OK;
......@@ -96,11 +98,12 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
hres = IDocHostUIHandler_GetHostInfo(pDocHostUIHandler, &hostinfo);
if(SUCCEEDED(hres))
/* FIXME: use hostinfo */
if(SUCCEEDED(hres)) {
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
memcpy(&This->hostinfo, &hostinfo, sizeof(DOCHOSTUIINFO));
}
if(!This->has_key_path) {
hres = IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler, &key_path, 0);
......@@ -693,4 +696,6 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This)
This->has_key_path = FALSE;
This->container_locked = FALSE;
memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
}
......@@ -49,29 +49,37 @@ typedef struct {
WNDPROC proc;
} tooltip_data;
static void paint_disabled(HWND hwnd) {
HDC hdc;
static void paint_document(HTMLDocument *This)
{
PAINTSTRUCT ps;
HBRUSH brush;
RECT rect;
HFONT font;
HDC hdc;
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));
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, brush);
SelectObject(hdc, GetSysColorBrush(COLOR_WINDOW));
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);
DeleteObject(brush);
}
EndPaint(This->hwnd, &ps);
}
static void activate_gecko(HTMLDocument *This)
......@@ -106,15 +114,23 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
activate_gecko(This);
break;
case WM_PAINT:
if(!This->nscontainer)
paint_disabled(hwnd);
paint_document(This);
break;
case WM_SIZE:
TRACE("(%p)->(WM_SIZE)\n", This);
if(This->nscontainer)
SetWindowPos(This->nscontainer->hwnd, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam),
if(This->nscontainer) {
INT ew=0, eh=0;
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);
}
......
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