]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
move wxIconArray declaration out of header, remove unneccessary copy ctor and assignm...
[wxWidgets.git] / src / common / wincmn.cpp
index a30532702bf5848f69978c412516c28165e7fbd7..c40aa1d746070b42912850d697c976a42a95738a 100644 (file)
@@ -402,7 +402,7 @@ bool wxWindowBase::Close(bool force)
 
     // return false if window wasn't closed because the application vetoed the
     // close event
-    return GetEventHandler()->ProcessEvent(event) && !event.GetVeto();
+    return HandleWindowEvent(event) && !event.GetVeto();
 }
 
 bool wxWindowBase::DestroyChildren()
@@ -841,6 +841,23 @@ void wxWindowBase::DoGetScreenPosition(int *x, int *y) const
     ClientToScreen(x, y);
 }
 
+void wxWindowBase::SendSizeEvent(int flags)
+{
+    wxSizeEvent event(GetSize(), GetId());
+    event.SetEventObject(this);
+    if ( flags & wxSEND_EVENT_POST )
+        wxPostEvent(this, event);
+    else
+        HandleWindowEvent(event);
+}
+
+void wxWindowBase::SendSizeEventToParent(int flags)
+{
+    wxWindow * const parent = GetParent();
+    if ( parent && !parent->IsBeingDeleted() )
+        parent->SendSizeEvent(flags);
+}
+
 // ----------------------------------------------------------------------------
 // show/hide/enable/disable the window
 // ----------------------------------------------------------------------------
@@ -990,7 +1007,7 @@ void wxWindowBase::AddChild(wxWindowBase *child)
     GetChildren().Append((wxWindow*)child);
     child->SetParent(this);
 
-    // adding a child while frozen will assert when thawn, so freeze it as if
+    // adding a child while frozen will assert when thawed, so freeze it as if
     // it had been already present when we were frozen
     if ( IsFrozen() && !child->IsTopLevel() )
         child->Freeze();
@@ -1002,7 +1019,10 @@ void wxWindowBase::RemoveChild(wxWindowBase *child)
 
     // removing a child while frozen may result in permanently frozen window
     // if used e.g. from Reparent(), so thaw it
-    if ( IsFrozen() && !child->IsTopLevel() )
+    //
+    // NB: IsTopLevel() doesn't return true any more when a TLW child is being
+    //     removed from its ~wxWindowBase, so check for IsBeingDeleted() too
+    if ( IsFrozen() && !child->IsBeingDeleted() && !child->IsTopLevel() )
         child->Thaw();
 
     GetChildren().DeleteObject((wxWindow *)child);
@@ -1399,7 +1419,7 @@ void wxWindowBase::ClearBackground()
     // wxGTK uses its own version, no need to add never used code
 #ifndef __WXGTK__
     wxClientDC dc((wxWindow *)this);
-    wxBrush brush(GetBackgroundColour(), wxSOLID);
+    wxBrush brush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID);
     dc.SetBackground(brush);
     dc.Clear();
 #endif // __WXGTK__
@@ -2621,7 +2641,10 @@ void wxWindowBase::ReleaseMouse()
 
     wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive ReleaseMouse call?") );
 
-    wxASSERT_MSG( GetCapture() == this, wxT("attempt to release mouse, but this window hasn't captured it") );
+    wxASSERT_MSG( GetCapture() == this,
+                  "attempt to release mouse, but this window hasn't captured it" );
+    wxASSERT_MSG( ms_winCaptureCurrent == this,
+                  "attempt to release mouse, but this window hasn't captured it" );
 
     ms_winCaptureChanging = true;