X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e75491071dbefcada61175e3eb89ce4edf335983..66b6b04535cf261b7bae7da77332835b242abd04:/src/mac/control.cpp diff --git a/src/mac/control.cpp b/src/mac/control.cpp index 220ff1e0a9..f6fa56cb91 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -18,15 +18,13 @@ #include "wx/tabctrl.h" #include "wx/spinbutt.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) -BEGIN_EVENT_TABLE(wxControl, wxWindow) +BEGIN_EVENT_TABLE(wxControl, wxControlBase) EVT_MOUSE_EVENTS( wxControl::OnMouseEvent ) EVT_CHAR( wxControl::OnKeyDown ) EVT_PAINT( wxControl::OnPaint ) END_EVENT_TABLE() -#endif #include @@ -81,6 +79,21 @@ wxControl::~wxControl() } } +bool wxControl::Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, long style, + const wxValidator& validator, + const wxString& name) +{ + bool rval = wxWindow::Create(parent, id, pos, size, style, name); + if (rval) { +#if wxUSE_VALIDATORS + SetValidator(validator); +#endif + } + return rval; +} + void wxControl::SetLabel(const wxString& title) { m_label = title ; @@ -102,7 +115,7 @@ void wxControl::SetLabel(const wxString& title) } } -wxSize wxControl::DoGetBestSize() +wxSize wxControl::DoGetBestSize() const { return wxSize(20, 20); } @@ -370,7 +383,6 @@ void wxControl::MacSuperEnabled( bool enabled ) void wxControl::MacSuperShown( bool show ) { - /* if ( m_macControl ) { if ( !show ) @@ -379,13 +391,12 @@ void wxControl::MacSuperShown( bool show ) } else { - if ( m_macShown ) + if ( m_isShown ) ::UMAShowControl( m_macControl ) ; } } wxWindow::MacSuperShown( show ) ; - */ } void wxControl::DoSetSize(int x, int y, @@ -587,6 +598,14 @@ void wxControl::OnPaint(wxPaintEvent& event) // wxWindow::OnPaint( event ) ; } } +void wxControl::OnEraseBackground(wxEraseEvent& event) +{ + // In general, you don't want to erase the background of a control, + // or you'll get a flicker. + // TODO: move this 'null' function into each control that + // might flicker. +} + void wxControl::OnKeyDown( wxKeyEvent &event ) {