X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e53b3d16de127872e39bf276f7e616b32f161645..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/osx/button_osx.cpp diff --git a/src/osx/button_osx.cpp b/src/osx/button_osx.cpp index 239ded9d35..a33ef30012 100644 --- a/src/osx/button_osx.cpp +++ b/src/osx/button_osx.cpp @@ -72,7 +72,7 @@ void wxButton::Command (wxCommandEvent & event) // ProcessCommand(event); } -bool wxButton::HandleClicked( double timestampsec ) +bool wxButton::OSXHandleClicked( double timestampsec ) { wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId); event.SetEventObject(this); @@ -92,22 +92,7 @@ bool wxDisclosureTriangle::Create(wxWindow *parent, wxWindowID id, const wxStrin if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) return false; -#if wxOSX_USE_CARBON - Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - m_peer = new wxMacControl(this) ; - - OSStatus err = CreateDisclosureTriangleControl( - MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds, - kControlDisclosureTrianglePointDefault, - wxCFStringRef( label ), - 0, // closed - TRUE, // draw title - TRUE, // auto toggle back and forth - m_peer->GetControlRefAddr() ); - - verify_noerr( err ); -#endif - wxASSERT_MSG( m_peer != NULL && m_peer->IsOk() , wxT("No valid Mac control") ) ; + m_peer = wxWidgetImpl::CreateDisclosureTriangle(this, parent, id, label, pos, size, style, GetExtraStyle() ); MacPostControlCreate( pos, size ); // passing the text in the param doesn't seem to work, so lets do if again @@ -118,19 +103,15 @@ bool wxDisclosureTriangle::Create(wxWindow *parent, wxWindowID id, const wxStrin void wxDisclosureTriangle::SetOpen( bool open ) { -#if wxOSX_USE_CARBON m_peer->SetValue( open ? 1 : 0 ); -#endif } bool wxDisclosureTriangle::IsOpen() const { -#if wxOSX_USE_CARBON return m_peer->GetValue() == 1; -#endif } -bool wxDisclosureTriangle::HandleClicked( double timestampsec ) +bool wxDisclosureTriangle::OSXHandleClicked( double timestampsec ) { // Just emit button event for now wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId);