]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed an accidental name clash, and added back a wxCHECK
authorRobin Dunn <robin@alldunn.com>
Fri, 7 Nov 2003 20:52:35 +0000 (20:52 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 7 Nov 2003 20:52:35 +0000 (20:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gbsizer.h
src/common/gbsizer.cpp

index f8385b947b4e1443e67509bf5711d0d8c274d1b1..b0f56150d82ee49c631235cc341b9db88f181499 100644 (file)
@@ -148,14 +148,14 @@ public:
     void GetEndPos(int& row, int& col);
 
     
-    wxGridBagSizer* GetSizer() const { return m_sizer; }
-    void SetSizer(wxGridBagSizer* sizer) { m_sizer = sizer; }
+    wxGridBagSizer* GetGBSizer() const { return m_gbsizer; }
+    void SetGBSizer(wxGridBagSizer* sizer) { m_gbsizer = sizer; }
     
     
 protected:
     wxGBPosition    m_pos;
     wxGBSpan        m_span;
-    wxGridBagSizer* m_sizer;
+    wxGridBagSizer* m_gbsizer;  // so SetPos/SetSpan can check for intersects
 
     
 private:    
index c3b2e137fbe34ee3b8171c0cec37ed3d014faac1..83753c51e13f580487c0f07bd2dabfbab607a852 100644 (file)
@@ -46,7 +46,7 @@ wxGBSizerItem::wxGBSizerItem( int width,
     : wxSizerItem(width, height, 0, flag, border, userData),
       m_pos(pos),
       m_span(span),
-      m_sizer(NULL)
+      m_gbsizer(NULL)
 {
 }
 
@@ -60,7 +60,7 @@ wxGBSizerItem::wxGBSizerItem( wxWindow *window,
     : wxSizerItem(window, 0, flag, border, userData),
       m_pos(pos),
       m_span(span),
-      m_sizer(NULL)
+      m_gbsizer(NULL)
 {
 }
 
@@ -74,7 +74,7 @@ wxGBSizerItem::wxGBSizerItem( wxSizer *sizer,
     : wxSizerItem(sizer, 0, flag, border, userData),
       m_pos(pos),
       m_span(span),
-      m_sizer(NULL)
+      m_gbsizer(NULL)
 {
 }
 
@@ -82,7 +82,7 @@ wxGBSizerItem::wxGBSizerItem()
     : wxSizerItem(),
       m_pos(-1,-1),
       m_span(-1,-1),
-      m_sizer(NULL)
+      m_gbsizer(NULL)
 {
 }
 
@@ -104,9 +104,9 @@ void wxGBSizerItem::GetSpan(int& rowspan, int& colspan) const
 
 bool wxGBSizerItem::SetPos( const wxGBPosition& pos )
 {
-    if (m_sizer)
+    if (m_gbsizer)
     {
-        wxCHECK_MSG( !m_sizer->CheckForIntersection(pos, m_span, this), false,
+        wxCHECK_MSG( !m_gbsizer->CheckForIntersection(pos, m_span, this), false,
                  wxT("An item is already at that position") );
     }
     m_pos = pos;
@@ -115,9 +115,9 @@ bool wxGBSizerItem::SetPos( const wxGBPosition& pos )
 
 bool wxGBSizerItem::SetSpan( const wxGBSpan& span )
 {
-    if (m_sizer)
+    if (m_gbsizer)
     {
-        wxCHECK_MSG( !m_sizer->CheckForIntersection(m_pos, span, this), false,
+        wxCHECK_MSG( !m_gbsizer->CheckForIntersection(m_pos, span, this), false,
                  wxT("An item is already at that position") );
     }
     m_span = span;
@@ -226,8 +226,10 @@ bool wxGridBagSizer::Add( int width, int height,
 
 bool wxGridBagSizer::Add( wxGBSizerItem *item )
 {
-        m_children.Append(item);
-    item->SetSizer(this);
+    wxCHECK_MSG( !CheckForIntersection(item), false,
+                 wxT("An item is already at that position") );
+    m_children.Append(item);
+    item->SetGBSizer(this);
     if ( item->GetWindow() )
         item->GetWindow()->SetContainingSizer( this );