2. blind fix for Motif compilation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11377
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
// simulates the event, returns TRUE if the event was processed
virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
// simulates the event, returns TRUE if the event was processed
virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
if ( m_tooltip )
delete m_tooltip;
#endif // wxUSE_TOOLTIPS
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()
}
bool wxWindowBase::Destroy()
void wxButton::SetDefault()
{
wxWindow *parent = GetParent();
void wxButton::SetDefault()
{
wxWindow *parent = GetParent();
- wxPanel *panel = wxDynamicCast(parent, wxPanel);
- if ( panel )
panel->SetDefaultItem(this);
// We initially do not set XmNdefaultShadowThickness, to have small buttons.
panel->SetDefaultItem(this);
// We initially do not set XmNdefaultShadowThickness, to have small buttons.
-wxControl::~wxControl()
-{
- // If we delete an item, we should initialize the parent panel,
- // because it could now be invalid.
- if ( GetParent()->panel->GetDefaultItem() == this)
- panel->SetDefaultItem(NULL);
-}
-
void wxControl::SetLabel(const wxString& label)
{
Widget widget = (Widget) GetLabelWidget() ;
void wxControl::SetLabel(const wxString& label)
{
Widget widget = (Widget) GetLabelWidget() ;