const wxString& name)
{
wxString label(lbl);
- if (label.empty() && wxIsStockID(id))
+ if (label.empty() && wxIsStockID(id) && !(id == wxID_HELP))
label = wxGetStockLabel(id);
m_macIsUserPane = false ;
return false;
m_labelOrig = m_label = label ;
-
+
m_peer = wxWidgetImpl::CreateButton( this, parent, id, label, pos, size, style, GetExtraStyle() );
MacPostControlCreate( pos, size );
return btnOldDefault;
}
-void wxButton::Command (wxCommandEvent & event)
+void wxButton::Command (wxCommandEvent & WXUNUSED(event))
{
m_peer->PerformClick() ;
// ProcessCommand(event);
}
-bool wxButton::HandleClicked( double timestampsec )
+bool wxButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId);
event.SetEventObject(this);
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
+ // passing the text in the param doesn't seem to work, so lets do it again
SetLabel( label );
-
+
return true;
}
return m_peer->GetValue() == 1;
}
-bool wxDisclosureTriangle::HandleClicked( double timestampsec )
+bool wxDisclosureTriangle::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
// Just emit button event for now
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId);
wxSize wxDisclosureTriangle::DoGetBestSize() const
{
- return wxSize(16,16);
+ wxSize size = wxWindow::DoGetBestSize();
+
+ // under Carbon the base class GetBestSize() implementation doesn't seem to
+ // take the label into account at all, correct for it here
+#if wxOSX_USE_CARBON
+ size.x += GetTextExtent(GetLabel()).x;
+#endif // wxOSX_USE_CARBON
+
+ return size;
}