added growable cols and rows to wxFlexGridSizer XRC handler

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2000-11-25 23:13:57 +00:00
parent 91dd52fe3b
commit bee5a36e15
3 changed files with 29 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
#include "wx/log.h" #include "wx/log.h"
#include "wx/statbox.h" #include "wx/statbox.h"
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/tokenzr.h"
bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node) bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node)
{ {
@@ -152,14 +153,35 @@ wxObject *wxSizerXmlHandler::DoCreateResource()
GetDimension(_T("vgap")), GetDimension(_T("hgap"))); GetDimension(_T("vgap")), GetDimension(_T("hgap")));
else if (m_Class == _T("wxFlexGridSizer")) else if (m_Class == _T("wxFlexGridSizer"))
sizer = new wxFlexGridSizer(GetLong(_T("rows")), GetLong(_T("cols")), {
wxFlexGridSizer *fsizer =
new wxFlexGridSizer(GetLong(_T("rows")), GetLong(_T("cols")),
GetDimension(_T("vgap")), GetDimension(_T("hgap"))); GetDimension(_T("vgap")), GetDimension(_T("hgap")));
sizer = fsizer;
wxStringTokenizer tkn;
unsigned long l;
tkn.SetString(GetParamValue(_T("growablerows")), _T(","));
while (tkn.HasMoreTokens())
{
if (!tkn.GetNextToken().ToULong(&l))
wxLogError(_T("growablerows must be comma-separated list of row numbers"));
else
fsizer->AddGrowableRow(l);
}
tkn.SetString(GetParamValue(_T("growablecols")), _T(","));
while (tkn.HasMoreTokens())
{
if (!tkn.GetNextToken().ToULong(&l))
wxLogError(_T("growablecols must be comma-separated list of column numbers"));
else
fsizer->AddGrowableCol(l);
}
}
wxSize minsize = GetSize(_T("minsize")); wxSize minsize = GetSize(_T("minsize"));
if (!(minsize == wxDefaultSize)) if (!(minsize == wxDefaultSize))
sizer->SetMinSize(minsize); sizer->SetMinSize(minsize);
wxSizer *old_par = m_ParentSizer; wxSizer *old_par = m_ParentSizer;
m_ParentSizer = sizer; m_ParentSizer = sizer;
bool old_ins = m_IsInside; bool old_ins = m_IsInside;

View File

@@ -3,5 +3,5 @@ type sizer
icon 0 icon 0
childtype sizer_item childtype sizer_item
derived from panel_item derived from panel_item
var orient of flags wxHORIZONTAL,wxVERTICAL var orient of choice wxHORIZONTAL,wxVERTICAL
var minsize of coord var minsize of coord

View File

@@ -8,3 +8,6 @@ var cols of integer
var vgap of dimension var vgap of dimension
var hgap of dimension var hgap of dimension
var minsize of coord var minsize of coord
var growablecols of text
var growablerows of text