bool wxWindowBase::Destroy()
{
- SendDestroyEvent();
+ // If our handle is invalid, it means that this window has never been
+ // created, either because creating it failed or, more typically, because
+ // this wxWindow object was default-constructed and its Create() method had
+ // never been called. As we didn't send wxWindowCreateEvent in this case
+ // (which is sent after successful creation), don't send the matching
+ // wxWindowDestroyEvent neither.
+ if ( GetHandle() )
+ SendDestroyEvent();
delete this;
wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this);
if ( flags & wxSEND_EVENT_POST )
- wxPostEvent(this, event);
+ wxPostEvent(GetEventHandler(), event);
else
HandleWindowEvent(event);
}
void wxWindowBase::OnInternalIdle()
{
- if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())
+ if ( wxUpdateUIEvent::CanUpdate(this) )
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
// list classes implementation
// ----------------------------------------------------------------------------
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxWindowList)
-#else // !wxUSE_STL
+#else // !wxUSE_STD_CONTAINERS
void wxWindowListNode::DeleteData()
{
delete (wxWindow *)GetData();
}
-#endif // wxUSE_STL/!wxUSE_STL
+#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
// ----------------------------------------------------------------------------
// borders
wxWindowList::compatibility_iterator i = siblings.Find(win);
wxCHECK_RET( i, wxT("MoveBefore/AfterInTabOrder(): win is not a sibling") );
- // unfortunately, when wxUSE_STL == 1 DetachNode() is not implemented so we
- // can't just move the node around
+ // unfortunately, when wxUSE_STD_CONTAINERS == 1 DetachNode() is not
+ // implemented so we can't just move the node around
wxWindow *self = (wxWindow *)this;
siblings.DeleteObject(self);
if ( move == OrderAfter )