wxsboxsizer.cpp

来自「非常好用的可移植的多平台C/C++源代码编辑器」· C++ 代码 · 共 44 行

CPP
44
字号
#include "../wxsheaders.h"
#include "wxsboxsizer.h"

#include "../properties/wxsenumproperty.h"

wxString wxsBoxSizer::GetProducingCode(wxsCodeParams& Params)
{
    return wxString::Format(_T("%s = new wxBoxSizer(%s);"),
        BaseParams.VarName.c_str(),
        (Orient == wxVERTICAL) ? _T("wxVERTICAL") : _T("wxHORIZONTAL") );
}

bool wxsBoxSizer::MyXmlLoad()
{
	wxString Value = XmlGetVariable(_T("orient"));
	Orient = ( Value == _T("wxVERTICAL") ) ? wxVERTICAL : wxHORIZONTAL;
    return true;
}

bool wxsBoxSizer::MyXmlSave()
{
    XmlSetVariable(_T("orient"),(Orient == wxVERTICAL) ? _T("wxVERTICAL") : _T("wxHORIZONTAL"));
    return true;
}


void wxsBoxSizer::CreateObjectProperties()
{
	static const wxChar* Names[] = { _("Horizontal"), _("Vertical"), NULL };
	static long Values[] = { wxHORIZONTAL, wxVERTICAL };
    wxsWidget::CreateObjectProperties();
    PropertiesObject.AddProperty( _("Orientation:"), new wxsEnumProperty(&PropertiesObject,Orient,Names,Values), 0);
}

void wxsBoxSizer::Init()
{
	Orient = wxHORIZONTAL;
}

wxSizer* wxsBoxSizer::ProduceSizer(wxWindow* Panel)
{
	return new wxBoxSizer(Orient);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?