const wxArrayLong& GetSubcontrols() const { return m_subControls; }
- void OnEraseBackground(wxEraseEvent& event);
-
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxControl)
- DECLARE_EVENT_TABLE()
};
#endif // _WX_CONTROL_H_
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
-BEGIN_EVENT_TABLE(wxControl, wxWindow)
- EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
-END_EVENT_TABLE()
-
// ============================================================================
// wxControl implementation
// ============================================================================
}
#endif // Win95
-void wxControl::OnEraseBackground(wxEraseEvent& event)
-{
- // notice that this 'dumb' implementation may cause flicker for some of the
- // controls in which case they should intercept wxEraseEvent and process it
- // themselves somehow
-
- RECT rect;
- ::GetClientRect(GetHwnd(), &rect);
-
- HBRUSH hBrush = ::CreateSolidBrush(wxColourToRGB(GetBackgroundColour()));
-
- HDC hdc = GetHdcOf((*event.GetDC()));
-
-#ifndef __WXWINCE__
- int mode = ::SetMapMode(hdc, MM_TEXT);
-#endif
-
- ::FillRect(hdc, &rect, hBrush);
- ::DeleteObject(hBrush);
-
-#ifndef __WXWINCE__
- ::SetMapMode(hdc, mode);
-#endif
-}
-
WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
#if wxUSE_CTL3D
WXUINT message,