DuiDesigner修改:增加对RichEdit控件属性的保存
来源:互联网 发布:仿淘宝手机模板 编辑:程序博客网 时间:2024/06/06 16:56
当资源中有RichEdit时,无论怎么样修改其属性,最终保存时并不会被写到XML中去,仅仅是一个节点:<RichEdit />,属性一概没有保存。
通过动态跟踪xml保存的调用过程,定位到函数:CLayoutManager::SaveProperties:其中并没有处理对RichEdit的保存,问题就出现在这里,考虑增加一个函数SaveRichEditProperty,关键还要动态跟踪出RichEdit的pExtended->nClas是多少,动态发现是100。这些枚举值被定义在stdafx.h头文件中:100刚好等于classPointer,其实不太好,为了不影响后面的改动,暂时改为:
CLayoutManager::SaveProperties中增加:RichEdit常用的几个属性保存一下,当然不保证是全的,如果有遗漏的可以再加。
switch(pExtended->nClass) {case classControl: SaveControlProperty(pControl, pNode); break; case classLabel: case classText: SaveLabelProperty(pControl, pNode); break; case classButton: SaveButtonProperty(pControl, pNode); break; case classEdit: SaveEditProperty(pControl, pNode); break; case classOption: SaveOptionProperty(pControl, pNode); break; case classProgress: SaveProgressProperty(pControl, pNode); break; case classSlider: SaveSliderProperty(pControl, pNode); break; case classCombo: SaveComboProperty(pControl, pNode); break; case classList: SaveListProperty(pControl, pNode); break; case classListContainerElement: SaveListContainerElementProperty(pControl, pNode); break; case classListHeaderItem: SaveListHeaderItemProperty(pControl, pNode); break; case classActiveX: SaveActiveXProperty(pControl, pNode); break; case classListHeader: SaveListHeaderProperty(pControl,pNode); break; case classContainer: case classVerticalLayout: SaveContainerProperty(pControl,pNode); break; case classTabLayout: SaveTabLayoutProperty(pControl, pNode); break; case classHorizontalLayout: SaveHorizontalLayoutProperty(pControl, pNode); break; case classTileLayout: SaveTileLayoutProperty(pControl, pNode); break; case classChildLayout: SaveChildWindowProperty(pControl,pNode); break; case classWebBrowser: SaveWebBrowserProperty(pControl,pNode); break; default: break; }
//UI classenum UIClass{ classPointer=100, classWindow, classControl, classButton, classEdit, classLabel, classText, classOption, classCombo, classList, classSlider, classProgress, classActiveX, classContainer, classVerticalLayout, classHorizontalLayout, classTabLayout, classTileLayout, classListHeader, classListHeaderItem, classListTextElement, classListLabelElement, classListExpandElement, classListContainerElement, classItem, classScrollBar, classChildLayout, classWebBrowser};
//UI classenum UIClass{ classPointer=100, classRichEdit = 100, classWindow, classControl, classButton, classEdit, classLabel, classText, classOption, classCombo, classList, classSlider, classProgress, classActiveX, classContainer, classVerticalLayout, classHorizontalLayout, classTabLayout, classTileLayout, classListHeader, classListHeaderItem, classListTextElement, classListLabelElement, classListExpandElement, classListContainerElement, classItem, classScrollBar, classChildLayout, classWebBrowser};
CLayoutManager::SaveProperties中增加:
case classRichEdit: { if ( strClass.Compare(DUI_CTR_RICHEDIT)==0 ) { SaveRichEditProperty(pControl, pNode); } } break;
并实现SaveRichEditProperty:
void CLayoutManager::SaveRichEditProperty(CControlUI* pControl, TiXmlElement* pNode){ SaveControlProperty(pControl, pNode); CRichEditUI* pRichEditUI = static_cast<CRichEditUI*>(pControl->GetInterface(DUI_CTR_RICHEDIT)); pNode->SetAttribute("multiline", "true"); pNode->SetAttribute("autovscroll", "true"); pNode->SetAttribute("vscrollbar", "true"); if(pRichEditUI->IsReadOnly()) pNode->SetAttribute("readonly", "true"); if ( pRichEditUI->IsRich() ) { pNode->SetAttribute("rich", "true"); }}
0 0
- DuiDesigner修改:增加对RichEdit控件属性的保存
- RichEdit 控件的属性
- 对RichEdit控件的正确使用
- 解决duidesigner在属性窗口按del键会删除控件的bug
- DuiDesigner控件Label无法设置文本对齐属性的BUG解决方案
- RichEdit控件的范例
- RichEdit控件的使用
- 【MFC】:MFC实现对控件字体属性的修改
- duiLib : 修改DuiDesigner, 增强选择元素后的用户体验
- DuiDesigner修改:增强选择元素后的用户体验
- 保存对配置文件的修改
- c#对xml多属性节点的增加,删除,修改操作源码
- c#对xml多属性节点的增加,删除,修改操作源码
- c#对xml多属性节点的增加,删除,修改操作源码
- RichEdit背景色的修改
- 关于RICHEDIT控件的消息
- RichEdit控件的使用(未完)
- delphi Richedit控件的用法
- Git 服务器搭建(Linux)
- 黑马程序员———OC语言 NSDictionary和 NSMutableDictionary的介绍
- java+mysql+springmvc get请求乱码
- js浮动层的控制
- 第十周项目3-利用二叉树遍历思想解决问题
- DuiDesigner修改:增加对RichEdit控件属性的保存
- 51nod 1070 Bash游戏 V4 (博弈论_找规律)
- 设置pdb随cdb启动
- android studio 快捷键设置
- Symfony2 生成应用包
- 【PAT】1026. Table Tennis (30) (待改进)
- Windows下Redis的安装和测试
- 第八周实践项目~建立顺序串的算法库
- iOS9 Neutraface 英文字体 百度输入法 大众点评 可用