]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxStaticBoxSizer ctor creating a new static box
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 Jan 2005 20:56:39 +0000 (20:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 Jan 2005 20:56:39 +0000 (20:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/sbsizer.tex
include/wx/sizer.h
src/common/sizer.cpp

index 06cbc0017bbd2f29154b5dc0067ede58dd1dd9c1..e1e974b3fa94817e8c2d83fec9d38e3332855308 100644 (file)
@@ -1,8 +1,8 @@
 \section{\class{wxStaticBoxSizer}}\label{wxstaticboxsizer}
 
 wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static
-box around the sizer. Note that this static box has to be created 
-separately.
+box around the sizer. This static box has to be created independently or the
+sizer may create it itself as a convenience.
 
 \wxheading{Derived from}
 
@@ -20,12 +20,19 @@ separately.
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
+
 \membersection{wxStaticBoxSizer::wxStaticBoxSizer}\label{wxstaticboxsizerwxstaticboxsizer}
 
 \func{}{wxStaticBoxSizer}{\param{wxStaticBox* }{box}, \param{int }{orient}}
 
-Constructor. It takes an associated static box and the orientation {\it orient} 
-as parameters - orient can be either of wxVERTICAL or wxHORIZONTAL.
+\func{}{wxStaticBoxSizer}{\param{int }{orient}, \param{wxWindow }{*parent}, \parent{const wxString\& }{label = wxEmptyString}}
+
+The first constructor uses an already existing static box. It takes the
+associated static box and the orientation \arg{orient}, which can be either
+\texttt{wxVERTICAL} or \texttt{wxHORIZONTAL} as parameters.
+
+The second one creates a new static box with the given label and parent window.
+
 
 \membersection{wxStaticBoxSizer::GetStaticBox}\label{wxstaticboxsizergetstaticbox}
 
index 1f76fc0554946f9b44517f1231e5f41674729834..1aae6d573c521c051f249d971e0fbab9b58d6c77 100644 (file)
@@ -621,7 +621,8 @@ class WXDLLEXPORT wxStaticBox;
 class WXDLLEXPORT wxStaticBoxSizer: public wxBoxSizer
 {
 public:
-    wxStaticBoxSizer( wxStaticBox *box, int orient );
+    wxStaticBoxSizer(wxStaticBox *box, int orient);
+    wxStaticBoxSizer(int orient, wxWindow *win, const wxString& label = _T(""));
 
     void RecalcSizes();
     wxSize CalcMin();
index 98086b6804eb0c290963ce0aae1f71c9e97f5b1b..27b781cf1658cf699b450a8d816f22ab4083877f 100644 (file)
@@ -1570,6 +1570,12 @@ wxStaticBoxSizer::wxStaticBoxSizer( wxStaticBox *box, int orient )
     wxASSERT_MSG( box, wxT("wxStaticBoxSizer needs a static box") );
 }
 
+wxStaticBoxSizer::wxStaticBoxSizer(int orient, wxWindow *win, const wxString& s)
+                : wxBoxSizer(orient),
+                  m_staticBox(new wxStaticBox(win, wxID_ANY, s))
+{
+}
+
 static void GetStaticBoxBorders( wxStaticBox *box,
                                  int *borderTop,
                                  int *borderOther)