这次修改主要是DuiDesigner工程,duilib工程无须任何修改。
stdafx.h中enum UIClass枚举增加:classCheckBox,并引用命名空间:using DuiLib::CCheckBoxUI;
stdafx.cpp中gGetUIClass增加: ```c if( _tcscmp(pstrClass, _T(“CheckBoxUI”)) == 0 ) nClass=classCheckBox;
3. LayoutManager.cpp函数**CLayoutManager::NewUI**增加:
```c
case classCheckBox:
pControl=new CCheckBoxUI;
pExtended->nClass=classCheckBox;
pControl->SetFloat(true);
break;
函数CLayoutManager::SaveOptionProperty修改为:
void CLayoutManager::SaveOptionProperty(CControlUI* pControl, TiXmlElement* pNode)
{
SaveButtonProperty(pControl, pNode);
TCHAR szBuf[MAX_PATH] = {0};
CString strClass = pControl->GetClass();
COptionUI* pOptionUI = static_cast<COptionUI*>(pControl->GetInterface(_T("Option")));
if ( strClass==_T("OptionUI") ) {
if(pOptionUI->GetGroup() && _tcslen(pOptionUI->GetGroup()))
pNode->SetAttribute("group",StringConvertor::WideToUtf8(pOptionUI->GetGroup()));
}//CheckBoxUI
if(pOptionUI->IsSelected())
pNode->SetAttribute("selected", pOptionUI->IsSelected()?"true":"false");
if(pOptionUI->GetForeImage() && _tcslen(pOptionUI->GetForeImage()) > 0)
pNode->SetAttribute("foreimage", StringConvertor::WideToUtf8(ConvertImageFileName(pOptionUI->GetForeImage())));
if(pOptionUI->GetSelectedImage() && _tcslen(pOptionUI->GetSelectedImage()) > 0)
pNode->SetAttribute("selectedimage", StringConvertor::WideToUtf8(ConvertImageFileName(pOptionUI->GetSelectedImage())));
}
函数CLayoutManager::SaveProperties,增加:
case classOption:
case classCheckBox:
SaveOptionProperty(pControl, pNode);
文档信息
- 本文作者:zhupite
- 本文链接:https://zhupite.com/duilib/duilib-duidesigner-checkbox-save-properties.html
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)