]> git.saurik.com Git - wxWidgets.git/commitdiff
wxSizer::Add/Insert now returns pointer to wxSizerItem added and wxSizerItem contains...
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 9 Nov 2004 18:33:00 +0000 (18:33 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 9 Nov 2004 18:33:00 +0000 (18:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/gridbagsizer.tex
docs/latex/wx/sizer.tex
docs/latex/wx/sizeritem.tex
include/wx/gbsizer.h
include/wx/sizer.h
src/common/gbsizer.cpp
src/common/sizer.cpp

index addad9d19875d2b65b8fb24c81f4288919352a8c..ace09c8ba9b446d0d0f4a41a43c01644a61ccbd9 100644 (file)
@@ -165,6 +165,8 @@ INCOMPATIBLE CHANGES SINCE 2.4.x
   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
   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
 
 
 DEPRECATED METHODS SINCE 2.4.x
@@ -232,6 +234,8 @@ All (GUI):
 
 - recursive wxSizer::GetItem returns item of given window, sizer or nth index
 - wxLayoutConstraints now use best size, not current size, for AsIs() condition
 
 - 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:
 
 
 Unix:
 
index fa634e8cd0e50efdf3d08a48979087e91858d61a..887791cd4702401f1f4bac97426be67309ca00f6 100644 (file)
@@ -29,16 +29,16 @@ rows and columns.
 
 \membersection{wxGridBagSizer::Add}\label{wxgridbagsizeradd}
 
 
 \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{wxGridBagSizer::CalcMin}\label{wxgridbagsizercalcmin}
 
index 4c13b8ebcb62313669e469f410443caaee215e7f..4eb9e0c36a2f1e6fa62bdaad4ece36d193ae5a23 100644 (file)
@@ -62,11 +62,11 @@ The destructor.
 
 \membersection{wxSizer::Add}\label{wxsizeradd}
 
 
 \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
 
 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
@@ -145,7 +145,7 @@ complex than the {\it proportion} and {\it flag} will allow for.}
 
 \membersection{wxSizer::AddSpacer}\label{wxsizeraddspacer}
 
 
 \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).
 
 Adds non-stretchable space to the sizer. More readable way of calling
 \helpref{Add}{wxsizeradd}(size, size, 0).
@@ -153,7 +153,7 @@ Adds non-stretchable space to the sizer. More readable way of calling
 
 \membersection{wxSizer::AddStretchSpacer}\label{wxsizeraddstretchspacer}
 
 
 \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).
 
 Adds stretchable space to the sizer. More readable way of calling
 \helpref{Add}{wxsizeradd}(0, 0, prop).
@@ -254,11 +254,11 @@ size of all the children and their borders or the minimal size set by
 
 \membersection{wxSizer::Insert}\label{wxsizerinsert}
 
 
 \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}.
 
 
 Insert a child into the sizer before any existing item at {\it index}.
 
@@ -269,7 +269,7 @@ See \helpref{wxSizer::Add}{wxsizeradd} for the meaning of the other parameters.
 
 \membersection{wxSizer::InsertSpacer}\label{wxsizerinsertspacer}
 
 
 \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).
 
 Inserts non-stretchable space to the sizer. More readable way of calling
 \helpref{Insert}{wxsizerinsert}(size, size, 0).
@@ -277,7 +277,7 @@ Inserts non-stretchable space to the sizer. More readable way of calling
 
 \membersection{wxSizer::InsertStretchSpacer}\label{wxsizerinsertstretchspacer}
 
 
 \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).
 
 Inserts stretchable space to the sizer. More readable way of calling
 \helpref{Insert}{wxsizerinsert}(0, 0, prop).
@@ -294,11 +294,11 @@ the current dimension.
 
 \membersection{wxSizer::Prepend}\label{wxsizerprepend}
 
 
 \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.
 
 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.
@@ -306,7 +306,7 @@ list of items (windows, subsizers or spaces) owned by this sizer.
 
 \membersection{wxSizer::PrependSpacer}\label{wxsizerprependspacer}
 
 
 \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).
 
 Prepends non-stretchable space to the sizer. More readable way of calling
 \helpref{Prepend}{wxsizerprepend}(size, size, 0).
@@ -314,7 +314,7 @@ Prepends non-stretchable space to the sizer. More readable way of calling
 
 \membersection{wxSizer::PrependStretchSpacer}\label{wxsizerprependstretchspacer}
 
 
 \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).
 
 Prepends stretchable space to the sizer. More readable way of calling
 \helpref{Prepend}{wxsizerprepend}(0, 0, prop).
index 725d4694c695ef237bd7afdbbcea41394752869b..28c427efb4091fe3a78d6dc5cb919b77fb746f5d 100644 (file)
@@ -104,6 +104,12 @@ Get the proportion item attribute.
 
 Get the ration item attribute.
 
 
 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}
 \membersection{wxSizerItem::GetSize}\label{wxsizeritemgetsize}
 
 \constfunc{wxSize}{GetSize}{\void}
index 54b03abe35fffc640f6870cd9970935bbcc1e546..b0df2a9cc571ae2a4a6dfc9da3695850c4e543ca 100644 (file)
@@ -176,26 +176,26 @@ public:
 
     // 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 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.
 
 
     // Get/Set the size used for cells in the grid with no item.
@@ -270,22 +270,22 @@ public:
     // 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.
     // 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.
 
     // 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:
 
 
 protected:
index 374b1559dc2dced184d7fb7492bfdf7cef189805..820c32502808832868c71f2840489b5ea13c9751 100644 (file)
@@ -182,6 +182,8 @@ public:
     float GetRatio() const
         { return m_ratio; }
 
     float GetRatio() const
         { return m_ratio; }
 
+    virtual wxRect GetRect() { return m_zoneRect; }
+
     bool IsWindow() const;
     bool IsSizer() const;
     bool IsSpacer() const;
     bool IsWindow() const;
     bool IsSizer() const;
     bool IsSpacer() const;
@@ -241,6 +243,7 @@ protected:
     int          m_proportion;
     int          m_border;
     int          m_flag;
     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.
 
     // If true, then this item is considered in the layout
     // calculation.  Otherwise, it is skipped over.
@@ -273,81 +276,81 @@ public:
 
     // methods for adding elements to the sizer: there are Add/Insert/Prepend
     // overloads for each of window/sizer/spacer/wxSizerItem
 
     // 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,
 
 
     // Deprecated in 2.6 since historically it does not delete the window,
@@ -704,103 +707,103 @@ private:
 // inline functions implementation
 // ----------------------------------------------------------------------------
 
 // inline functions implementation
 // ----------------------------------------------------------------------------
 
-inline void
+inline wxSizerItem*
 wxSizer::Add( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
 {
 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 )
 {
 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 )
 {
 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 )
 {
 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 )
 {
 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 )
 {
 wxSizer::Add( wxSizerItem *item )
 {
-    Insert( m_children.GetCount(), item );
+    return Insert( m_children.GetCount(), item );
 }
 
 }
 
-inline void
+inline wxSizerItem*
 wxSizer::AddSpacer(int size)
 {
 wxSizer::AddSpacer(int size)
 {
-    Add(size, size);
+    return Add(size, size);
 }
 
 }
 
-inline void
+inline wxSizerItem*
 wxSizer::AddStretchSpacer(int prop)
 {
 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 )
 {
 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 )
 {
 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 )
 {
 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 )
 {
 wxSizer::Prepend( wxSizerItem *item )
 {
-    Insert( 0, item );
+    return Insert( 0, item );
 }
 
 }
 
-inline void
+inline wxSizerItem*
 wxSizer::PrependSpacer(int size)
 {
 wxSizer::PrependSpacer(int size)
 {
-    Prepend(size, size);
+    return Prepend(size, size);
 }
 
 }
 
-inline void
+inline wxSizerItem*
 wxSizer::PrependStretchSpacer(int prop)
 {
 wxSizer::PrependStretchSpacer(int prop)
 {
-    Prepend(0, 0, prop);
+    return Prepend(0, 0, prop);
 }
 
 }
 
-inline void
+inline wxSizerItem*
 wxSizer::Prepend( wxWindow *window, const wxSizerFlags& flags )
 {
 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 )
 {
 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,
 wxSizer::Insert( size_t index,
                  wxWindow *window,
                  int proportion,
@@ -808,10 +811,10 @@ wxSizer::Insert( size_t index,
                  int border,
                  wxObject* userData )
 {
                  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,
 wxSizer::Insert( size_t index,
                  wxSizer *sizer,
                  int proportion,
@@ -819,10 +822,10 @@ wxSizer::Insert( size_t index,
                  int border,
                  wxObject* userData )
 {
                  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,
 wxSizer::Insert( size_t index,
                  int width,
                  int height,
@@ -831,31 +834,31 @@ wxSizer::Insert( size_t index,
                  int border,
                  wxObject* userData )
 {
                  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 )
 {
 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 )
 {
 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)
 {
 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)
 {
 wxSizer::InsertStretchSpacer(size_t index, int prop)
 {
-    Insert(index, 0, 0, prop);
+    return Insert(index, 0, 0, prop);
 }
 
 
 }
 
 
index 3eee5d855d8ffcd2917b0ce63e0146724d1d9792..615d3011dd989fb3c2b2c9a9655d2e9d5831aa5a 100644 (file)
@@ -182,58 +182,58 @@ wxGridBagSizer::wxGridBagSizer(int vgap, int hgap )
 }
 
 
 }
 
 
-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) )
 {
     wxGBSizerItem* item = new wxGBSizerItem(window, pos, span, flag, border, userData);
     if ( Add(item) )
-        return true;
+        return item;
     else
     {
         delete 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) )
                           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;
     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) )
                           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;
     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 );
 
                  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;
 }
 
 
 }
 
 
@@ -613,19 +613,19 @@ wxGBPosition wxGridBagSizer::FindEmptyCell()
 // we'll try to make them automatically select a location for the item
 // anyway.
 
 // 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);
 }
 
 
 }
 
 
@@ -634,33 +634,60 @@ void wxGridBagSizer::Add( int width, int height, int, int flag, int border, wxOb
 // this class and should not be used.  Their implementation in this class
 // simply fails.
 
 // 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;
+}
 
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
index b5d44e452a00a9fa7ab7d6bac270666f0573d383..c88d50f4ee1cd2572c2c1a8097d60cb007c29f64 100644 (file)
@@ -89,6 +89,7 @@ void wxSizerItem::Init()
     m_sizer = NULL;
     m_show = true;
     m_userData = NULL;
     m_sizer = NULL;
     m_show = true;
     m_userData = NULL;
+    m_zoneRect = wxRect( 0, 0, 0, 0 );
 }
 
 void wxSizerItem::Init(const wxSizerFlags& flags)
 }
 
 void wxSizerItem::Init(const wxSizerFlags& flags)
@@ -108,6 +109,7 @@ wxSizerItem::wxSizerItem( int width, int height, int proportion, int flag, int b
     , m_proportion( proportion )
     , m_border( border )
     , m_flag( flag )
     , m_proportion( proportion )
     , m_border( border )
     , m_flag( flag )
+    , m_zoneRect( 0, 0, 0, 0 )
     , m_show( true )
     , m_userData( userData )
 {
     , m_show( true )
     , m_userData( userData )
 {
@@ -120,6 +122,7 @@ wxSizerItem::wxSizerItem( wxWindow *window, int proportion, int flag, int border
     , m_proportion( proportion )
     , m_border( border )
     , m_flag( flag )
     , m_proportion( proportion )
     , m_border( border )
     , m_flag( flag )
+    , m_zoneRect( 0, 0, 0, 0 )
     , m_show( true )
     , m_userData( userData )
 {
     , m_show( true )
     , m_userData( userData )
 {
@@ -139,6 +142,7 @@ wxSizerItem::wxSizerItem( wxSizer *sizer, int proportion, int flag, int border,
     , m_proportion( proportion )
     , m_border( border )
     , m_flag( flag )
     , 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 )
     , m_show( true )
     , m_ratio( 0.0 )
     , m_userData( userData )
@@ -287,6 +291,7 @@ void wxSizerItem::SetDimension( wxPoint pos, wxSize size )
     if (IsSizer())
         m_sizer->SetDimension( pos.x, pos.y, size.x, size.y );
 
     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 );
 
     if (IsWindow())
         m_window->SetSize( pos.x, pos.y, size.x, size.y, wxSIZE_ALLOW_MINUS_ONE );
 
@@ -357,12 +362,14 @@ wxSizer::~wxSizer()
     WX_CLEAR_LIST(wxSizerItemList, m_children);
 }
 
     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 );
 {
     m_children.Insert( index, item );
 
     if( item->GetWindow() )
         item->GetWindow()->SetContainingSizer( this );
+
+    return item;
 }
 
 bool wxSizer::Remove( wxWindow *window )
 }
 
 bool wxSizer::Remove( wxWindow *window )
@@ -1582,7 +1589,7 @@ static void GetStaticBoxBorders( wxStaticBox *box,
 
 #else
 #ifdef __WXGTK__
 
 #else
 #ifdef __WXGTK__
-    if ( box->GetLabel().IsEmpty() )
+    if ( box->GetLabel().empty() )
         *borderTop = 5;
     else
 #endif // __WXGTK__
         *borderTop = 5;
     else
 #endif // __WXGTK__