// MSW only
virtual bool MSWCommand(WXUINT param, WXWORD id);
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+ virtual WXHBRUSH MSWControlColor(WXHDC hDC);
protected:
virtual void DoMoveWindow(int x, int y, int width, int height);
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-
WXHWND GetEditHWND() const;
protected:
// Windows callbacks
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-#if wxUSE_CTL3D
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-#endif // wxUSE_CTL3D
-
// obsolete methods
// ----------------
void SetRange( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s , GetPageSize() , true ) ; }
void Command(wxCommandEvent& event);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control);
virtual bool ContainsHWND(WXHWND hWnd) const;
void Command(wxCommandEvent& event);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control);
virtual bool ContainsHWND(WXHWND hWnd) const;
void Command(wxCommandEvent& event);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control);
virtual void Command(wxCommandEvent& event);
virtual bool MSWCommand(WXUINT param, WXWORD id);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+ virtual WXHBRUSH MSWControlColor(WXHDC hDC);
#if wxUSE_RICHEDIT
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
virtual void Command(wxCommandEvent& event);
virtual bool MSWCommand(WXUINT param, WXWORD id);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual void AdoptAttributesFromHWND();
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
- bool HandleCtlColor(WXHBRUSH *hBrush,
- WXHDC hdc,
- WXHWND hWnd,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam);
+ bool HandleCtlColor(WXHBRUSH *hBrush, WXHDC hdc, WXHWND hWnd);
bool HandlePaletteChanged(WXHWND hWndPalChange);
bool HandleQueryNewPalette();
// with or 0 for the default brush
virtual WXHBRUSH MSWControlColor(WXHDC hDC);
- // deprecated, for compatibility only: override MSWControlColor instead
- virtual WXHBRUSH OnCtlColor(WXHDC hDC,
- WXHWND hWnd,
- WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam);
-
// Responds to colour changes: passes event on to children.
void OnSysColourChanged(wxSysColourChangedEvent& event);
WXHWND hwnd;
UnpackCtlColor(wParam, lParam, &hdc, &hwnd);
- return (WXLRESULT)OnCtlColor(hdc, hwnd, 0,
- nMsg, wParam, lParam);
+ WXHBRUSH hbr = MSWControlColor((WXHDC)hdc);
+ if ( hbr )
+ return (WXLRESULT)hbr;
+ //else: fall through to default window proc
}
}
return true;
}
-WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
- WXUINT WXUNUSED(message),
- WXWPARAM WXUNUSED(wParam),
- WXLPARAM WXUNUSED(lParam)
- )
+WXHBRUSH wxChoice::MSWControlColor(WXHDC hDC)
{
- HDC hdc = (HDC)pDC;
- wxColour colBack = GetBackgroundColour();
+ if ( !IsEnabled() )
+ return MSWControlColorDisabled(hDC);
- if (!IsEnabled())
- colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
-
- ::SetBkColor(hdc, wxColourToRGB(colBack));
- ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
-
- wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
-
- return (WXHBRUSH)brush->GetResourceHandle();
+ return wxChoiceBase::MSWControlColorSolid(hDC);
}
#endif // wxUSE_CHOICE && !(__SMARTPHONE__ && __WXWINCE__)
+
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))
-{
- HDC hdc = (HDC)pDC;
- wxColour colBack = GetBackgroundColour();
-
- if (!IsEnabled())
- colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
-
- ::SetBkColor(hdc, wxColourToRGB(colBack));
- ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
-
- wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
-
- return (WXHBRUSH)brush->GetResourceHandle();
-}
-
// ----------------------------------------------------------------------------
// wxComboBox callbacks
// ----------------------------------------------------------------------------
// 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:
- WXHDC hdc;
- WXHWND hwnd;
- UnpackCtlColor(wParam, lParam, &hdc, &hwnd);
-
- return (WXLRESULT)OnCtlColor(hdc, hwnd, 0, nMsg, wParam, lParam);
-
case CB_SETCURSEL:
// Selection was set with SetSelection. Update the value too.
if ((int)wParam > GetCount())
else
m_value = GetString(wParam);
break;
-
}
return wxChoice::MSWWindowProc(nMsg, wParam, lParam);
return rc;
}
-#if wxUSE_CTL3D
-
-// Define for each class of dialog and control
-WXHBRUSH wxDialog::OnCtlColor(WXHDC WXUNUSED(pDC),
- WXHWND WXUNUSED(pWnd),
- WXUINT WXUNUSED(nCtlColor),
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
-{
- return (WXHBRUSH)Ctl3dCtlColorEx(message, wParam, lParam);
-}
-
-#endif // wxUSE_CTL3D
-
#endif
}
-
-WXHBRUSH wxScrollBar::OnCtlColor(WXHDC WXUNUSED(pDC), WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
- WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), WXLPARAM WXUNUSED(lParam))
-{
- return 0;
-}
-
void wxScrollBar::Command(wxCommandEvent& event)
{
SetThumbPosition(event.m_commandInt);
}
}
-WXHBRUSH wxSlider95::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
-{
-#ifndef __WXWINCE__
- if ( nCtlColor == CTLCOLOR_SCROLLBAR )
- return 0;
-#else
- if ( nCtlColor != CTLCOLOR_STATIC )
- return 0;
-#endif
- // Otherwise, it's a static
- return wxControl::OnCtlColor(pDC, pWnd, nCtlColor, message, wParam, lParam);
-}
-
// For trackbars only
void wxSlider95::SetTickFreq(int n, int pos)
{
}
}
-WXHBRUSH wxSliderMSW::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
-{
- if ( nCtlColor == CTLCOLOR_SCROLLBAR )
- return 0;
-
- // Otherwise, it's a static
- return wxControl::OnCtlColor(pDC, pWnd, nCtlColor, message, wParam, lParam);
-}
-
void wxSliderMSW::SetPageSize(int pageSize)
{
m_pageSize = pageSize;
return true;
}
-WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
-#if wxUSE_CTL3D
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam
-#else
- WXUINT WXUNUSED(message),
- WXWPARAM WXUNUSED(wParam),
- WXLPARAM WXUNUSED(lParam)
-#endif
- )
+WXHBRUSH wxTextCtrl::MSWControlColor(WXHDC hDC)
{
-#if wxUSE_CTL3D
- if ( m_useCtl3D )
- {
- HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
- return (WXHBRUSH) hbrush;
- }
-#endif // wxUSE_CTL3D
-
- HDC hdc = (HDC)pDC;
- wxColour colBack = GetBackgroundColour();
-
- if (!IsEnabled() && (GetWindowStyle() & wxTE_MULTILINE) == 0)
- colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
-
- ::SetBkColor(hdc, wxColourToRGB(colBack));
- ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
-
- wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
+ if ( !IsEnabled() && !HasFlag(wxTE_MULTILINE) )
+ return MSWControlColorDisabled(hDC);
- return (WXHBRUSH)brush->GetResourceHandle();
+ return wxTextCtrlBase::MSWControlColorSolid(hDC);
}
bool wxTextCtrl::AdjustSpaceLimit()
return true;
}
-WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
-#if wxUSE_CTL3D
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam
-#else
- WXUINT WXUNUSED(message),
- WXWPARAM WXUNUSED(wParam),
- WXLPARAM WXUNUSED(lParam)
-#endif
- )
-{
-#if wxUSE_CTL3D
- if ( m_useCtl3D )
- {
- HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
- return (WXHBRUSH) hbrush;
- }
-#endif // wxUSE_CTL3D
-
- HDC hdc = (HDC)pDC;
- wxColour colBack = GetBackgroundColour();
-
- if (!IsEnabled() && (GetWindowStyle() & wxTE_MULTILINE) == 0)
- colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
-
- ::SetBkColor(hdc, wxColourToRGB(colBack));
- ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
-
- wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
-
- return (WXHBRUSH)brush->GetResourceHandle();
-}
-
bool wxTextCtrl::AdjustSpaceLimit()
{
unsigned int limit = ::SendMessage(GetBuddyHwnd(), EM_GETLIMITTEXT, 0, 0);
WXHWND hwnd;
UnpackCtlColor(wParam, lParam, &hdc, &hwnd);
- processed = HandleCtlColor(&rc.hBrush,
- (WXHDC)hdc,
- (WXHWND)hwnd,
- message,
- wParam,
- lParam);
+ processed = HandleCtlColor(&rc.hBrush, (WXHDC)hdc, (WXHWND)hwnd);
}
break;
#endif // !__WXMICROWIN__
#ifndef __WXMICROWIN__
-bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush,
- WXHDC pDC,
- WXHWND pWnd,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
+bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC pDC, WXHWND pWnd)
{
#if wxUSE_CONTROLS
- wxControl *item = (wxControl *)FindItemByHWND(pWnd, true);
+ wxWindow *item = FindItemByHWND(pWnd, true);
if ( item )
- *brush = item->OnCtlColor(pDC, pWnd, 0, message, wParam, lParam);
+ *brush = item->MSWControlColor(pDC);
else
#endif // wxUSE_CONTROLS
*brush = NULL;
#endif // __WXMICROWIN__
-// Define for each class of dialog and control
-WXHBRUSH wxWindowMSW::OnCtlColor(WXHDC hDC,
- WXHWND WXUNUSED(hWnd),
- WXUINT WXUNUSED(nCtlColor),
- WXUINT WXUNUSED(message),
- WXWPARAM WXUNUSED(wParam),
- WXLPARAM WXUNUSED(lParam))
-{
- return MSWControlColor(hDC);
-}
-
WXHBRUSH wxWindowMSW::MSWControlColor(WXHDC WXUNUSED(hDC))
{
return (WXHBRUSH)0;