]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
moved OLE files group under MSW files -- this is more logical
[wxWidgets.git] / src / common / wincmn.cpp
index 7c40f7ce74a588e0f59a350989752f85a5cdfa3e..aa805541dab4eed34953bd7f7e5afa5a6d20c4d7 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;
 
@@ -274,7 +286,7 @@ wxWindowBase::~wxWindowBase()
 #endif // wxUSE_CONSTRAINTS
 
     if ( m_containingSizer )
-        m_containingSizer->Remove((wxWindow*)this);
+        m_containingSizer->Detach( (wxWindow*)this );
 
     if ( m_windowSizer )
         delete m_windowSizer;
@@ -1165,7 +1177,9 @@ bool wxWindowBase::TransferDataToWindow()
         if ( validator && !validator->TransferToWindow() )
         {
             wxLogWarning(_("Could not transfer data to window"));
+#if wxUSE_LOG
             wxLog::FlushActive();
+#endif // wxUSE_LOG
 
             return FALSE;
         }
@@ -1872,27 +1886,27 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
 
         switch ( wxGetOsVersion() )
         {
-            case wxMOTIF_X:     port = _T("Motif"); break;
+            case wxMOTIF_X:     port += _T("Motif"); break;
             case wxMAC:
-            case wxMAC_DARWIN:  port = _T("Mac"); break;
-            case wxBEOS:        port = _T("BeOS"); break;
+            case wxMAC_DARWIN:  port += _T("Mac"); break;
+            case wxBEOS:        port += _T("BeOS"); break;
             case wxGTK:
             case wxGTK_WIN32:
             case wxGTK_OS2:
-            case wxGTK_BEOS:    port = _T("GTK"); break;
+            case wxGTK_BEOS:    port += _T("GTK"); break;
             case wxWINDOWS:
             case wxPENWINDOWS:
             case wxWINDOWS_NT:
             case wxWIN32S:
             case wxWIN95:
-            case wxWIN386:      port = _T("MS Windows"); break;
+            case wxWIN386:      port += _T("MS Windows"); break;
             case wxMGL_UNIX:
             case wxMGL_X:
             case wxMGL_WIN32:
-            case wxMGL_OS2:     port = _T("MGL"); break;
+            case wxMGL_OS2:     port += _T("MGL"); break;
             case wxWINDOWS_OS2:
-            case wxOS2_PM:      port = _T("OS/2"); break;
-            default:            port = _T("unknown"); break;
+            case wxOS2_PM:      port += _T("OS/2"); break;
+            default:            port += _T("unknown"); break;
         }
 
         wxMessageBox(wxString::Format(