void DetachSizer()
{ m_sizer = 0; }
- virtual wxSize GetSize();
+ virtual wxSize GetSize() const;
virtual wxSize CalcMin();
virtual void SetDimension( wxPoint pos, wxSize size );
- wxSize GetMinSize()
+ wxSize GetMinSize() const
{ return m_minSize; }
void SetInitSize( int x, int y )
{ m_minSize.x = x; m_minSize.y = y; }
float GetRatio() const
{ return m_ratio; }
- bool IsWindow();
- bool IsSizer();
- bool IsSpacer();
+ bool IsWindow() const;
+ bool IsSizer() const;
+ bool IsSpacer() const;
// Deprecated in 2.6, use {G,S}etProportion instead.
wxDEPRECATED( void SetOption( int option ) );
bool IsShown() const
{ return m_show; }
- wxObject* GetUserData()
+ wxObject* GetUserData() const
{ return m_userData; }
- wxPoint GetPosition()
+ wxPoint GetPosition() const
{ return m_pos; }
protected:
wxObject *m_userData;
- DECLARE_DYNAMIC_CLASS(wxSizerItem);
+private:
+ DECLARE_CLASS(wxSizerItem);
DECLARE_NO_COPY_CLASS(wxSizerItem)
};
bool SetItemMinSize( size_t index, wxSize size )
{ return DoSetItemMinSize( index, size.x, size.y ); }
- wxSize GetSize()
+ wxSize GetSize() const
{ return m_size; }
- wxPoint GetPosition()
+ wxPoint GetPosition() const
{ return m_position; }
/* Calculate the minimal size or return m_minSize if bigger. */
void Hide( size_t index )
{ Show( index, false ); }
- bool IsShown( wxWindow *window );
- bool IsShown( wxSizer *sizer );
- bool IsShown( size_t index );
+ bool IsShown( wxWindow *window ) const;
+ bool IsShown( wxSizer *sizer ) const;
+ bool IsShown( size_t index ) const;
// Recursively call wxWindow::Show () on all sizer items.
void ShowItems (bool show);
wxPoint m_position;
wxSizerItemList m_children;
- wxSize GetMaxWindowSize( wxWindow *window );
+ wxSize GetMaxWindowSize( wxWindow *window ) const;
wxSize GetMinWindowSize( wxWindow *window );
- wxSize GetMaxClientSize( wxWindow *window );
+ wxSize GetMaxClientSize( wxWindow *window ) const;
wxSize GetMinClientSize( wxWindow *window );
wxSize FitSize( wxWindow *window );
wxSize VirtualFitSize( wxWindow *window );
virtual bool DoSetItemMinSize( wxSizer *sizer, int width, int height );
virtual bool DoSetItemMinSize( size_t index, int width, int height );
- DECLARE_DYNAMIC_CLASS(wxSizer);
+private:
+ DECLARE_CLASS(wxSizer);
};
//---------------------------------------------------------------------------
void SetRows( int rows ) { m_rows = rows; }
void SetVGap( int gap ) { m_vgap = gap; }
void SetHGap( int gap ) { m_hgap = gap; }
- int GetCols() { return m_cols; }
- int GetRows() { return m_rows; }
- int GetVGap() { return m_vgap; }
- int GetHGap() { return m_hgap; }
+ int GetCols() const { return m_cols; }
+ int GetRows() const { return m_rows; }
+ int GetVGap() const { return m_vgap; }
+ int GetHGap() const { return m_hgap; }
protected:
int m_rows;
void SetItemBounds( wxSizerItem *item, int x, int y, int w, int h );
- DECLARE_DYNAMIC_CLASS(wxGridSizer);
+private:
+ DECLARE_CLASS(wxGridSizer);
};
//---------------------------------------------------------------------------
void CreateArrays();
- DECLARE_DYNAMIC_CLASS(wxFlexGridSizer);
+private:
+ DECLARE_CLASS(wxFlexGridSizer);
DECLARE_NO_COPY_CLASS(wxFlexGridSizer)
};
void RecalcSizes();
wxSize CalcMin();
- int GetOrientation()
+ int GetOrientation() const
{ return m_orient; }
void SetOrientation(int orient)
int m_fixedWidth;
int m_fixedHeight;
- DECLARE_DYNAMIC_CLASS(wxBoxSizer);
+private:
+ DECLARE_CLASS(wxBoxSizer);
};
//---------------------------------------------------------------------------
void RecalcSizes();
wxSize CalcMin();
- wxStaticBox *GetStaticBox()
+ wxStaticBox *GetStaticBox() const
{ return m_staticBox; }
protected:
wxStaticBox *m_staticBox;
- DECLARE_DYNAMIC_CLASS(wxStaticBoxSizer);
+private:
+ DECLARE_CLASS(wxStaticBoxSizer);
DECLARE_NO_COPY_CLASS(wxStaticBoxSizer)
};
void RecalcSizes();
wxSize CalcMin();
- wxNotebook *GetNotebook()
+ wxNotebook *GetNotebook() const
{ return m_notebook; }
protected:
wxNotebook *m_notebook;
- DECLARE_DYNAMIC_CLASS(wxNotebookSizer);
+private:
+ DECLARE_CLASS(wxNotebookSizer);
DECLARE_NO_COPY_CLASS(wxNotebookSizer)
};
//---------------------------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxSizerItem, wxObject)
-IMPLEMENT_ABSTRACT_CLASS(wxSizer, wxObject)
-IMPLEMENT_ABSTRACT_CLASS(wxGridSizer, wxSizer)
-IMPLEMENT_ABSTRACT_CLASS(wxFlexGridSizer, wxGridSizer)
-IMPLEMENT_ABSTRACT_CLASS(wxBoxSizer, wxSizer)
+IMPLEMENT_CLASS(wxSizerItem, wxObject)
+IMPLEMENT_CLASS(wxSizer, wxObject)
+IMPLEMENT_CLASS(wxGridSizer, wxSizer)
+IMPLEMENT_CLASS(wxFlexGridSizer, wxGridSizer)
+IMPLEMENT_CLASS(wxBoxSizer, wxSizer)
#if wxUSE_STATBOX
-IMPLEMENT_ABSTRACT_CLASS(wxStaticBoxSizer, wxBoxSizer)
+IMPLEMENT_CLASS(wxStaticBoxSizer, wxBoxSizer)
#endif
#if wxUSE_NOTEBOOK
-IMPLEMENT_ABSTRACT_CLASS(wxNotebookSizer, wxSizer)
+IMPLEMENT_CLASS(wxNotebookSizer, wxSizer)
#endif
WX_DEFINE_EXPORTED_LIST( wxSizerItemList );
}
-wxSize wxSizerItem::GetSize()
+wxSize wxSizerItem::GetSize() const
{
wxSize ret;
if (IsSizer())
m_sizer->DeleteWindows();
}
-bool wxSizerItem::IsWindow()
+bool wxSizerItem::IsWindow() const
{
return (m_window != NULL);
}
-bool wxSizerItem::IsSizer()
+bool wxSizerItem::IsSizer() const
{
return (m_sizer != NULL);
}
-bool wxSizerItem::IsSpacer()
+bool wxSizerItem::IsSpacer() const
{
return (m_window == NULL) && (m_sizer == NULL);
}
wxCHECK_MSG( node, false, _T("Failed to find child node") );
+ wxSizerItem *item = node->GetData();
+
+ if( item->IsWindow() )
+ item->GetWindow()->SetContainingSizer( NULL );
+
return m_children.DeleteNode( node );
}
wxCHECK_MSG( node, false, _T("Failed to find child node") );
- node->GetData()->DetachSizer();
+ wxSizerItem *item = node->GetData();
+
+ if( item->IsSizer() )
+ item->DetachSizer();
+ else if( item->IsWindow() )
+ item->GetWindow()->SetContainingSizer( NULL );
return m_children.DeleteNode( node );
}
window->GetMaxHeight() );
}
-wxSize wxSizer::GetMaxWindowSize( wxWindow *window )
+wxSize wxSizer::GetMaxWindowSize( wxWindow *window ) const
{
return window->GetMaxSize();
}
return size;
}
-wxSize wxSizer::GetMaxClientSize( wxWindow *window )
+wxSize wxSizer::GetMaxClientSize( wxWindow *window ) const
{
wxSize maxSize( window->GetMaxSize() );
}
}
-bool wxSizer::IsShown( wxWindow *window )
+bool wxSizer::IsShown( wxWindow *window ) const
{
wxSizerItemList::Node *node = m_children.GetFirst();
while (node)
return false;
}
-bool wxSizer::IsShown( wxSizer *sizer )
+bool wxSizer::IsShown( wxSizer *sizer ) const
{
wxSizerItemList::Node *node = m_children.GetFirst();
while (node)
return false;
}
-bool wxSizer::IsShown( size_t index )
+bool wxSizer::IsShown( size_t index ) const
{
wxCHECK_MSG( index < m_children.GetCount(),
false,