]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/toplvcmn.cpp
native wxBitmapComboBox implementation for MSW (patch 1941399)
[wxWidgets.git] / src / common / toplvcmn.cpp
index 4f34b30e4dc56c31370ebb920fa65e8c834a2099..a24634f669a69df30f016989ad568fc96c57e663 100644 (file)
@@ -124,7 +124,6 @@ bool wxTopLevelWindowBase::Destroy()
     // any more as no events will be sent to the hidden window and without idle
     // events we won't prune wxPendingDelete list and the application won't
     // terminate
-    const wxWindowList::const_iterator end = wxTopLevelWindows.end();
     for ( wxWindowList::const_iterator i = wxTopLevelWindows.begin(),
                                      end = wxTopLevelWindows.end();
           i != end;
@@ -274,8 +273,11 @@ void wxTopLevelWindowBase::DoCentre(int dir)
     if((rectParent == rectDisplay) && IsMaximized())
         return;
 
+    if ( !(dir & wxBOTH) )
+        dir |= wxBOTH; // if neither is specified, center in both directions
+
     // the new window rect candidate
-    wxRect rect = GetRect().CentreIn(rectParent, dir);
+    wxRect rect = GetRect().CentreIn(rectParent, dir & ~wxCENTRE_ON_SCREEN);
 
     // we don't want to place the window off screen if Centre() is called as
     // this is (almost?) never wanted and it would be very difficult to prevent