]> git.saurik.com Git - wxWidgets.git/commitdiff
moved assert for parent window not being a static box to common code where it should...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 10 Jan 2003 17:19:57 +0000 (17:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 10 Jan 2003 17:19:57 +0000 (17:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp
src/msw/window.cpp

index ea559005e6be24f69da10abcd87975642900abfd..f894eed0732ab7ed90421b6b7895f1a8d40302c8 100644 (file)
@@ -38,6 +38,7 @@
     #include "wx/control.h"
     #include "wx/checkbox.h"
     #include "wx/radiobut.h"
+    #include "wx/statbox.h"
     #include "wx/textctrl.h"
     #include "wx/settings.h"
     #include "wx/dialog.h"
@@ -203,6 +204,17 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
     // when a new ctor is added which doesn't call InitWindow)
     wxASSERT_MSG( m_isWindow, wxT("Init() must have been called before!") );
 
+#if wxUSE_STATBOX
+    // wxGTK doesn't allow to create controls with static box as the parent so
+    // this will result in a crash when the program is ported to wxGTK so warn
+    // the user about it
+
+    // if you get this assert, the correct solution is to create the controls
+    // as siblings of the static box
+    wxASSERT_MSG( !parent || !wxDynamicCast(parent, wxStaticBox),
+                  _T("wxStaticBox can't be used as a window parent!") );
+#endif // wxUSE_STATBOX
+
     // generate a new id if the user doesn't care about it
     m_windowId = id == -1 ? NewControlId() : id;
 
index 35603d9a011164bc129fc821b8b6e3ac96a4b593..b9765d4ab057b4b5d57e6cc9a4866dc478eda3ea 100644 (file)
@@ -394,17 +394,6 @@ bool wxWindowMSW::Create(wxWindow *parent,
 {
     wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") );
 
-#if wxUSE_STATBOX
-    // wxGTK doesn't allow to create controls with static box as the parent so
-    // this will result in a crash when the program is ported to wxGTK - warn
-    // about it
-    //
-    // the correct solution is to create the controls as siblings of the
-    // static box
-    wxASSERT_MSG( !wxDynamicCast(parent, wxStaticBox),
-                  _T("wxStaticBox can't be used as a window parent!") );
-#endif // wxUSE_STATBOX
-
     if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
         return FALSE;