added minsize variable for sizers and sizeritems

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2000-08-05 21:25:54 +00:00
parent 29b5f2cc19
commit 266527ec60
6 changed files with 19 additions and 0 deletions

View File

@@ -90,13 +90,22 @@ wxObject *wxSizerXmlHandler::DoCreateResource()
m_ParentSizer = old_par;
wxSizer *sizer = wxDynamicCast(item, wxSizer);
wxWindow *wnd = wxDynamicCast(item, wxWindow);
wxSize minsize = GetSize(_T("minsize"));
if (sizer)
{
m_ParentSizer->Add(sizer, GetLong(_T("option")),
GetStyle(_T("flag")), GetLong(_T("border")));
if (!(minsize == wxDefaultSize))
m_ParentSizer->SetItemMinSize(sizer, minsize.x, minsize.y);
}
else if (wnd)
{
m_ParentSizer->Add(wnd, GetLong(_T("option")),
GetStyle(_T("flag")), GetLong(_T("border")));
if (!(minsize == wxDefaultSize))
m_ParentSizer->SetItemMinSize(wnd, minsize.x, minsize.y);
}
else
wxLogError(_T("Error in resource."));
@@ -147,6 +156,11 @@ wxObject *wxSizerXmlHandler::DoCreateResource()
sizer = new wxFlexGridSizer(GetLong(_T("rows")), GetLong(_T("cols")),
GetLong(_T("vgap")), GetLong(_T("hgap")));
wxSize minsize = GetSize(_T("minsize"));
if (!(minsize == wxDefaultSize))
sizer->SetMinSize(minsize);
wxSizer *old_par = m_ParentSizer;
m_ParentSizer = sizer;
bool old_ins = m_IsInside;

View File

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

View File

@@ -7,3 +7,4 @@ var rows of integer
var cols of integer
var vgap of integer
var hgap of integer
var minsize of coord

View File

@@ -7,3 +7,4 @@ var rows of integer
var cols of integer
var vgap of integer
var hgap of integer
var minsize of coord

View File

@@ -6,3 +6,4 @@ type sizeritem
var option of integer
var flag of flags wxEXPAND,wxALL,wxLEFT,wxRIGHT,wxTOP,wxBOTTOM,wxALIGN_CENTER,wxALIGN_LEFT,wxALIGN_TOP,wxALIGN_RIGHT,wxALIGN_BOTTOM,wxALIGN_CENTER_HORIZONTAL,wxALIGN_CENTER_VERTICAL,wxNORTH,wxSOUTH,wxEAST,wxWEST,wxGROW,wxSHAPED,wxSTRETCH_NOT
var border of integer
var minsize of coord

View File

@@ -1,3 +1,4 @@
node staticboxsizer
derived from boxsizer
var label of text
var minsize of coord