]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/window.h
collection macro also for XTI_TEMPLATE_FIX
[wxWidgets.git] / include / wx / window.h
index 2270ca10c3443deae9be1ecee30350358a5c4093..c506460376086556647e90e782033fd5cd3d1478 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef _WX_WINDOW_H_BASE_
 #define _WX_WINDOW_H_BASE_
 
-#if defined(__GNUG__) && !defined(__APPLE__)
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma interface "windowbase.h"
 #endif
 
@@ -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
     {
@@ -581,8 +583,8 @@ public:
         // repaint all invalid areas of the window immediately
     virtual void Update() { }
 
-        // clear the window entirely
-    virtual void Clear() = 0;
+        // clear the window background
+    virtual void ClearBackground();
 
         // freeze the window: don't redraw it until it is thawed
     virtual void Freeze() { }
@@ -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