]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/control.cpp
Replaced 'erase' with $(RM) so that the default file deletion program can be overriden
[wxWidgets.git] / src / motif / control.cpp
index c31dec797f2882be426cad8e3cfd2a38e39e2849..6413b921032581ae73b298930b3361a8414707db 100644 (file)
@@ -13,6 +13,8 @@
 #pragma implementation "control.h"
 #endif
 
+#include "wx/defs.h"
+
 #include "wx/control.h"
 #include "wx/panel.h"
 #include "wx/utils.h"
@@ -64,12 +66,8 @@ wxControl::~wxControl()
 {
     // If we delete an item, we should initialize the parent panel,
     // because it could now be invalid.
-    wxPanel *panel = wxDynamicCast(GetParent(), wxPanel);
-    if (panel)
-    {
-        if ( (wxControl *)panel->GetDefaultItem() == this)
-            panel->SetDefaultItem((wxButton*) NULL);
-    }
+    if ( GetParent()->panel->GetDefaultItem() == this)
+        panel->SetDefaultItem(NULL);
 }
 
 void wxControl::SetLabel(const wxString& label)