📄 wxsstaticboxsizer.cpp
字号:
#include "../wxsheaders.h"
#include "wxsstaticboxsizer.h"
#include "../properties/wxsenumproperty.h"
#include "../wxsglobals.h"
wxString wxsStaticBoxSizer::GetProducingCode(wxsCodeParams& Params)
{
return wxString::Format(_T("%s = new wxStaticBoxSizer(%s,%s,%s);"),
BaseParams.VarName.c_str(),
(Orient == wxVERTICAL) ? _T("wxVERTICAL") : _T("wxHORIZONTAL"),
Params.ParentName.c_str(),
GetWxString(Label).c_str() );
}
bool wxsStaticBoxSizer::MyXmlLoad()
{
wxString Value = XmlGetVariable(_T("orient"));
Orient = ( Value == _T("wxVERTICAL") ) ? wxVERTICAL : wxHORIZONTAL;
Label = XmlGetVariable(_T("label"));
return true;
}
bool wxsStaticBoxSizer::MyXmlSave()
{
XmlSetVariable(_T("orient"),(Orient == wxVERTICAL) ? _T("wxVERTICAL") : _T("wxHORIZONTAL"));
XmlSetVariable(_T("label"),Label);
return true;
}
void wxsStaticBoxSizer::CreateObjectProperties()
{
PropertiesObject.AddProperty( _("Label:"), Label, 0 );
static const wxChar* Names[] = { _("Horizontal"), _("Vertical"), NULL };
static long Values[] = { wxHORIZONTAL, wxVERTICAL };
wxsWidget::CreateObjectProperties();
PropertiesObject.AddProperty( _("Orientation:"), new wxsEnumProperty(&PropertiesObject,Orient,Names,Values), 1);
}
void wxsStaticBoxSizer::Init()
{
Orient = wxHORIZONTAL;
Label = _T("Label");
}
wxSizer* wxsStaticBoxSizer::ProduceSizer(wxWindow* Panel)
{
return new wxStaticBoxSizer(Orient,Panel,Label);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -