]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/window.h
added wrapper for <commctrl.h> as well
[wxWidgets.git] / include / wx / window.h
index 2270ca10c3443deae9be1ecee30350358a5c4093..d61eac27d8ac376c922a2448adcf1ceea182a481 100644 (file)
@@ -219,6 +219,8 @@ public:
         return wxPoint(w, h);
     }
 
+       void SetPosition( const wxPoint& pt ) { Move( pt ) ; }
+
     void GetSize( int *w, int *h ) const { DoGetSize(w, h); }
     wxSize GetSize() const
     {
@@ -831,7 +833,17 @@ public:
     wxSizer *GetSizer() const { return m_windowSizer; }
 
     // Track if this window is a member of a sizer
-    void SetContainingSizer(wxSizer* sizer) { m_containingSizer = sizer; }
+    void SetContainingSizer(wxSizer* sizer)
+    {
+        // adding a window to a sizer twice is going to result in fatal and
+        // hard to debug problems later because when deleting the second
+        // associated wxSizerItem we're going to dereference a dangling
+        // pointer; so try to detect this as early as possible
+        wxASSERT_MSG( !sizer || m_containingSizer != sizer,
+                        _T("Adding a window to the same sizer twice?") );
+
+        m_containingSizer = sizer;
+    }
     wxSizer *GetContainingSizer() const { return m_containingSizer; }
 
     // accessibility