]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
applied patch 432814: saving BMP in 1, 4 and 8 bpp
[wxWidgets.git] / src / common / wincmn.cpp
index 864bb24f1a507c783f3a9bafebb4a505c02eb967..f71daad3b5433762a9c07c10b78491021ecc47be 100644 (file)
@@ -268,6 +268,12 @@ wxWindowBase::~wxWindowBase()
     if ( m_tooltip )
         delete m_tooltip;
 #endif // wxUSE_TOOLTIPS
+
+    // reset the dangling pointer our parent window may keep to us
+    if ( m_parent && m_parent->GetDefaultItem() == this )
+    {
+        m_parent->SetDefaultItem(NULL);
+    }
 }
 
 bool wxWindowBase::Destroy()
@@ -1384,7 +1390,7 @@ void wxWindowBase::UpdateWindowUI()
 
         if ( event.GetSetText() )
         {
-            wxControl *control = wxDynamicThisCast(this, wxControl);
+            wxControl *control = wxDynamicCastThis(wxControl);
             if ( control )
             {
 #if wxUSE_TEXTCTRL
@@ -1398,7 +1404,7 @@ void wxWindowBase::UpdateWindowUI()
         }
 
 #if wxUSE_CHECKBOX
-        wxCheckBox *checkbox = wxDynamicThisCast(this, wxCheckBox);
+        wxCheckBox *checkbox = wxDynamicCastThis(wxCheckBox);
         if ( checkbox )
         {
             if ( event.GetSetChecked() )
@@ -1407,7 +1413,7 @@ void wxWindowBase::UpdateWindowUI()
 #endif // wxUSE_CHECKBOX
 
 #if wxUSE_RADIOBTN
-        wxRadioButton *radiobtn = wxDynamicThisCast(this, wxRadioButton);
+        wxRadioButton *radiobtn = wxDynamicCastThis(wxRadioButton);
         if ( radiobtn )
         {
             if ( event.GetSetChecked() )