variable any more (the compiler might warn you about this)
- wxListItem::m_data is now of type wxUIntPtr, not long, for compatibility
with 64 bit systems
+- wxSizer::Add/Insert returns pointer to wxSizerItem just added so conditions
+ writeen with if(Add(..)==true) will not work. Use if(Add(..)) instead.
DEPRECATED METHODS SINCE 2.4.x
- recursive wxSizer::GetItem returns item of given window, sizer or nth index
- wxLayoutConstraints now use best size, not current size, for AsIs() condition
+- wxSizer::Add/Insert etc. now returns pointer to wxSizerItem just added and this
+ item remembers its wxRect area (Brian A. Vanderburg II)
Unix:
\membersection{wxGridBagSizer::Add}\label{wxgridbagsizeradd}
-\func{bool}{Add}{\param{wxWindow* }{window}, \param{const wxGBPosition\& }{pos}, \param{const wxGBSpan\& }{span = wxDefaultSpan}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Add}{\param{wxWindow* }{window}, \param{const wxGBPosition\& }{pos}, \param{const wxGBSpan\& }{span = wxDefaultSpan}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{bool}{Add}{\param{wxSizer* }{sizer}, \param{const wxGBPosition\& }{pos}, \param{const wxGBSpan\& }{span = wxDefaultSpan}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Add}{\param{wxSizer* }{sizer}, \param{const wxGBPosition\& }{pos}, \param{const wxGBSpan\& }{span = wxDefaultSpan}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{bool}{Add}{\param{int }{width}, \param{int }{height}, \param{const wxGBPosition\& }{pos}, \param{const wxGBSpan\& }{span = wxDefaultSpan}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Add}{\param{int }{width}, \param{int }{height}, \param{const wxGBPosition\& }{pos}, \param{const wxGBSpan\& }{span = wxDefaultSpan}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{bool}{Add}{\param{wxGBSizerItem* }{item}}
+\func{wxSizerItem*}{Add}{\param{wxGBSizerItem* }{item}}
-The Add methods return true if the item was successfully placed at the
-given position, false if something was already there.
+The Add methods return a valid pointer if the item was successfully placed at the
+given position, NULL if something was already there.
\membersection{wxGridBagSizer::CalcMin}\label{wxgridbagsizercalcmin}
\membersection{wxSizer::Add}\label{wxsizeradd}
-\func{void}{Add}{\param{wxWindow* }{window}, \param{int }{proportion = 0},\param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Add}{\param{wxWindow* }{window}, \param{int }{proportion = 0},\param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{void}{Add}{\param{wxSizer* }{sizer}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Add}{\param{wxSizer* }{sizer}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{void}{Add}{\param{int }{width}, \param{int }{height}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Add}{\param{int }{width}, \param{int }{height}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
Appends a child to the sizer. wxSizer itself is an abstract class, but the parameters are
equivalent in the derived classes that you will instantiate to use it so they are described
\membersection{wxSizer::AddSpacer}\label{wxsizeraddspacer}
-\func{void}{AddSpacer}{\param{int }{size}}
+\func{wxSizerItem*}{AddSpacer}{\param{int }{size}}
Adds non-stretchable space to the sizer. More readable way of calling
\helpref{Add}{wxsizeradd}(size, size, 0).
\membersection{wxSizer::AddStretchSpacer}\label{wxsizeraddstretchspacer}
-\func{void}{AddStretchSpacer}{\param{int }{prop = 1}}
+\func{wxSizerItem*}{AddStretchSpacer}{\param{int }{prop = 1}}
Adds stretchable space to the sizer. More readable way of calling
\helpref{Add}{wxsizeradd}(0, 0, prop).
\membersection{wxSizer::Insert}\label{wxsizerinsert}
-\func{void}{Insert}{\param{size\_t }{index}, \param{wxWindow* }{window}, \param{int }{proportion = 0},\param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Insert}{\param{size\_t }{index}, \param{wxWindow* }{window}, \param{int }{proportion = 0},\param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{void}{Insert}{\param{size\_t }{index}, \param{wxSizer* }{sizer}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Insert}{\param{size\_t }{index}, \param{wxSizer* }{sizer}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{void}{Insert}{\param{size\_t }{index}, \param{int }{width}, \param{int }{height}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Insert}{\param{size\_t }{index}, \param{int }{width}, \param{int }{height}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
Insert a child into the sizer before any existing item at {\it index}.
\membersection{wxSizer::InsertSpacer}\label{wxsizerinsertspacer}
-\func{void}{InsertSpacer}{\param{size\_t }{index}, \param{int }{size}}
+\func{wxSizerItem*}{InsertSpacer}{\param{size\_t }{index}, \param{int }{size}}
Inserts non-stretchable space to the sizer. More readable way of calling
\helpref{Insert}{wxsizerinsert}(size, size, 0).
\membersection{wxSizer::InsertStretchSpacer}\label{wxsizerinsertstretchspacer}
-\func{void}{InsertStretchSpacer}{\param{size\_t }{index}, \param{int }{prop = 1}}
+\func{wxSizerItem*}{InsertStretchSpacer}{\param{size\_t }{index}, \param{int }{prop = 1}}
Inserts stretchable space to the sizer. More readable way of calling
\helpref{Insert}{wxsizerinsert}(0, 0, prop).
\membersection{wxSizer::Prepend}\label{wxsizerprepend}
-\func{void}{Prepend}{\param{wxWindow* }{window}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Prepend}{\param{wxWindow* }{window}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{void}{Prepend}{\param{wxSizer* }{sizer}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Prepend}{\param{wxSizer* }{sizer}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border = 0}, \param{wxObject* }{userData = NULL}}
-\func{void}{Prepend}{\param{int }{width}, \param{int }{height}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border= 0}, \param{wxObject* }{userData = NULL}}
+\func{wxSizerItem*}{Prepend}{\param{int }{width}, \param{int }{height}, \param{int }{proportion = 0}, \param{int }{flag = 0}, \param{int }{border= 0}, \param{wxObject* }{userData = NULL}}
Same as \helpref{wxSizer::Add}{wxsizeradd}, but prepends the items to the beginning of the
list of items (windows, subsizers or spaces) owned by this sizer.
\membersection{wxSizer::PrependSpacer}\label{wxsizerprependspacer}
-\func{void}{PrependSpacer}{\param{int }{size}}
+\func{wxSizerItem*}{PrependSpacer}{\param{int }{size}}
Prepends non-stretchable space to the sizer. More readable way of calling
\helpref{Prepend}{wxsizerprepend}(size, size, 0).
\membersection{wxSizer::PrependStretchSpacer}\label{wxsizerprependstretchspacer}
-\func{void}{PrepentStretchSpacer}{\param{int }{prop = 1}}
+\func{wxSizerItem*}{PrependStretchSpacer}{\param{int }{prop = 1}}
Prepends stretchable space to the sizer. More readable way of calling
\helpref{Prepend}{wxsizerprepend}(0, 0, prop).
Get the ration item attribute.
+\membersection{wxSizerItem::GetRect}\label{wxsizeritemgetrect}
+
+\func{wxRect}{GetRect}{\void}
+
+Get the rectangle of the item on the parent window.
+
\membersection{wxSizerItem::GetSize}\label{wxsizeritemgetsize}
\constfunc{wxSize}{GetSize}{\void}
// The Add methods return true if the item was successfully placed at the
// given position, false if something was already there.
- bool Add( wxWindow *window,
- const wxGBPosition& pos,
- const wxGBSpan& span = wxDefaultSpan,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- bool Add( wxSizer *sizer,
- const wxGBPosition& pos,
- const wxGBSpan& span = wxDefaultSpan,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- bool Add( int width,
- int height,
- const wxGBPosition& pos,
- const wxGBSpan& span = wxDefaultSpan,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- bool Add( wxGBSizerItem *item );
+ wxSizerItem* Add( wxWindow *window,
+ const wxGBPosition& pos,
+ const wxGBSpan& span = wxDefaultSpan,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ wxSizerItem* Add( wxSizer *sizer,
+ const wxGBPosition& pos,
+ const wxGBSpan& span = wxDefaultSpan,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ wxSizerItem* Add( int width,
+ int height,
+ const wxGBPosition& pos,
+ const wxGBSpan& span = wxDefaultSpan,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ wxSizerItem* Add( wxGBSizerItem *item );
// Get/Set the size used for cells in the grid with no item.
// The Add base class virtuals should not be used with this class, but
// we'll try to make them automatically select a location for the item
// anyway.
- virtual void Add( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
- virtual void Add( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
- virtual void Add( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Add( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Add( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Add( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
// The Insert and Prepend base class virtuals that are not appropriate for
// this class and should not be used. Their implementation in this class
// simply fails.
- virtual void Add( wxSizerItem *item );
- virtual void Insert( size_t index, wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
- virtual void Insert( size_t index, wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
- virtual void Insert( size_t index, int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
- virtual void Insert( size_t index, wxSizerItem *item );
- virtual void Prepend( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
- virtual void Prepend( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
- virtual void Prepend( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
- virtual void Prepend( wxSizerItem *item );
+ virtual wxSizerItem* Add( wxSizerItem *item );
+ virtual wxSizerItem* Insert( size_t index, wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Insert( size_t index, wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Insert( size_t index, int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Insert( size_t index, wxSizerItem *item );
+ virtual wxSizerItem* Prepend( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Prepend( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Prepend( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL );
+ virtual wxSizerItem* Prepend( wxSizerItem *item );
protected:
float GetRatio() const
{ return m_ratio; }
+ virtual wxRect GetRect() { return m_zoneRect; }
+
bool IsWindow() const;
bool IsSizer() const;
bool IsSpacer() const;
int m_proportion;
int m_border;
int m_flag;
+ wxRect m_zoneRect; // Rectangle for window or item (not including borders)
// If true, then this item is considered in the layout
// calculation. Otherwise, it is skipped over.
// methods for adding elements to the sizer: there are Add/Insert/Prepend
// overloads for each of window/sizer/spacer/wxSizerItem
- inline void Add( wxWindow *window,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Add( wxSizer *sizer,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Add( int width,
- int height,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Add( wxWindow *window, const wxSizerFlags& flags );
- inline void Add( wxSizer *sizer, const wxSizerFlags& flags );
- inline void Add( wxSizerItem *item );
-
- inline void AddSpacer(int size);
- inline void AddStretchSpacer(int prop = 1);
-
- inline void Insert( size_t index,
- wxWindow *window,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Insert( size_t index,
- wxSizer *sizer,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Insert( size_t index,
- int width,
- int height,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Insert( size_t index,
- wxWindow *window,
- const wxSizerFlags& flags );
- inline void Insert( size_t index,
- wxSizer *sizer,
- const wxSizerFlags& flags );
- virtual void Insert( size_t index, wxSizerItem *item );
-
- inline void InsertSpacer(size_t index, int size);
- inline void InsertStretchSpacer(size_t index, int prop = 1);
-
- inline void Prepend( wxWindow *window,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Prepend( wxSizer *sizer,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Prepend( int width,
- int height,
- int proportion = 0,
- int flag = 0,
- int border = 0,
- wxObject* userData = NULL );
- inline void Prepend( wxWindow *window, const wxSizerFlags& flags );
- inline void Prepend( wxSizer *sizer, const wxSizerFlags& flags );
- inline void Prepend( wxSizerItem *item );
-
- inline void PrependSpacer(int size);
- inline void PrependStretchSpacer(int prop = 1);
+ inline wxSizerItem* Add( wxWindow *window,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Add( wxSizer *sizer,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Add( int width,
+ int height,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Add( wxWindow *window, const wxSizerFlags& flags );
+ inline wxSizerItem* Add( wxSizer *sizer, const wxSizerFlags& flags );
+ inline wxSizerItem* Add( wxSizerItem *item );
+
+ inline wxSizerItem* AddSpacer(int size);
+ inline wxSizerItem* AddStretchSpacer(int prop = 1);
+
+ inline wxSizerItem* Insert( size_t index,
+ wxWindow *window,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Insert( size_t index,
+ wxSizer *sizer,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Insert( size_t index,
+ int width,
+ int height,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Insert( size_t index,
+ wxWindow *window,
+ const wxSizerFlags& flags );
+ inline wxSizerItem* Insert( size_t index,
+ wxSizer *sizer,
+ const wxSizerFlags& flags );
+ virtual wxSizerItem* Insert( size_t index, wxSizerItem *item );
+
+ inline wxSizerItem* InsertSpacer(size_t index, int size);
+ inline wxSizerItem* InsertStretchSpacer(size_t index, int prop = 1);
+
+ inline wxSizerItem* Prepend( wxWindow *window,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Prepend( wxSizer *sizer,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Prepend( int width,
+ int height,
+ int proportion = 0,
+ int flag = 0,
+ int border = 0,
+ wxObject* userData = NULL );
+ inline wxSizerItem* Prepend( wxWindow *window, const wxSizerFlags& flags );
+ inline wxSizerItem* Prepend( wxSizer *sizer, const wxSizerFlags& flags );
+ inline wxSizerItem* Prepend( wxSizerItem *item );
+
+ inline wxSizerItem* PrependSpacer(int size);
+ inline wxSizerItem* PrependStretchSpacer(int prop = 1);
// Deprecated in 2.6 since historically it does not delete the window,
// inline functions implementation
// ----------------------------------------------------------------------------
-inline void
+inline wxSizerItem*
wxSizer::Add( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
- Add( new wxSizerItem( window, proportion, flag, border, userData ) );
+ return Add( new wxSizerItem( window, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Add( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
{
- Add( new wxSizerItem( sizer, proportion, flag, border, userData ) );
+ return Add( new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Add( int width, int height, int proportion, int flag, int border, wxObject* userData )
{
- Add( new wxSizerItem( width, height, proportion, flag, border, userData ) );
+ return Add( new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Add( wxWindow *window, const wxSizerFlags& flags )
{
- Add( new wxSizerItem(window, flags) );
+ return Add( new wxSizerItem(window, flags) );
}
-inline void
+inline wxSizerItem*
wxSizer::Add( wxSizer *sizer, const wxSizerFlags& flags )
{
- Add( new wxSizerItem(sizer, flags) );
+ return Add( new wxSizerItem(sizer, flags) );
}
-inline void
+inline wxSizerItem*
wxSizer::Add( wxSizerItem *item )
{
- Insert( m_children.GetCount(), item );
+ return Insert( m_children.GetCount(), item );
}
-inline void
+inline wxSizerItem*
wxSizer::AddSpacer(int size)
{
- Add(size, size);
+ return Add(size, size);
}
-inline void
+inline wxSizerItem*
wxSizer::AddStretchSpacer(int prop)
{
- Add(0, 0, prop);
+ return Add(0, 0, prop);
}
-inline void
+inline wxSizerItem*
wxSizer::Prepend( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
- Prepend( new wxSizerItem( window, proportion, flag, border, userData ) );
+ return Prepend( new wxSizerItem( window, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Prepend( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
{
- Prepend( new wxSizerItem( sizer, proportion, flag, border, userData ) );
+ return Prepend( new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Prepend( int width, int height, int proportion, int flag, int border, wxObject* userData )
{
- Prepend( new wxSizerItem( width, height, proportion, flag, border, userData ) );
+ return Prepend( new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Prepend( wxSizerItem *item )
{
- Insert( 0, item );
+ return Insert( 0, item );
}
-inline void
+inline wxSizerItem*
wxSizer::PrependSpacer(int size)
{
- Prepend(size, size);
+ return Prepend(size, size);
}
-inline void
+inline wxSizerItem*
wxSizer::PrependStretchSpacer(int prop)
{
- Prepend(0, 0, prop);
+ return Prepend(0, 0, prop);
}
-inline void
+inline wxSizerItem*
wxSizer::Prepend( wxWindow *window, const wxSizerFlags& flags )
{
- Prepend( new wxSizerItem(window, flags) );
+ return Prepend( new wxSizerItem(window, flags) );
}
-inline void
+inline wxSizerItem*
wxSizer::Prepend( wxSizer *sizer, const wxSizerFlags& flags )
{
- Prepend( new wxSizerItem(sizer, flags) );
+ return Prepend( new wxSizerItem(sizer, flags) );
}
-inline void
+inline wxSizerItem*
wxSizer::Insert( size_t index,
wxWindow *window,
int proportion,
int border,
wxObject* userData )
{
- Insert( index, new wxSizerItem( window, proportion, flag, border, userData ) );
+ return Insert( index, new wxSizerItem( window, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Insert( size_t index,
wxSizer *sizer,
int proportion,
int border,
wxObject* userData )
{
- Insert( index, new wxSizerItem( sizer, proportion, flag, border, userData ) );
+ return Insert( index, new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Insert( size_t index,
int width,
int height,
int border,
wxObject* userData )
{
- Insert( index, new wxSizerItem( width, height, proportion, flag, border, userData ) );
+ return Insert( index, new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
-inline void
+inline wxSizerItem*
wxSizer::Insert( size_t index, wxWindow *window, const wxSizerFlags& flags )
{
- Insert( index, new wxSizerItem(window, flags) );
+ return Insert( index, new wxSizerItem(window, flags) );
}
-inline void
+inline wxSizerItem*
wxSizer::Insert( size_t index, wxSizer *sizer, const wxSizerFlags& flags )
{
- Insert( index, new wxSizerItem(sizer, flags) );
+ return Insert( index, new wxSizerItem(sizer, flags) );
}
-inline void
+inline wxSizerItem*
wxSizer::InsertSpacer(size_t index, int size)
{
- Insert(index, size, size);
+ return Insert(index, size, size);
}
-inline void
+inline wxSizerItem*
wxSizer::InsertStretchSpacer(size_t index, int prop)
{
- Insert(index, 0, 0, prop);
+ return Insert(index, 0, 0, prop);
}
}
-bool wxGridBagSizer::Add( wxWindow *window,
- const wxGBPosition& pos, const wxGBSpan& span,
- int flag, int border, wxObject* userData )
+wxSizerItem* wxGridBagSizer::Add( wxWindow *window,
+ const wxGBPosition& pos, const wxGBSpan& span,
+ int flag, int border, wxObject* userData )
{
wxGBSizerItem* item = new wxGBSizerItem(window, pos, span, flag, border, userData);
if ( Add(item) )
- return true;
+ return item;
else
{
delete item;
- return false;
+ return (wxSizerItem*)NULL;
}
}
-bool wxGridBagSizer::Add( wxSizer *sizer,
+wxSizerItem* wxGridBagSizer::Add( wxSizer *sizer,
const wxGBPosition& pos, const wxGBSpan& span,
int flag, int border, wxObject* userData )
{
wxGBSizerItem* item = new wxGBSizerItem(sizer, pos, span, flag, border, userData);
if ( Add(item) )
- return true;
+ return item;
else
{
delete item;
- return false;
+ return (wxSizerItem*)NULL;
}
}
-bool wxGridBagSizer::Add( int width, int height,
+wxSizerItem* wxGridBagSizer::Add( int width, int height,
const wxGBPosition& pos, const wxGBSpan& span,
int flag, int border, wxObject* userData )
{
wxGBSizerItem* item = new wxGBSizerItem(width, height, pos, span, flag, border, userData);
if ( Add(item) )
- return true;
+ return item;
else
{
delete item;
- return false;
+ return (wxSizerItem*)NULL;
}
}
-bool wxGridBagSizer::Add( wxGBSizerItem *item )
+wxSizerItem* wxGridBagSizer::Add( wxGBSizerItem *item )
{
- wxCHECK_MSG( !CheckForIntersection(item), false,
+ wxCHECK_MSG( !CheckForIntersection(item), NULL,
wxT("An item is already at that position") );
m_children.Append(item);
item->SetGBSizer(this);
if ( item->GetWindow() )
item->GetWindow()->SetContainingSizer( this );
- return true;
+ return item;
}
// we'll try to make them automatically select a location for the item
// anyway.
-void wxGridBagSizer::Add( wxWindow *window, int, int flag, int border, wxObject* userData )
+wxSizerItem* wxGridBagSizer::Add( wxWindow *window, int, int flag, int border, wxObject* userData )
{
- Add(window, FindEmptyCell(), wxDefaultSpan, flag, border, userData);
+ return Add(window, FindEmptyCell(), wxDefaultSpan, flag, border, userData);
}
-void wxGridBagSizer::Add( wxSizer *sizer, int, int flag, int border, wxObject* userData )
+wxSizerItem* wxGridBagSizer::Add( wxSizer *sizer, int, int flag, int border, wxObject* userData )
{
- Add(sizer, FindEmptyCell(), wxDefaultSpan, flag, border, userData);
+ return Add(sizer, FindEmptyCell(), wxDefaultSpan, flag, border, userData);
}
-void wxGridBagSizer::Add( int width, int height, int, int flag, int border, wxObject* userData )
+wxSizerItem* wxGridBagSizer::Add( int width, int height, int, int flag, int border, wxObject* userData )
{
- Add(width, height, FindEmptyCell(), wxDefaultSpan, flag, border, userData);
+ return Add(width, height, FindEmptyCell(), wxDefaultSpan, flag, border, userData);
}
// this class and should not be used. Their implementation in this class
// simply fails.
-void wxGridBagSizer::Add( wxSizerItem * )
-{ wxFAIL_MSG(wxT("Invalid Add form called.")); }
+wxSizerItem* wxGridBagSizer::Add( wxSizerItem * )
+{
+ wxFAIL_MSG(wxT("Invalid Add form called."));
+ return (wxSizerItem*)NULL;
+}
-void wxGridBagSizer::Prepend( wxWindow *, int, int, int, wxObject* )
-{ wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer.")); }
+wxSizerItem* wxGridBagSizer::Prepend( wxWindow *, int, int, int, wxObject* )
+{
+ wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer."));
+ return (wxSizerItem*)NULL;
+}
-void wxGridBagSizer::Prepend( wxSizer *, int, int, int, wxObject* )
-{ wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer.")); }
+wxSizerItem* wxGridBagSizer::Prepend( wxSizer *, int, int, int, wxObject* )
+{
+ wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer."));
+ return (wxSizerItem*)NULL;
+}
-void wxGridBagSizer::Prepend( int, int, int, int, int, wxObject* )
-{ wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer.")); }
+wxSizerItem* wxGridBagSizer::Prepend( int, int, int, int, int, wxObject* )
+{
+ wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer."));
+ return (wxSizerItem*)NULL;
+}
-void wxGridBagSizer::Prepend( wxSizerItem * )
-{ wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer.")); }
+wxSizerItem* wxGridBagSizer::Prepend( wxSizerItem * )
+{
+ wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer."));
+ return (wxSizerItem*)NULL;
+}
-void wxGridBagSizer::Insert( size_t, wxWindow *, int, int, int, wxObject* )
-{ wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer.")); }
+wxSizerItem* wxGridBagSizer::Insert( size_t, wxWindow *, int, int, int, wxObject* )
+{
+ wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer."));
+ return (wxSizerItem*)NULL;
+}
-void wxGridBagSizer::Insert( size_t, wxSizer *, int, int, int, wxObject* )
-{ wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer.")); }
+wxSizerItem* wxGridBagSizer::Insert( size_t, wxSizer *, int, int, int, wxObject* )
+{
+ wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer."));
+ return (wxSizerItem*)NULL;
+}
-void wxGridBagSizer::Insert( size_t, int, int, int, int, int, wxObject* )
-{ wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer.")); }
+wxSizerItem* wxGridBagSizer::Insert( size_t, int, int, int, int, int, wxObject* )
+{
+ wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer."));
+ return (wxSizerItem*)NULL;
+}
-void wxGridBagSizer::Insert( size_t, wxSizerItem * )
-{ wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer.")); }
+wxSizerItem* wxGridBagSizer::Insert( size_t, wxSizerItem * )
+{
+ wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer."));
+ return (wxSizerItem*)NULL;
+}
//---------------------------------------------------------------------------
m_sizer = NULL;
m_show = true;
m_userData = NULL;
+ m_zoneRect = wxRect( 0, 0, 0, 0 );
}
void wxSizerItem::Init(const wxSizerFlags& flags)
, m_proportion( proportion )
, m_border( border )
, m_flag( flag )
+ , m_zoneRect( 0, 0, 0, 0 )
, m_show( true )
, m_userData( userData )
{
, m_proportion( proportion )
, m_border( border )
, m_flag( flag )
+ , m_zoneRect( 0, 0, 0, 0 )
, m_show( true )
, m_userData( userData )
{
, m_proportion( proportion )
, m_border( border )
, m_flag( flag )
+ , m_zoneRect( 0, 0, 0, 0 )
, m_show( true )
, m_ratio( 0.0 )
, m_userData( userData )
if (IsSizer())
m_sizer->SetDimension( pos.x, pos.y, size.x, size.y );
+ m_zoneRect = wxRect(pos, size);
if (IsWindow())
m_window->SetSize( pos.x, pos.y, size.x, size.y, wxSIZE_ALLOW_MINUS_ONE );
WX_CLEAR_LIST(wxSizerItemList, m_children);
}
-void wxSizer::Insert( size_t index, wxSizerItem *item )
+wxSizerItem* wxSizer::Insert( size_t index, wxSizerItem *item )
{
m_children.Insert( index, item );
if( item->GetWindow() )
item->GetWindow()->SetContainingSizer( this );
+
+ return item;
}
bool wxSizer::Remove( wxWindow *window )
#else
#ifdef __WXGTK__
- if ( box->GetLabel().IsEmpty() )
+ if ( box->GetLabel().empty() )
*borderTop = 5;
else
#endif // __WXGTK__