这次修改主要是DuiDesigner工程,duilib工程无须任何修改。
-
stdafx.h中enum UIClass枚举增加:classCheckBox,并引用命名空间:using DuiLib::CCheckBoxUI;
-
stdafx.cpp中gGetUIClass增加:
if( _tcscmp(pstrClass, _T("CheckBoxUI")) == 0 )
nClass=classCheckBox;
- LayoutManager.cpp函数CLayoutManager::NewUI增加:
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);