зеркало из https://github.com/mozilla/gecko-dev.git
Added the method SetUpForPaint for setting up the proper foreground
and background colors for the WM_CTLCOLORXXXX messages
This commit is contained in:
Родитель
eefb22bc87
Коммит
cea9db392f
|
@ -1318,6 +1318,13 @@ PRBool nsWindow::OnKey(PRUint32 aEventType, PRUint32 aKeyCode)
|
|||
return(DispatchEvent(&event));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::SetUpForPaint(HDC aHDC)
|
||||
{
|
||||
::SetBkColor (aHDC, NSRGB_2_COLOREF(mBackground));
|
||||
::SetTextColor(aHDC, NSRGB_2_COLOREF(mForeground));
|
||||
::SetBkMode (aHDC, TRANSPARENT);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -1488,20 +1495,17 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_CTLCOLORLISTBOX:
|
||||
case WM_CTLCOLOREDIT:
|
||||
case WM_CTLCOLORBTN:
|
||||
case WM_CTLCOLORLISTBOX:
|
||||
case WM_CTLCOLORSCROLLBAR:
|
||||
case WM_CTLCOLORSTATIC:
|
||||
if (lParam) {
|
||||
nsWindow* control = (nsWindow*)::GetWindowLong((HWND)lParam, GWL_USERDATA);
|
||||
if (control) {
|
||||
HDC hDC = (HDC)wParam;
|
||||
::SetBkColor (hDC, NSRGB_2_COLOREF(mBackground));
|
||||
::SetTextColor(hDC, NSRGB_2_COLOREF(mForeground));
|
||||
::SetBkMode (hDC, TRANSPARENT);
|
||||
control->SetUpForPaint((HDC)wParam);
|
||||
*aRetValue = (LPARAM)control->OnControlColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result = PR_TRUE;
|
||||
|
|
|
@ -115,6 +115,8 @@ public:
|
|||
virtual void BeginResizingChildren(void);
|
||||
virtual void EndResizingChildren(void);
|
||||
|
||||
virtual void SetUpForPaint(HDC aHDC);
|
||||
|
||||
// nsSwitchToUIThread interface
|
||||
virtual BOOL CallMethod(MethodInfo *info);
|
||||
|
||||
|
@ -136,7 +138,7 @@ protected:
|
|||
virtual DWORD WindowStyle();
|
||||
virtual DWORD WindowExStyle();
|
||||
|
||||
void SubclassWindow(BOOL bState);
|
||||
virtual void SubclassWindow(BOOL bState);
|
||||
|
||||
virtual void OnDestroy();
|
||||
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
|
||||
|
|
Загрузка…
Ссылка в новой задаче