]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
implemented EVT_LIST_CACHE_HINT support: send this message from OnPaint() now
[wxWidgets.git] / src / msw / window.cpp
index 5b07081f99cfaedefa4c32f5444a4340cbef3ca0..e64c745c2d009a6a19946f53d7e64be28d56dda3 100644 (file)
@@ -47,8 +47,7 @@
     #include "wx/button.h"
     #include "wx/msgdlg.h"
     #include "wx/settings.h"
-
-    #include <stdio.h>
+    #include "wx/statbox.h"
 #endif
 
 #if wxUSE_OWNER_DRAWN
@@ -194,7 +193,7 @@ END_EVENT_TABLE()
 wxWindow *wxWindowMSW::FindItem(long id) const
 {
 #if wxUSE_CONTROLS
-    wxControl *item = wxDynamicThisCast(this, wxControl);
+    wxControl *item = wxDynamicCastThis(wxControl);
     if ( item )
     {
         // is it we or one of our "internal" children?
@@ -354,6 +353,17 @@ 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( !wxDynamicCastThis(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;
 
@@ -1777,7 +1787,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
 #if wxUSE_BUTTON
                         else
                         {
-                            wxPanel *panel = wxDynamicThisCast(this, wxPanel);
+                            wxPanel *panel = wxDynamicCastThis(wxPanel);
                             wxButton *btn = NULL;
                             if ( panel )
                             {