make background colour apply to choice/combobox dropdown listbox as well as the main part (patch 1023669)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-09-10 20:36:50 +00:00
parent 1a0f14e16a
commit f499e61407
2 changed files with 30 additions and 10 deletions

View File

@@ -269,6 +269,7 @@ wxMSW:
- fixed wxTextCtrl::SetMaxLength for rich edit controls
- fixed flat style for toolbars under XP, Windows Classic style
- fixed truncation of transferred data in wxConnection under unicode build
- wxChoice and wxComboBox dropdown background can be set now too (Adrian Lupei)
wxUniv/X11:

View File

@@ -539,18 +539,37 @@ wxSize wxChoice::DoGetBestSize() const
WXLRESULT wxChoice::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
if ( nMsg == WM_LBUTTONUP )
switch ( nMsg )
{
int x = (int)LOWORD(lParam);
int y = (int)HIWORD(lParam);
case WM_LBUTTONUP:
{
int x = (int)LOWORD(lParam);
int y = (int)HIWORD(lParam);
// Ok, this is truly weird, but if a panel with a wxChoice loses the
// focus, then you get a *fake* WM_LBUTTONUP message with x = 65535 and
// y = 65535. Filter out this nonsense.
//
// VZ: I'd like to know how to reproduce this please...
if ( x == 65535 && y == 65535 )
return 0;
// Ok, this is truly weird, but if a panel with a wxChoice
// loses the focus, then you get a *fake* WM_LBUTTONUP message
// with x = 65535 and y = 65535. Filter out this nonsense.
//
// VZ: I'd like to know how to reproduce this please...
if ( x == 65535 && y == 65535 )
return 0;
}
break;
// we have to handle both: one for the normal case and the other
// for readonly
case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX:
case WM_CTLCOLORSTATIC:
{
WXWORD nCtlColor;
WXHDC hdc;
WXHWND hwnd;
UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd);
return (WXLRESULT)OnCtlColor(hdc, hwnd, nCtlColor,
nMsg, wParam, lParam);
}
}
return wxWindow::MSWWindowProc(nMsg, wParam, lParam);