X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/670f9935630beb2123a5ca62894ae92a3f0efa4f..defeae282fad5fa8887d05d2f27cd8a4668491a5:/src/mac/classic/control.cpp diff --git a/src/mac/classic/control.cpp b/src/mac/classic/control.cpp index 8f7ee77cfb..d5c0ca1880 100644 --- a/src/mac/classic/control.cpp +++ b/src/mac/classic/control.cpp @@ -19,21 +19,21 @@ #ifndef WX_PRECOMP #include "wx/app.h" + #include "wx/panel.h" + #include "wx/dc.h" + #include "wx/dcclient.h" + #include "wx/button.h" + #include "wx/dialog.h" + #include "wx/scrolbar.h" + #include "wx/stattext.h" + #include "wx/statbox.h" + #include "wx/radiobox.h" + #include "wx/sizer.h" #endif // WX_PRECOMP -#include "wx/panel.h" -#include "wx/dc.h" -#include "wx/dcclient.h" #include "wx/notebook.h" #include "wx/tabctrl.h" -#include "wx/radiobox.h" #include "wx/spinbutt.h" -#include "wx/scrolbar.h" -#include "wx/button.h" -#include "wx/dialog.h" -#include "wx/statbox.h" -#include "wx/sizer.h" -#include "wx/stattext.h" IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) @@ -190,11 +190,11 @@ wxControl::~wxControl() wxRemoveMacControlAssociation( this ) ; // If we delete an item, we should initialize the parent panel, // because it could now be invalid. - wxWindow *parent = GetParent() ; - if ( parent ) + wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); + if ( tlw ) { - if (parent->GetDefaultItem() == (wxButton*) this) - parent->SetDefaultItem(NULL); + if ( tlw->GetDefaultItem() == (wxButton*) this) + tlw->SetDefaultItem(NULL); } if ( (ControlHandle) m_macControl ) { @@ -207,7 +207,7 @@ wxControl::~wxControl() void wxControl::SetLabel(const wxString& title) { - m_label = wxStripMenuCodes(title) ; + m_label = GetLabelText(title) ; if ( m_macControl ) { @@ -309,7 +309,7 @@ void wxControl::MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString l ((Rect*)outBounds)->bottom = 0; ((Rect*)outBounds)->right = 0; - wxMacStringToPascal( wxStripMenuCodes(label) , maclabel ) ; + wxMacStringToPascal( GetLabelText(label) , maclabel ) ; } void wxControl::MacPostControlCreate() @@ -398,7 +398,7 @@ void wxControl::MacPostControlCreate() SetSize(pos.x, pos.y, new_size.x, new_size.y); #if wxUSE_UNICODE - UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ; + UMASetControlTitle( (ControlHandle) m_macControl , GetLabelText(m_label) , m_font.GetEncoding() ) ; #endif if ( m_macControlIsShown )