]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
Add wxIsascii() function and use it instead of isascii() in our code.
[wxWidgets.git] / src / common / wincmn.cpp
index 8cbef7716845ecb2b9e33df9d4724c2af7670ba3..6b8a69a150d0457533734497bd6f51a86033d388 100644 (file)
@@ -243,7 +243,9 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
     // size, this worked like this in wxWidgets 2.8 and before and generally
     // often makes sense for child windows (for top level ones it definitely
     // does not as the user should be able to resize the window)
-    if ( !wxTopLevelWindows.Find(this) ) // can't use IsTopLevel() from ctor
+    //
+    // note that we can't use IsTopLevel() from ctor
+    if ( size != wxDefaultSize && !wxTopLevelWindows.Find((wxWindow *)this) )
         SetMinSize(size);
 
     SetName(name);
@@ -320,6 +322,12 @@ wxWindowBase::~wxWindowBase()
     // we weren't a dialog class
     wxTopLevelWindows.DeleteObject((wxWindow*)this);
 
+    // Any additional event handlers should be popped before the window is
+    // deleted as otherwise the last handler will be left with a dangling
+    // pointer to this window result in a difficult to diagnose crash later on.
+    wxASSERT_MSG( GetEventHandler() == this,
+                    wxT("any pushed event handlers must have been removed") );
+
 #if wxUSE_MENUS
     // The associated popup menu can still be alive, disassociate from it in
     // this case
@@ -1357,7 +1365,7 @@ wxColour wxWindowBase::GetBackgroundColour() const
         wxColour colBg = GetDefaultAttributes().colBg;
 
         // we must return some valid colour to avoid redoing this every time
-        // and also to avoid surprizing the applications written for older
+        // and also to avoid surprising the applications written for older
         // wxWidgets versions where GetBackgroundColour() always returned
         // something -- so give them something even if it doesn't make sense
         // for this window (e.g. it has a themed background)