From 3ff632ce661365d18fba19cc17a1100fcca39bde Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 7 Nov 2003 20:52:35 +0000 Subject: [PATCH] Fixed an accidental name clash, and added back a wxCHECK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gbsizer.h | 6 +++--- src/common/gbsizer.cpp | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/wx/gbsizer.h b/include/wx/gbsizer.h index f8385b947b..b0f56150d8 100644 --- a/include/wx/gbsizer.h +++ b/include/wx/gbsizer.h @@ -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: diff --git a/src/common/gbsizer.cpp b/src/common/gbsizer.cpp index c3b2e137fb..83753c51e1 100644 --- a/src/common/gbsizer.cpp +++ b/src/common/gbsizer.cpp @@ -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 ); -- 2.45.2