mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 15:41:10 +00:00
mshtml: Added border implementation.
This commit is contained in:
parent
2a78268430
commit
396b0ad126
|
@ -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;
|
||||
WCHAR wszHTMLDisabled[100];
|
||||
HDC hdc;
|
||||
|
||||
LoadStringW(hInst, IDS_HTMLDISABLED, wszHTMLDisabled, sizeof(wszHTMLDisabled)/sizeof(WCHAR));
|
||||
GetClientRect(This->hwnd, &rect);
|
||||
|
||||
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(This->hwnd, &ps);
|
||||
|
||||
hdc = BeginPaint(hwnd, &ps);
|
||||
SelectObject(hdc, font);
|
||||
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);
|
||||
if(!(This->hostinfo.dwFlags & (DOCHOSTUIFLAG_NO3DOUTERBORDER|DOCHOSTUIFLAG_NO3DBORDER)))
|
||||
DrawEdge(hdc, &rect, EDGE_SUNKEN, BF_RECT|BF_ADJUST);
|
||||
|
||||
DeleteObject(font);
|
||||
DeleteObject(brush);
|
||||
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);
|
||||
|
||||
SelectObject(hdc, font);
|
||||
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);
|
||||
|
||||
DeleteObject(font);
|
||||
}
|
||||
|
||||
EndPaint(This->hwnd, &ps);
|
||||
}
|
||||
|
||||
static void activate_gecko(HTMLDocument *This)
|
||||
|
@ -106,14 +114,22 @@ 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),
|
||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue