background colour of a combobox may now be set (bug 805442)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-02-08 00:59:23 +00:00
parent d1e44484f7
commit 3a7d5f7cc3
3 changed files with 31 additions and 6 deletions

View File

@ -154,6 +154,7 @@ wxMSW:
- experimental wxURL implementation using WinInet functions (Hajo Kirchhoff)
- fixed several bugs in wxNotebook with wxNB_MULTILINE style
- accelerators are now initially hidden if appropriate (Peter Nielsen)
- background colour of a wxComboBox may now be set
wxGTK:

View File

@ -95,6 +95,8 @@ public:
// implementation only from now on
virtual bool MSWCommand(WXUINT param, WXWORD id);
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);

View File

@ -213,11 +213,12 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
}
WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message),
WXWPARAM WXUNUSED(wParam),
WXLPARAM WXUNUSED(lParam)
)
WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC,
WXHWND WXUNUSED(pWnd),
WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message),
WXWPARAM WXUNUSED(wParam),
WXLPARAM WXUNUSED(lParam))
{
HDC hdc = (HDC)pDC;
wxColour colBack = GetBackgroundColour();
@ -234,9 +235,30 @@ WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSE
}
// ----------------------------------------------------------------------------
// wxComboBox
// wxComboBox callbacks
// ----------------------------------------------------------------------------
long wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
// handle WM_CTLCOLOR messages from our EDIT control to be able to set its
// colour correctly (to be the same as our own one)
switch ( nMsg )
{
// we have to handle both: one for the normal case and the other for
// wxCB_READONLY
case WM_CTLCOLOREDIT:
case WM_CTLCOLORSTATIC:
WXWORD nCtlColor;
WXHDC hdc;
WXHWND hwnd;
UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd);
return OnCtlColor(hdc, hwnd, nCtlColor, nMsg, wParam, lParam);
}
return wxChoice::MSWWindowProc(nMsg, wParam, lParam);
}
bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
{
switch ( msg )