#define XtDisplay XTDISPLAY
#endif
+#include "wx/defs.h"
+
#include "wx/button.h"
#include "wx/utils.h"
#include "wx/panel.h"
void wxButton::SetDefault()
{
wxWindow *parent = GetParent();
- wxPanel *panel = wxDynamicCast(parent, wxPanel);
- if ( panel )
- panel->SetDefaultItem(this);
+ if ( parent )
+ parent->SetDefaultItem(this);
// We initially do not set XmNdefaultShadowThickness, to have small buttons.
// Unfortunately, buttons are now mis-aligned. We try to correct this
// Because it's very hard to find wxButton in the same row,
// correction is straighforward: we set resource for all wxButton
// in this parent (but not sub panels)
- for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
+ for (wxWindowList::Node * node = parent->GetChildren().GetFirst ();
+ node; node = node->GetNext ())
{
- wxButton *item = (wxButton *) node->Data ();
- if (item->IsKindOf(CLASSINFO(wxButton)))
+ wxWindow *win = node->GetData ();
+ wxButton *item = wxDynamicCast(win, wxButton);
+ if (item)
{
bool managed = XtIsManaged((Widget) item->GetMainWidget());
if (managed)