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()
if ( event.GetSetText() )
{
- wxControl *control = wxDynamicThisCast(this, wxControl);
+ wxControl *control = wxDynamicCastThis(wxControl);
if ( control )
{
#if wxUSE_TEXTCTRL
}
#if wxUSE_CHECKBOX
- wxCheckBox *checkbox = wxDynamicThisCast(this, wxCheckBox);
+ wxCheckBox *checkbox = wxDynamicCastThis(wxCheckBox);
if ( checkbox )
{
if ( event.GetSetChecked() )
#endif // wxUSE_CHECKBOX
#if wxUSE_RADIOBTN
- wxRadioButton *radiobtn = wxDynamicThisCast(this, wxRadioButton);
+ wxRadioButton *radiobtn = wxDynamicCastThis(wxRadioButton);
if ( radiobtn )
{
if ( event.GetSetChecked() )