]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/gbsizer.h
Use wxGetTranslation() instead of _() in the public headers.
[wxWidgets.git] / include / wx / gbsizer.h
index f62f8919548e720e3d9e112fe1fa7a2a6668ba65..dea46c15ab7e4e91398c0c3b8094af997ebd65bd 100644 (file)
@@ -1,12 +1,11 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        gbsizer.h
+// Name:        wx/gbsizer.h
 // Purpose:     wxGridBagSizer:  A sizer that can lay out items in a grid,
 //              with items at specified cells, and with the option of row
 //              and/or column spanning
 //
 // Author:      Robin Dunn
 // Created:     03-Nov-2003
-// RCS-ID:      $Id$
 // Copyright:   (c) Robin Dunn
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -67,6 +66,14 @@ public:
 
     // default copy ctor and assignment operator are okay.
 
+    // Factor constructor creating an invalid wxGBSpan: this is mostly supposed
+    // to be used as return value for functions returning wxGBSpan in case of
+    // errors.
+    static wxGBSpan Invalid()
+    {
+        return wxGBSpan(NULL);
+    }
+
     int GetRowspan() const { return m_rowspan; }
     int GetColspan() const { return m_colspan; }
     void SetRowspan(int rowspan)
@@ -87,6 +94,13 @@ public:
     bool operator!=(const wxGBSpan& o) const { return !(*this == o); }
 
 private:
+    // This private ctor is used by Invalid() only.
+    wxGBSpan(struct InvalidCtorTag*)
+    {
+        m_rowspan =
+        m_colspan = -1;
+    }
+
     void Init()
     {
         m_rowspan =
@@ -115,26 +129,26 @@ public:
     wxGBSizerItem( int width,
                    int height,
                    const wxGBPosition& pos,
-                   const wxGBSpan& span,
-                   int flag,
-                   int border,
-                   wxObject* userData);
+                   const wxGBSpan& span=wxDefaultSpan,
+                   int flag=0,
+                   int border=0,
+                   wxObject* userData=NULL);
 
     // window
     wxGBSizerItem( wxWindow *window,
                    const wxGBPosition& pos,
-                   const wxGBSpan& span,
-                   int flag,
-                   int border,
-                   wxObject* userData );
+                   const wxGBSpan& span=wxDefaultSpan,
+                   int flag=0,
+                   int border=0,
+                   wxObject* userData=NULL );
 
     // subsizer
     wxGBSizerItem( wxSizer *sizer,
                    const wxGBPosition& pos,
-                   const wxGBSpan& span,
-                   int flag,
-                   int border,
-                   wxObject* userData );
+                   const wxGBSpan& span=wxDefaultSpan,
+                   int flag=0,
+                   int border=0,
+                   wxObject* userData=NULL );
 
     // default ctor
     wxGBSizerItem();
@@ -160,7 +174,7 @@ public:
     // is successful and after the next Layout the item will be resized.
     bool SetSpan( const wxGBSpan& span );
 
-    // Returns true if this item and the other item instersect
+    // Returns true if this item and the other item intersect
     bool Intersects(const wxGBSizerItem& other);
 
     // Returns true if the given pos/span would intersect with this item.