#endif
#include "wx/button.h"
-#include "wx/panel.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/panel.h"
+#endif
+
#include "wx/stockitem.h"
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
void wxButton::SetDefault()
{
- wxWindow *parent = GetParent();
+ wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
wxButton *btnOldDefault = NULL;
- if ( parent )
+ if ( tlw )
{
- btnOldDefault = wxDynamicCast(parent->GetDefaultItem(),
- wxButton);
- parent->SetDefaultItem(this);
+ btnOldDefault = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
+ tlw->SetDefaultItem(this);
}
Boolean inData;
{
wxSize sz = GetDefaultSize() ;
- int wBtn = m_label.Length() * 8 + 12 + 2 * kMacOSXHorizontalBorder ;
+ int wBtn = m_label.length() * 8 + 12 + 2 * kMacOSXHorizontalBorder ;
if (wBtn > sz.x) sz.x = wBtn;