├── 开发支持.txt ├── 感谢名单.txt ├── 版权说明.txt ├── duilib.png ├── snatshot.png ├── DuiLib ├── UIList.h ├── UICombo.cpp ├── UIControl.h ├── UIRender.h ├── RichEd20.Lib ├── UIActiveX.cpp ├── UIContainer.h ├── UIControl.cpp ├── UIMarkup.cpp ├── UIRender.cpp ├── UIRichEdit.h ├── UIContainer.cpp ├── UIDlgBuilder.cpp ├── UIRichEdit.cpp ├── StdAfx.cpp ├── UIDlgBuilder.h ├── StdAfx.h ├── UIActiveX.h ├── UIlib.h ├── UIDelegate.cpp ├── UIDelegate.h ├── UIlib.cpp ├── UIMarkup.h ├── UICombo.h ├── DuiLib.vcxproj.filters ├── UIBase.h ├── UICommonControls.h └── UIManager.h ├── Control_show.png ├── UIDesigner ├── HookAPI.h ├── MainFrm.h ├── stdafx.h ├── ChildFrm.cpp ├── ChildFrm.h ├── ClassView.h ├── FileView.cpp ├── FileView.h ├── HookAPI.cpp ├── MainFrm.cpp ├── ReadMe.txt ├── UIDesigner.h ├── ViewTree.cpp ├── ViewTree.h ├── res │ ├── sort.bmp │ ├── banner.bmp │ ├── uimenu.bmp │ ├── Toolbar.bmp │ ├── classview.bmp │ ├── explorer.bmp │ ├── file_view.ico │ ├── fileview.bmp │ ├── formedit.bmp │ ├── res_view.ico │ ├── resource.bmp │ ├── sort_hc.bmp │ ├── Toolbar256.bmp │ ├── Toolbar_hc.bmp │ ├── UIDesigner.ico │ ├── UIDesigner.rc2 │ ├── class_view.ico │ ├── explorer_hc.bmp │ ├── fileview_hc.bmp │ ├── formedit_hc.bmp │ ├── menuimages.bmp │ ├── movehandle.bmp │ ├── properties.bmp │ ├── res_view_hc.ico │ ├── resource24.bmp │ ├── ToolBox │ │ ├── Active.ico │ │ ├── Button.ico │ │ ├── Combo.ico │ │ ├── Edit.ico │ │ ├── Label.ico │ │ ├── Option.ico │ │ ├── Slider.ico │ │ ├── Text.ico │ │ ├── Control.ico │ │ ├── Pointer.ico │ │ ├── Progress.ico │ │ ├── Container.ico │ │ ├── ScrollBar.ico │ │ ├── TabLayout.ico │ │ ├── TileLayout.ico │ │ ├── HorizontalLayout.ico │ │ └── VerticalLayout.ico │ ├── UIDesignerDoc.ico │ ├── class_view_hc.ico │ ├── classview_hc.bmp │ ├── file_view_hc.ico │ ├── menuimages_hc.bmp │ ├── properties_hc.bmp │ ├── properties_wnd.ico │ ├── toolbox_wnd_hc.ico │ └── properties_wnd_hc.ico ├── stdafx.cpp ├── targetver.h ├── ClassView.cpp ├── ToolBoxWnd.cpp ├── UIDesigner.cpp ├── UIDesigner.rc ├── UIDesigner.reg ├── UserImages.bmp ├── ImageDialog.cpp ├── ImagePreview.cpp ├── LayoutManager.cpp ├── PropertiesWnd.cpp ├── PropertiesWnd.h ├── ToolBoxCtrl.cpp ├── UIDesigner.vcproj ├── UIDesignerDoc.cpp ├── UIDesignerDoc.h ├── UIDesignerView.h ├── UIProperties.cpp ├── DialogCheckUpdate.h ├── DialogProjectNew.h ├── DialogSaveAsName.h ├── UIDesignerView.cpp ├── UIImagePreview.cpp ├── DialogCheckUpdate.cpp ├── DialogCustomFonts.cpp ├── DialogProjectNew.cpp ├── DialogSaveAsName.cpp ├── DialogSkinFileNew.cpp ├── DialogTemplateOpen.cpp ├── DialogTemplateOpen.h ├── DialogUIAttribEdit.cpp ├── DialogUIAttribEdit.h ├── UICommandHistory.cpp ├── PropertyTabLayoutUI.cpp ├── DialogDefaultAttribList.cpp ├── third_party │ └── tinyxml │ │ ├── tinystr.cpp │ │ ├── tinyxmlerror.cpp │ │ └── tinystr.h ├── UIImagePreview.h ├── GlobalVariable.h ├── ToolBoxWnd.h ├── DialogCustomFonts.h ├── ImagePreview.h ├── DialogSkinFileNew.h ├── DialogDefaultAttribList.h ├── GlobalVariable.cpp ├── PropertyTabLayoutUI.h ├── ResourceView.h ├── ImageDialog.h ├── UICommandHistory.h ├── UIUtil.h ├── UIUtil.cpp ├── ToolBoxCtrl.h ├── MultiUITracker.h ├── LayoutManager.h ├── ResourceView.cpp ├── UIProperties.h ├── resource.h └── UIDesigner.vcxproj.filters ├── 开发者名单.txt ├── directui license.txt ├── duilib license.txt ├── DuiLib.sln ├── UIDesigner.sln ├── vs2008 ├── UIDesigner.sln └── DuiLib.sln ├── .gitignore └── ReadMe.md /开发支持.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/开发支持.txt -------------------------------------------------------------------------------- /感谢名单.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/感谢名单.txt -------------------------------------------------------------------------------- /版权说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/版权说明.txt -------------------------------------------------------------------------------- /duilib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/duilib.png -------------------------------------------------------------------------------- /snatshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/snatshot.png -------------------------------------------------------------------------------- /DuiLib/UIList.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIList.h -------------------------------------------------------------------------------- /Control_show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/Control_show.png -------------------------------------------------------------------------------- /DuiLib/UICombo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UICombo.cpp -------------------------------------------------------------------------------- /DuiLib/UIControl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIControl.h -------------------------------------------------------------------------------- /DuiLib/UIRender.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIRender.h -------------------------------------------------------------------------------- /DuiLib/RichEd20.Lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/RichEd20.Lib -------------------------------------------------------------------------------- /DuiLib/UIActiveX.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIActiveX.cpp -------------------------------------------------------------------------------- /DuiLib/UIContainer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIContainer.h -------------------------------------------------------------------------------- /DuiLib/UIControl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIControl.cpp -------------------------------------------------------------------------------- /DuiLib/UIMarkup.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIMarkup.cpp -------------------------------------------------------------------------------- /DuiLib/UIRender.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIRender.cpp -------------------------------------------------------------------------------- /DuiLib/UIRichEdit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIRichEdit.h -------------------------------------------------------------------------------- /UIDesigner/HookAPI.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/HookAPI.h -------------------------------------------------------------------------------- /UIDesigner/MainFrm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/MainFrm.h -------------------------------------------------------------------------------- /UIDesigner/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/stdafx.h -------------------------------------------------------------------------------- /DuiLib/UIContainer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIContainer.cpp -------------------------------------------------------------------------------- /DuiLib/UIDlgBuilder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIDlgBuilder.cpp -------------------------------------------------------------------------------- /DuiLib/UIRichEdit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/DuiLib/UIRichEdit.cpp -------------------------------------------------------------------------------- /UIDesigner/ChildFrm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ChildFrm.cpp -------------------------------------------------------------------------------- /UIDesigner/ChildFrm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ChildFrm.h -------------------------------------------------------------------------------- /UIDesigner/ClassView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ClassView.h -------------------------------------------------------------------------------- /UIDesigner/FileView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/FileView.cpp -------------------------------------------------------------------------------- /UIDesigner/FileView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/FileView.h -------------------------------------------------------------------------------- /UIDesigner/HookAPI.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/HookAPI.cpp -------------------------------------------------------------------------------- /UIDesigner/MainFrm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/MainFrm.cpp -------------------------------------------------------------------------------- /UIDesigner/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ReadMe.txt -------------------------------------------------------------------------------- /UIDesigner/UIDesigner.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesigner.h -------------------------------------------------------------------------------- /UIDesigner/ViewTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ViewTree.cpp -------------------------------------------------------------------------------- /UIDesigner/ViewTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ViewTree.h -------------------------------------------------------------------------------- /UIDesigner/res/sort.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/sort.bmp -------------------------------------------------------------------------------- /UIDesigner/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/stdafx.cpp -------------------------------------------------------------------------------- /UIDesigner/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/targetver.h -------------------------------------------------------------------------------- /UIDesigner/ClassView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ClassView.cpp -------------------------------------------------------------------------------- /UIDesigner/ToolBoxWnd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ToolBoxWnd.cpp -------------------------------------------------------------------------------- /UIDesigner/UIDesigner.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesigner.cpp -------------------------------------------------------------------------------- /UIDesigner/UIDesigner.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesigner.rc -------------------------------------------------------------------------------- /UIDesigner/UIDesigner.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesigner.reg -------------------------------------------------------------------------------- /UIDesigner/UserImages.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UserImages.bmp -------------------------------------------------------------------------------- /UIDesigner/res/banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/banner.bmp -------------------------------------------------------------------------------- /UIDesigner/res/uimenu.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/uimenu.bmp -------------------------------------------------------------------------------- /UIDesigner/ImageDialog.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ImageDialog.cpp -------------------------------------------------------------------------------- /UIDesigner/ImagePreview.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ImagePreview.cpp -------------------------------------------------------------------------------- /UIDesigner/LayoutManager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/LayoutManager.cpp -------------------------------------------------------------------------------- /UIDesigner/PropertiesWnd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/PropertiesWnd.cpp -------------------------------------------------------------------------------- /UIDesigner/PropertiesWnd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/PropertiesWnd.h -------------------------------------------------------------------------------- /UIDesigner/ToolBoxCtrl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/ToolBoxCtrl.cpp -------------------------------------------------------------------------------- /UIDesigner/UIDesigner.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesigner.vcproj -------------------------------------------------------------------------------- /UIDesigner/UIDesignerDoc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesignerDoc.cpp -------------------------------------------------------------------------------- /UIDesigner/UIDesignerDoc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesignerDoc.h -------------------------------------------------------------------------------- /UIDesigner/UIDesignerView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesignerView.h -------------------------------------------------------------------------------- /UIDesigner/UIProperties.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIProperties.cpp -------------------------------------------------------------------------------- /UIDesigner/res/Toolbar.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/Toolbar.bmp -------------------------------------------------------------------------------- /UIDesigner/res/classview.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/classview.bmp -------------------------------------------------------------------------------- /UIDesigner/res/explorer.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/explorer.bmp -------------------------------------------------------------------------------- /UIDesigner/res/file_view.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/file_view.ico -------------------------------------------------------------------------------- /UIDesigner/res/fileview.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/fileview.bmp -------------------------------------------------------------------------------- /UIDesigner/res/formedit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/formedit.bmp -------------------------------------------------------------------------------- /UIDesigner/res/res_view.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/res_view.ico -------------------------------------------------------------------------------- /UIDesigner/res/resource.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/resource.bmp -------------------------------------------------------------------------------- /UIDesigner/res/sort_hc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/sort_hc.bmp -------------------------------------------------------------------------------- /UIDesigner/DialogCheckUpdate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogCheckUpdate.h -------------------------------------------------------------------------------- /UIDesigner/DialogProjectNew.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogProjectNew.h -------------------------------------------------------------------------------- /UIDesigner/DialogSaveAsName.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogSaveAsName.h -------------------------------------------------------------------------------- /UIDesigner/UIDesignerView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIDesignerView.cpp -------------------------------------------------------------------------------- /UIDesigner/UIImagePreview.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UIImagePreview.cpp -------------------------------------------------------------------------------- /UIDesigner/res/Toolbar256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/Toolbar256.bmp -------------------------------------------------------------------------------- /UIDesigner/res/Toolbar_hc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/Toolbar_hc.bmp -------------------------------------------------------------------------------- /UIDesigner/res/UIDesigner.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/UIDesigner.ico -------------------------------------------------------------------------------- /UIDesigner/res/UIDesigner.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/UIDesigner.rc2 -------------------------------------------------------------------------------- /UIDesigner/res/class_view.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/class_view.ico -------------------------------------------------------------------------------- /UIDesigner/res/explorer_hc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/explorer_hc.bmp -------------------------------------------------------------------------------- /UIDesigner/res/fileview_hc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/fileview_hc.bmp -------------------------------------------------------------------------------- /UIDesigner/res/formedit_hc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/formedit_hc.bmp -------------------------------------------------------------------------------- /UIDesigner/res/menuimages.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/menuimages.bmp -------------------------------------------------------------------------------- /UIDesigner/res/movehandle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/movehandle.bmp -------------------------------------------------------------------------------- /UIDesigner/res/properties.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/properties.bmp -------------------------------------------------------------------------------- /UIDesigner/res/res_view_hc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/res_view_hc.ico -------------------------------------------------------------------------------- /UIDesigner/res/resource24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/resource24.bmp -------------------------------------------------------------------------------- /UIDesigner/DialogCheckUpdate.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogCheckUpdate.cpp -------------------------------------------------------------------------------- /UIDesigner/DialogCustomFonts.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogCustomFonts.cpp -------------------------------------------------------------------------------- /UIDesigner/DialogProjectNew.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogProjectNew.cpp -------------------------------------------------------------------------------- /UIDesigner/DialogSaveAsName.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogSaveAsName.cpp -------------------------------------------------------------------------------- /UIDesigner/DialogSkinFileNew.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogSkinFileNew.cpp -------------------------------------------------------------------------------- /UIDesigner/DialogTemplateOpen.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogTemplateOpen.cpp -------------------------------------------------------------------------------- /UIDesigner/DialogTemplateOpen.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogTemplateOpen.h -------------------------------------------------------------------------------- /UIDesigner/DialogUIAttribEdit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogUIAttribEdit.cpp -------------------------------------------------------------------------------- /UIDesigner/DialogUIAttribEdit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogUIAttribEdit.h -------------------------------------------------------------------------------- /UIDesigner/UICommandHistory.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/UICommandHistory.cpp -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Active.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Active.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Button.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Button.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Combo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Combo.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Edit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Edit.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Label.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Label.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Option.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Option.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Slider.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Slider.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Text.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Text.ico -------------------------------------------------------------------------------- /UIDesigner/res/UIDesignerDoc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/UIDesignerDoc.ico -------------------------------------------------------------------------------- /UIDesigner/res/class_view_hc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/class_view_hc.ico -------------------------------------------------------------------------------- /UIDesigner/res/classview_hc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/classview_hc.bmp -------------------------------------------------------------------------------- /UIDesigner/res/file_view_hc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/file_view_hc.ico -------------------------------------------------------------------------------- /UIDesigner/res/menuimages_hc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/menuimages_hc.bmp -------------------------------------------------------------------------------- /UIDesigner/res/properties_hc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/properties_hc.bmp -------------------------------------------------------------------------------- /UIDesigner/res/properties_wnd.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/properties_wnd.ico -------------------------------------------------------------------------------- /UIDesigner/res/toolbox_wnd_hc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/toolbox_wnd_hc.ico -------------------------------------------------------------------------------- /UIDesigner/PropertyTabLayoutUI.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/PropertyTabLayoutUI.cpp -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Control.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Control.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Pointer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Pointer.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Progress.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Progress.ico -------------------------------------------------------------------------------- /UIDesigner/DialogDefaultAttribList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/DialogDefaultAttribList.cpp -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/Container.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/Container.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/ScrollBar.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/ScrollBar.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/TabLayout.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/TabLayout.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/TileLayout.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/TileLayout.ico -------------------------------------------------------------------------------- /UIDesigner/res/properties_wnd_hc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/properties_wnd_hc.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/HorizontalLayout.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/HorizontalLayout.ico -------------------------------------------------------------------------------- /UIDesigner/res/ToolBox/VerticalLayout.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/res/ToolBox/VerticalLayout.ico -------------------------------------------------------------------------------- /UIDesigner/third_party/tinyxml/tinystr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanttobeno/UIDesigner/HEAD/UIDesigner/third_party/tinyxml/tinystr.cpp -------------------------------------------------------------------------------- /开发者名单.txt: -------------------------------------------------------------------------------- 1 | wangchyz@gmail.com 2 | taxueliuyun@gmail.com 3 | achellies@hotmail.com 4 | tojen.me@gmail.com 5 | ljh_0110@163.com 6 | daviyang35@gmail.com:UI Designer -------------------------------------------------------------------------------- /DuiLib/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // UIlib.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | 8 | #pragma comment( lib, "winmm.lib" ) 9 | #pragma comment( lib, "comctl32.lib" ) 10 | -------------------------------------------------------------------------------- /UIDesigner/UIImagePreview.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // CUIImagePreview 5 | 6 | class CUIImagePreview : public CStatic 7 | { 8 | DECLARE_DYNAMIC(CUIImagePreview) 9 | 10 | public: 11 | CUIImagePreview(); 12 | virtual ~CUIImagePreview(); 13 | 14 | private: 15 | CImage m_imgPreview; 16 | 17 | public: 18 | void SetPreviewImage(LPCTSTR pstrImage); 19 | 20 | protected: 21 | DECLARE_MESSAGE_MAP() 22 | public: 23 | afx_msg void OnPaint(); 24 | }; -------------------------------------------------------------------------------- /UIDesigner/GlobalVariable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CGlobalVariable 4 | { 5 | public: 6 | CGlobalVariable(void); 7 | ~CGlobalVariable(void); 8 | 9 | public: 10 | static CString& GetCurPath(); 11 | static CString& GetTemplatesDir(); 12 | static CString& GetStylesDir(); 13 | 14 | public: 15 | static bool m_bIsProjectExist; 16 | static CString m_strProjectName; 17 | static CString m_strProjectPath; 18 | 19 | private: 20 | static CString m_strCurPath; 21 | static CString m_strTemplatesDir; 22 | static CString m_strStylesDir; 23 | }; 24 | -------------------------------------------------------------------------------- /directui license.txt: -------------------------------------------------------------------------------- 1 | DirectUI - UI Library 2 | 3 | Written by Bjarke Viksoe (bjarke@viksoe.dk) 4 | Copyright (c) 2006-2007 Bjarke Viksoe. 5 | 6 | This code may be used in compiled form in any way you desire. These 7 | source files may be redistributed by any means PROVIDING it is 8 | not sold for profit without the authors written consent, and 9 | providing that this notice and the authors name is included. 10 | 11 | This file is provided "as is" with no expressed or implied warranty. 12 | The author accepts no liability if it causes any damage to you or your 13 | computer whatsoever. It's free, so don't hassle me about it. 14 | Beware of bugs. -------------------------------------------------------------------------------- /UIDesigner/ToolBoxWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ToolBoxCtrl.h" 3 | 4 | // CToolBoxWnd 5 | 6 | class CToolBoxWnd : public CDockablePane 7 | { 8 | DECLARE_DYNAMIC(CToolBoxWnd) 9 | 10 | public: 11 | CToolBoxWnd(); 12 | virtual ~CToolBoxWnd(); 13 | 14 | protected: 15 | CToolBoxCtrl m_ctlToolList; 16 | 17 | public: 18 | CToolElement* GetCurSel() const { return m_ctlToolList.GetCurSel(); } 19 | void SetCurSel(int nClass,BOOL bRedraw=TRUE) { m_ctlToolList.SetCurSel(nClass,bRedraw); } 20 | 21 | protected: 22 | void AdjustLayout(); 23 | void InitToolList(); 24 | 25 | protected: 26 | DECLARE_MESSAGE_MAP() 27 | public: 28 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 29 | afx_msg void OnSize(UINT nType, int cx, int cy); 30 | }; 31 | 32 | 33 | -------------------------------------------------------------------------------- /UIDesigner/DialogCustomFonts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | 4 | 5 | // CDialogCustomFonts dialog 6 | 7 | class CDialogCustomFonts : public CDialog 8 | { 9 | DECLARE_DYNAMIC(CDialogCustomFonts) 10 | 11 | public: 12 | CDialogCustomFonts(CWnd* pParent = NULL); // standard constructor 13 | virtual ~CDialogCustomFonts(); 14 | 15 | // Dialog Data 16 | enum { IDD = IDD_DIALOG_CUSTOM_FONTS }; 17 | 18 | private: 19 | CPaintManagerUI* m_pManager; 20 | 21 | protected: 22 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 23 | 24 | DECLARE_MESSAGE_MAP() 25 | public: 26 | virtual BOOL OnInitDialog(); 27 | CListCtrl m_lstCustomFonts; 28 | afx_msg void OnBnClickedButtonFontAdd(); 29 | afx_msg void OnBnClickedButtonFontDelete(); 30 | afx_msg void OnBnClickedButtonFontModify(); 31 | }; 32 | -------------------------------------------------------------------------------- /UIDesigner/ImagePreview.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../DuiLib/UIRender.h" 3 | 4 | ////////////////////////////////////////////////////////////////////////// 5 | // CImagePreview 6 | 7 | class CImagePreview : public CStatic 8 | { 9 | DECLARE_DYNAMIC(CImagePreview) 10 | 11 | public: 12 | CImagePreview(); 13 | virtual ~CImagePreview(); 14 | 15 | public: 16 | void SetImageProperty(LPCTSTR pstrImage,CRect& rcDest,CRect& rcSource,CRect& rcCorner,COLORREF clrMask,int nFade,BOOL bHole); 17 | LPCTSTR GetImageProperty() const { return m_strProperty; } 18 | void SetManager(CPaintManagerUI* pManager); 19 | 20 | private: 21 | CString m_strImage; 22 | CString m_strProperty; 23 | CRect m_rcImage; 24 | CPaintManagerUI* m_pManager; 25 | 26 | protected: 27 | DECLARE_MESSAGE_MAP() 28 | public: 29 | afx_msg void OnPaint(); 30 | }; 31 | 32 | 33 | -------------------------------------------------------------------------------- /UIDesigner/DialogSkinFileNew.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | #include "UIImagePreview.h" 4 | 5 | // CDialogSkinFileNew dialog 6 | 7 | class CDialogSkinFileNew : public CDialog 8 | { 9 | DECLARE_DYNAMIC(CDialogSkinFileNew) 10 | 11 | public: 12 | CDialogSkinFileNew(CWnd* pParent = NULL); // standard constructor 13 | virtual ~CDialogSkinFileNew(); 14 | 15 | // Dialog Data 16 | enum { IDD = IDD_SKINFILE_NEW }; 17 | 18 | protected: 19 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 20 | 21 | public: 22 | CString& GetStyleFilePath(); 23 | 24 | private: 25 | void FindStyleFiles(CString& strDir); 26 | 27 | DECLARE_MESSAGE_MAP() 28 | public: 29 | CString m_strUITitle; 30 | 31 | private: 32 | CListBox m_lstStyles; 33 | CUIImagePreview m_StylePreview; 34 | CString m_strStyleFile; 35 | 36 | public: 37 | virtual BOOL OnInitDialog(); 38 | afx_msg void OnLbnSelchangeListStyle(); 39 | afx_msg void OnBnClickedOk(); 40 | }; 41 | -------------------------------------------------------------------------------- /DuiLib/UIDlgBuilder.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIDLGBUILDER_H__ 2 | #define __UIDLGBUILDER_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | 8 | class IDialogBuilderCallback 9 | { 10 | public: 11 | virtual CControlUI* CreateControl(LPCTSTR pstrClass) = 0; 12 | }; 13 | 14 | 15 | class UILIB_API CDialogBuilder 16 | { 17 | public: 18 | CDialogBuilder(); 19 | CControlUI* Create(STRINGorID xml, LPCTSTR type = NULL, IDialogBuilderCallback* pCallback = NULL, 20 | CPaintManagerUI* pManager = NULL, CControlUI* pParent = NULL); 21 | CControlUI* Create(IDialogBuilderCallback* pCallback = NULL, CPaintManagerUI* pManager = NULL, 22 | CControlUI* pParent = NULL); 23 | 24 | CMarkup* GetMarkup(); 25 | 26 | void GetLastErrorMessage(LPTSTR pstrMessage, SIZE_T cchMax) const; 27 | void GetLastErrorLocation(LPTSTR pstrSource, SIZE_T cchMax) const; 28 | private: 29 | CControlUI* _Parse(CMarkupNode* parent, CControlUI* pParent = NULL, CPaintManagerUI* pManager = NULL); 30 | 31 | CMarkup m_xml; 32 | IDialogBuilderCallback* m_pCallback; 33 | LPCTSTR m_pstrtype; 34 | }; 35 | 36 | } // namespace DuiLib 37 | 38 | #endif // __UIDLGBUILDER_H__ 39 | -------------------------------------------------------------------------------- /UIDesigner/DialogDefaultAttribList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | #include "UIProperties.h" 4 | 5 | ////////////////////////////////////////////////////////////////////////// 6 | // CDialogDefaultAttribList dialog 7 | 8 | class CDialogDefaultAttribList : public CDialog 9 | { 10 | DECLARE_DYNAMIC(CDialogDefaultAttribList) 11 | 12 | public: 13 | CDialogDefaultAttribList(CWnd* pParent = NULL); // standard constructor 14 | virtual ~CDialogDefaultAttribList(); 15 | 16 | // Dialog Data 17 | enum { IDD = IDD_DIALOG_DEFAULT_ATTRIB_LIST }; 18 | 19 | private: 20 | CUIProperties m_wndUIProperties; 21 | CPaintManagerUI* m_pManager; 22 | 23 | protected: 24 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 25 | 26 | DECLARE_MESSAGE_MAP() 27 | protected: 28 | virtual BOOL OnInitDialog(); 29 | BOOL GetDefaultAttrib(CControlUI* pControl, CString& strValue); 30 | 31 | private: 32 | CStatic m_wndUIPropLocation; 33 | CMFCMenuButton m_btnAdd; 34 | CMenu m_menuUI; 35 | CListBox m_lstDefaultAttrib; 36 | public: 37 | afx_msg void OnBnClickedButtonAttribAdd(); 38 | afx_msg void OnBnClickedButtonAttribDelete(); 39 | afx_msg void OnBnClickedButtonAttribModify(); 40 | afx_msg void OnLbnSelchangeListDefaultAttrib(); 41 | afx_msg void OnDestroy(); 42 | afx_msg void OnBnClickedButtonSaveAsStyle(); 43 | }; 44 | -------------------------------------------------------------------------------- /duilib license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2011, duilib develop team(www.duilib.com).All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met. 4 | 5 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /UIDesigner/GlobalVariable.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "GlobalVariable.h" 3 | 4 | bool CGlobalVariable::m_bIsProjectExist = false; 5 | CString CGlobalVariable::m_strProjectName; 6 | CString CGlobalVariable::m_strProjectPath; 7 | CString CGlobalVariable::m_strCurPath; 8 | CString CGlobalVariable::m_strTemplatesDir; 9 | CString CGlobalVariable::m_strStylesDir; 10 | 11 | CGlobalVariable::CGlobalVariable(void) 12 | { 13 | } 14 | 15 | CGlobalVariable::~CGlobalVariable(void) 16 | { 17 | } 18 | 19 | CString& CGlobalVariable::GetCurPath() 20 | { 21 | if(m_strCurPath.IsEmpty()) 22 | { 23 | TCHAR szFileName[MAX_PATH] = {0}; 24 | ::GetModuleFileName(NULL, szFileName, MAX_PATH); 25 | m_strCurPath = szFileName; 26 | int nPos = m_strCurPath.ReverseFind('\\'); 27 | if(nPos != -1) 28 | m_strCurPath = m_strCurPath.Left(nPos + 1); 29 | } 30 | 31 | return m_strCurPath; 32 | } 33 | 34 | CString& CGlobalVariable::GetTemplatesDir() 35 | { 36 | if(m_strTemplatesDir.IsEmpty()) 37 | { 38 | m_strTemplatesDir = GetCurPath() + DIR_TEMPLATES; 39 | CreateDirectory(m_strTemplatesDir, NULL); 40 | } 41 | 42 | return m_strTemplatesDir; 43 | } 44 | 45 | CString& CGlobalVariable::GetStylesDir() 46 | { 47 | if(m_strStylesDir.IsEmpty()) 48 | { 49 | m_strStylesDir = GetCurPath() + DIR_STYLES; 50 | CreateDirectory(m_strStylesDir, NULL); 51 | } 52 | 53 | return m_strStylesDir; 54 | } -------------------------------------------------------------------------------- /DuiLib.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DuiLib", "DuiLib\DuiLib.vcxproj", "{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | UnicodeDebug|Win32 = UnicodeDebug|Win32 13 | UnicodeRelease|Win32 = UnicodeRelease|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Debug|Win32.Build.0 = Debug|Win32 18 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Release|Win32.ActiveCfg = Release|Win32 19 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Release|Win32.Build.0 = Release|Win32 20 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeDebug|Win32.ActiveCfg = UnicodeDebug|Win32 21 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeDebug|Win32.Build.0 = UnicodeDebug|Win32 22 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeRelease|Win32.ActiveCfg = UnicodeRelease|Win32 23 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeRelease|Win32.Build.0 = UnicodeRelease|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /UIDesigner/PropertyTabLayoutUI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | 4 | ////////////////////////////////////////////////////////////////////////// 5 | //CSingleCheckListBox 6 | 7 | class CSingleCheckListBox : public CCheckListBox 8 | { 9 | DECLARE_DYNAMIC(CSingleCheckListBox) 10 | 11 | public: 12 | static int m_nLastChecked; 13 | 14 | protected: 15 | //{{AFX_MSG(CSingleCheckListBox) 16 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 17 | afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); 18 | afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 19 | //}}AFX_MSG 20 | DECLARE_MESSAGE_MAP() 21 | }; 22 | 23 | ////////////////////////////////////////////////////////////////////////// 24 | // CPropertyTabLayoutUI Dialog 25 | 26 | class CPropertyTabLayoutUI : public CDialog 27 | { 28 | DECLARE_DYNAMIC(CPropertyTabLayoutUI) 29 | 30 | public: 31 | CPropertyTabLayoutUI(CControlUI* const pControl,CWnd* pParent = NULL); // standard constructor 32 | virtual ~CPropertyTabLayoutUI(); 33 | 34 | // Dialog Data 35 | enum { IDD = IDD_PROPERTY_TABLAYOUTUI }; 36 | 37 | private: 38 | CSingleCheckListBox m_lstTab; 39 | CMFCMenuButton m_btnAdd; 40 | CMenu m_menuUI; 41 | 42 | CTabLayoutUI* m_pTablayoutUI; 43 | 44 | protected: 45 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 46 | 47 | DECLARE_MESSAGE_MAP() 48 | public: 49 | virtual BOOL OnInitDialog(); 50 | afx_msg void OnBnClickedButtonTabLayoutUIAdd(); 51 | afx_msg void OnBnClickedOk(); 52 | }; 53 | -------------------------------------------------------------------------------- /UIDesigner.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UIDesigner", "UIDesigner\UIDesigner.vcxproj", "{8CC28A8B-CD88-44A7-8994-066CCD8938CB}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DuiLib", "DuiLib\DuiLib.vcxproj", "{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | UnicodeDebug|Win32 = UnicodeDebug|Win32 13 | UnicodeRelease|Win32 = UnicodeRelease|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {8CC28A8B-CD88-44A7-8994-066CCD8938CB}.UnicodeDebug|Win32.ActiveCfg = UnicodeDebug|Win32 17 | {8CC28A8B-CD88-44A7-8994-066CCD8938CB}.UnicodeDebug|Win32.Build.0 = UnicodeDebug|Win32 18 | {8CC28A8B-CD88-44A7-8994-066CCD8938CB}.UnicodeRelease|Win32.ActiveCfg = UnicodeRelease|Win32 19 | {8CC28A8B-CD88-44A7-8994-066CCD8938CB}.UnicodeRelease|Win32.Build.0 = UnicodeRelease|Win32 20 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeDebug|Win32.ActiveCfg = UnicodeDebug|Win32 21 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeDebug|Win32.Build.0 = UnicodeDebug|Win32 22 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeRelease|Win32.ActiveCfg = UnicodeRelease|Win32 23 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeRelease|Win32.Build.0 = UnicodeRelease|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /DuiLib/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__E30B2003_188B_4EB4_AB99_3F3734D6CE6C__INCLUDED_) 7 | #define AFX_STDAFX_H__E30B2003_188B_4EB4_AB99_3F3734D6CE6C__INCLUDED_ 8 | 9 | #pragma once 10 | 11 | #define _CRT_SECURE_NO_DEPRECATE 12 | 13 | // Remove pointless warning messages 14 | #ifdef _MSC_VER 15 | #pragma warning (disable : 4511) // copy operator could not be generated 16 | #pragma warning (disable : 4512) // assignment operator could not be generated 17 | #pragma warning (disable : 4702) // unreachable code (bugs in Microsoft's STL) 18 | #pragma warning (disable : 4786) // identifier was truncated 19 | #pragma warning (disable : 4996) // function or variable may be unsafe (deprecated) 20 | #ifndef _CRT_SECURE_NO_WARNINGS 21 | #define _CRT_SECURE_NO_WARNINGS // eliminate deprecation warnings for VS2005 22 | #endif 23 | #endif // _MSC_VER 24 | #ifdef __BORLANDC__ 25 | #pragma option -w-8027 // function not expanded inline 26 | #endif 27 | 28 | // Required for VS 2008 (fails on XP and Win2000 without this fix) 29 | #ifndef _WIN32_WINNT 30 | #define _WIN32_WINNT 0x0500 31 | #endif 32 | 33 | #include "UIlib.h" 34 | 35 | #include 36 | 37 | #define lengthof(x) (sizeof(x)/sizeof(*x)) 38 | #define MAX max 39 | #define MIN min 40 | #define CLAMP(x,a,b) (MIN(b,MAX(a,x))) 41 | 42 | //{{AFX_INSERT_LOCATION}} 43 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 44 | 45 | #endif // !defined(AFX_STDAFX_H__E30B2003_188B_4EB4_AB99_3F3734D6CE6C__INCLUDED_) 46 | -------------------------------------------------------------------------------- /vs2008/UIDesigner.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UIDesigner", "UIDesigner\UIDesigner.vcproj", "{8CC28A8B-CD88-44A7-8994-066CCD8938CB}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E} = {E106ACD7-4E53-4AEE-942B-D0DD426DB34E} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DuiLib", "DuiLib\DuiLib.vcproj", "{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | UnicodeDebug|Win32 = UnicodeDebug|Win32 14 | UnicodeRelease|Win32 = UnicodeRelease|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8CC28A8B-CD88-44A7-8994-066CCD8938CB}.UnicodeDebug|Win32.ActiveCfg = UnicodeDebug|Win32 18 | {8CC28A8B-CD88-44A7-8994-066CCD8938CB}.UnicodeDebug|Win32.Build.0 = UnicodeDebug|Win32 19 | {8CC28A8B-CD88-44A7-8994-066CCD8938CB}.UnicodeRelease|Win32.ActiveCfg = UnicodeRelease|Win32 20 | {8CC28A8B-CD88-44A7-8994-066CCD8938CB}.UnicodeRelease|Win32.Build.0 = UnicodeRelease|Win32 21 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeDebug|Win32.ActiveCfg = UnicodeDebug|Win32 22 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeDebug|Win32.Build.0 = UnicodeDebug|Win32 23 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeRelease|Win32.ActiveCfg = UnicodeRelease|Win32 24 | {E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.UnicodeRelease|Win32.Build.0 = UnicodeRelease|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /UIDesigner/ResourceView.h: -------------------------------------------------------------------------------- 1 | // This is a part of the Microsoft Foundation Classes C++ library. 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // This source code is only intended as a supplement to the 5 | // Microsoft Foundation Classes Reference and related 6 | // electronic documentation provided with the library. 7 | // See these sources for detailed information regarding the 8 | // Microsoft Foundation Classes product. 9 | 10 | #pragma once 11 | 12 | class CResourceViewBar : public CDockablePane 13 | { 14 | // Construction 15 | public: 16 | CResourceViewBar(); 17 | 18 | // Attributes 19 | protected: 20 | CViewTree m_wndResourceView; 21 | CImageList m_ResourceViewImages; 22 | 23 | public: 24 | void OnChangeVisualStyle(); 25 | 26 | void InsertImageTree(CString strTitle, CString strPath); 27 | void RemoveImageTree(CString strTree); 28 | void RenameImageTree(LPCTSTR pstrTree, LPCTSTR pstrNewName); 29 | void InsertImage(CString strImage, CString strTree); 30 | const CStringArray* GetImageTree(CString strTree) const; 31 | void CopyImageToSkinDir(LPCTSTR pstrSkinDir, LPCTSTR pstrTree); 32 | 33 | protected: 34 | void InitResourceView(); 35 | 36 | private: 37 | CMapStringToPtr m_mapTree; 38 | CMapStringToPtr m_mapImageArray; 39 | 40 | // Implementation 41 | public: 42 | virtual ~CResourceViewBar(); 43 | 44 | protected: 45 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 46 | afx_msg void OnSize(UINT nType, int cx, int cy); 47 | afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); 48 | afx_msg void OnEditCut(); 49 | afx_msg void OnEditCopy(); 50 | afx_msg void OnEditPaste(); 51 | afx_msg void OnEditClear(); 52 | afx_msg void OnPaint(); 53 | afx_msg void OnSetFocus(CWnd* pOldWnd); 54 | 55 | DECLARE_MESSAGE_MAP() 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /DuiLib/UIActiveX.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIACTIVEX_H__ 2 | #define __UIACTIVEX_H__ 3 | 4 | #pragma once 5 | 6 | struct IOleObject; 7 | 8 | namespace DuiLib { 9 | ///////////////////////////////////////////////////////////////////////////////////// 10 | // 11 | 12 | class CActiveXCtrl; 13 | 14 | template< class T > 15 | class CSafeRelease 16 | { 17 | public: 18 | CSafeRelease(T* p) : m_p(p) { }; 19 | ~CSafeRelease() { if( m_p != NULL ) m_p->Release(); }; 20 | T* Detach() { T* t = m_p; m_p = NULL; return t; }; 21 | T* m_p; 22 | }; 23 | 24 | ///////////////////////////////////////////////////////////////////////////////////// 25 | // 26 | 27 | class UILIB_API CActiveXUI : public CControlUI, public IMessageFilterUI 28 | { 29 | friend CActiveXCtrl; 30 | public: 31 | CActiveXUI(); 32 | virtual ~CActiveXUI(); 33 | 34 | LPCTSTR GetClass() const; 35 | LPVOID GetInterface(LPCTSTR pstrName); 36 | 37 | HWND GetHostWindow() const; 38 | 39 | bool IsDelayCreate() const; 40 | void SetDelayCreate(bool bDelayCreate = true); 41 | 42 | bool CreateControl(const CLSID clsid); 43 | bool CreateControl(LPCTSTR pstrCLSID); 44 | HRESULT GetControl(const IID iid, LPVOID* ppRet); 45 | CLSID GetClisd() const; 46 | CStdString GetModuleName() const; 47 | void SetModuleName(LPCTSTR pstrText); 48 | 49 | void SetVisible(bool bVisible = true); 50 | void SetInternVisible(bool bVisible = true); 51 | void SetPos(RECT rc); 52 | void DoPaint(HDC hDC, const RECT& rcPaint); 53 | 54 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 55 | 56 | LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled); 57 | 58 | protected: 59 | void ReleaseControl(); 60 | bool DoCreateControl(); 61 | 62 | protected: 63 | CLSID m_clsid; 64 | CStdString m_sModuleName; 65 | bool m_bCreated; 66 | bool m_bDelayCreate; 67 | IOleObject* m_pUnk; 68 | CActiveXCtrl* m_pControl; 69 | HWND m_hwndHost; 70 | }; 71 | 72 | } // namespace DuiLib 73 | 74 | #endif // __UIACTIVEX_H__ 75 | -------------------------------------------------------------------------------- /UIDesigner/third_party/tinyxml/tinyxmlerror.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | www.sourceforge.net/projects/tinyxml 3 | Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any 7 | damages arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any 10 | purpose, including commercial applications, and to alter it and 11 | redistribute it freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must 14 | not claim that you wrote the original software. If you use this 15 | software in a product, an acknowledgment in the product documentation 16 | would be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and 19 | must not be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #include "tinyxml.h" 26 | 27 | // The goal of the seperate error file is to make the first 28 | // step towards localization. tinyxml (currently) only supports 29 | // english error messages, but the could now be translated. 30 | // 31 | // It also cleans up the code a bit. 32 | // 33 | 34 | const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] = 35 | { 36 | "No error", 37 | "Error", 38 | "Failed to open file", 39 | "Memory allocation failed.", 40 | "Error parsing Element.", 41 | "Failed to read Element name", 42 | "Error reading Element value.", 43 | "Error reading Attributes.", 44 | "Error: empty tag.", 45 | "Error reading end tag.", 46 | "Error parsing Unknown.", 47 | "Error parsing Comment.", 48 | "Error parsing Declaration.", 49 | "Error document empty.", 50 | "Error null (0) or unexpected EOF found in input stream.", 51 | "Error parsing CDATA.", 52 | "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.", 53 | }; 54 | -------------------------------------------------------------------------------- /DuiLib/UIlib.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010-2011, duilib develop team(www.duilib.com). 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or 5 | // without modification, are permitted provided that the 6 | // following conditions are met. 7 | // 8 | // Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following 13 | // disclaimer in the documentation and/or other materials 14 | // provided with the distribution. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 17 | // CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 23 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifdef UILIB_EXPORTS 31 | #define UILIB_API __declspec(dllexport) 32 | #else 33 | #define UILIB_API __declspec(dllimport) 34 | #endif 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | #include "UIBase.h" 47 | #include "UIManager.h" 48 | #include "UIDelegate.h" 49 | #include "UIControl.h" 50 | #include "UIContainer.h" 51 | #include "UICommonControls.h" 52 | #include "UIList.h" 53 | #include "UICombo.h" 54 | #include "UIActiveX.h" 55 | #include "UIRichEdit.h" 56 | 57 | #include "UIMarkup.h" 58 | #include "UIDlgBuilder.h" 59 | #include "UIRender.h" 60 | 61 | -------------------------------------------------------------------------------- /UIDesigner/ImageDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | #include "afxcmn.h" 4 | #include "ImagePreview.h" 5 | 6 | ////////////////////////////////////////////////////////////////////////// 7 | //CMyColorButton 8 | 9 | class CMyColorButton : public CMFCColorButton 10 | { 11 | DECLARE_DYNAMIC(CMyColorButton) 12 | 13 | protected: 14 | virtual void OnDraw(CDC* pDC, const CRect& rect, UINT uiState); 15 | }; 16 | 17 | ////////////////////////////////////////////////////////////////////////// 18 | // CImageDialog dialog 19 | 20 | class CImageDialog : public CDialog 21 | { 22 | DECLARE_DYNAMIC(CImageDialog) 23 | 24 | public: 25 | CImageDialog(const CString& strImageProperty, CWnd* pParent = NULL); 26 | virtual ~CImageDialog(); 27 | 28 | // Dialog Data 29 | enum { IDD = IDD_DIALOG_IMAGE }; 30 | 31 | public: 32 | CString GetImage() const; 33 | 34 | private: 35 | CString m_strImageProperty; 36 | CString m_strImagePathName; 37 | CRect m_rcDest; 38 | CRect m_rcSource; 39 | CRect m_rcCorner; 40 | CPaintManagerUI* m_pManager; 41 | 42 | static const CString m_strNullImage; 43 | CStringArray m_strImageArray; 44 | 45 | protected: 46 | RECT StringToRect(CString& str); 47 | void SetImageProperty(LPCTSTR pstrPathName); 48 | 49 | protected: 50 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 51 | 52 | DECLARE_MESSAGE_MAP() 53 | 54 | protected: 55 | virtual BOOL OnInitDialog(); 56 | CListBox m_lstImages; 57 | CString m_strDest; 58 | CString m_strSource; 59 | CString m_strCorner; 60 | CMyColorButton m_btnMask; 61 | CSliderCtrl m_ctlFade; 62 | int m_nFade; 63 | BOOL m_bHole; 64 | CImagePreview m_ImagePreview; 65 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 66 | afx_msg void OnBnClickedButtonImageImport(); 67 | afx_msg void OnBnClickedButtonImageClear(); 68 | virtual BOOL PreTranslateMessage(MSG* pMsg); 69 | afx_msg void OnEnKillfocusEditImageFade(); 70 | afx_msg void OnLbnDblclkListImageResource(); 71 | afx_msg void OnDestroy(); 72 | afx_msg void OnEnKillfocusEditImageDest(); 73 | afx_msg void OnEnKillfocusEditImageSource(); 74 | afx_msg void OnEnKillfocusEditImageCorner(); 75 | afx_msg void OnBnClickedButtonImageMask(); 76 | afx_msg void OnBnClickedRadioImageHoleFalse(); 77 | afx_msg void OnBnClickedRadioImageHoleTrue(); 78 | afx_msg void OnBnClickedOk(); 79 | }; 80 | -------------------------------------------------------------------------------- /DuiLib/UIDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | 3 | namespace DuiLib { 4 | 5 | CDelegateBase::CDelegateBase(void* pObject, void* pFn) 6 | { 7 | m_pObject = pObject; 8 | m_pFn = pFn; 9 | } 10 | 11 | CDelegateBase::CDelegateBase(const CDelegateBase& rhs) 12 | { 13 | m_pObject = rhs.m_pObject; 14 | m_pFn = rhs.m_pFn; 15 | } 16 | 17 | CDelegateBase::~CDelegateBase() 18 | { 19 | 20 | } 21 | 22 | bool CDelegateBase::Equals(const CDelegateBase& rhs) const 23 | { 24 | return m_pObject == rhs.m_pObject && m_pFn == rhs.m_pFn; 25 | } 26 | 27 | bool CDelegateBase::operator() (void* param) 28 | { 29 | return Invoke(param); 30 | } 31 | 32 | void* CDelegateBase::GetFn() 33 | { 34 | return m_pFn; 35 | } 36 | 37 | void* CDelegateBase::GetObject() 38 | { 39 | return m_pObject; 40 | } 41 | 42 | CEventSource::~CEventSource() 43 | { 44 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 45 | CDelegateBase* pObject = static_cast(m_aDelegates[i]); 46 | if( pObject) delete pObject; 47 | } 48 | } 49 | 50 | CEventSource::operator bool() 51 | { 52 | return m_aDelegates.GetSize() > 0; 53 | } 54 | 55 | void CEventSource::operator+= (CDelegateBase& d) 56 | { 57 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 58 | CDelegateBase* pObject = static_cast(m_aDelegates[i]); 59 | if( pObject && pObject->Equals(d) ) return; 60 | } 61 | 62 | m_aDelegates.Add(d.Copy()); 63 | } 64 | 65 | void CEventSource::operator+= (FnType pFn) 66 | { 67 | (*this) += MakeDelegate(pFn); 68 | } 69 | 70 | void CEventSource::operator-= (CDelegateBase& d) 71 | { 72 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 73 | CDelegateBase* pObject = static_cast(m_aDelegates[i]); 74 | if( pObject && pObject->Equals(d) ) { 75 | delete pObject; 76 | m_aDelegates.Remove(i); 77 | return; 78 | } 79 | } 80 | } 81 | void CEventSource::operator-= (FnType pFn) 82 | { 83 | (*this) -= MakeDelegate(pFn); 84 | } 85 | 86 | bool CEventSource::operator() (void* param) 87 | { 88 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 89 | CDelegateBase* pObject = static_cast(m_aDelegates[i]); 90 | if( pObject && !(*pObject)(param) ) return false; 91 | } 92 | return true; 93 | } 94 | 95 | } // namespace DuiLib 96 | -------------------------------------------------------------------------------- /DuiLib/UIDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIDELEGATE_H__ 2 | #define __UIDELEGATE_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | 8 | class UILIB_API CDelegateBase 9 | { 10 | public: 11 | CDelegateBase(void* pObject, void* pFn); 12 | CDelegateBase(const CDelegateBase& rhs); 13 | virtual ~CDelegateBase(); 14 | bool Equals(const CDelegateBase& rhs) const; 15 | bool operator() (void* param); 16 | virtual CDelegateBase* Copy() = 0; 17 | 18 | protected: 19 | void* GetFn(); 20 | void* GetObject(); 21 | virtual bool Invoke(void* param) = 0; 22 | 23 | private: 24 | void* m_pObject; 25 | void* m_pFn; 26 | }; 27 | 28 | class CDelegateStatic: public CDelegateBase 29 | { 30 | typedef bool (*Fn)(void*); 31 | public: 32 | CDelegateStatic(Fn pFn) : CDelegateBase(NULL, pFn) { } 33 | CDelegateStatic(const CDelegateStatic& rhs) : CDelegateBase(rhs) { } 34 | virtual CDelegateBase* Copy() { return new CDelegateStatic(*this); } 35 | 36 | protected: 37 | virtual bool Invoke(void* param) 38 | { 39 | Fn pFn = (Fn)GetFn(); 40 | return (*pFn)(param); 41 | } 42 | }; 43 | 44 | template 45 | class CDelegate : public CDelegateBase 46 | { 47 | typedef bool (T::* Fn)(void*); 48 | public: 49 | CDelegate(O* pObj, Fn pFn) : CDelegateBase(pObj, &pFn), m_pFn(pFn) { } 50 | CDelegate(const CDelegate& rhs) : CDelegateBase(rhs) { m_pFn = rhs.m_pFn; } 51 | virtual CDelegateBase* Copy() { return new CDelegate(*this); } 52 | 53 | protected: 54 | virtual bool Invoke(void* param) 55 | { 56 | O* pObject = (O*) GetObject(); 57 | return (pObject->*m_pFn)(param); 58 | } 59 | 60 | private: 61 | Fn m_pFn; 62 | }; 63 | 64 | template 65 | CDelegate MakeDelegate(O* pObject, bool (T::* pFn)(void*)) 66 | { 67 | return CDelegate(pObject, pFn); 68 | } 69 | 70 | inline CDelegateStatic MakeDelegate(bool (*pFn)(void*)) 71 | { 72 | return CDelegateStatic(pFn); 73 | } 74 | 75 | class UILIB_API CEventSource 76 | { 77 | typedef bool (*FnType)(void*); 78 | public: 79 | ~CEventSource(); 80 | operator bool(); 81 | void operator+= (CDelegateBase& d); 82 | void operator+= (FnType pFn); 83 | void operator-= (CDelegateBase& d); 84 | void operator-= (FnType pFn); 85 | bool operator() (void* param); 86 | 87 | protected: 88 | CStdPtrArray m_aDelegates; 89 | }; 90 | 91 | } // namespace DuiLib 92 | 93 | #endif // __UIDELEGATE_H__ -------------------------------------------------------------------------------- /DuiLib/UIlib.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010-2011, duilib develop team(www.duilib.com). 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or 5 | // without modification, are permitted provided that the 6 | // following conditions are met. 7 | // 8 | // Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following 13 | // disclaimer in the documentation and/or other materials 14 | // provided with the distribution. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 17 | // CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 23 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // 31 | // DirectUI - UI Library 32 | // 33 | // Written by Bjarke Viksoe (bjarke@viksoe.dk) 34 | // Copyright (c) 2006-2007 Bjarke Viksoe. 35 | // 36 | // This code may be used in compiled form in any way you desire. These 37 | // source files may be redistributed by any means PROVIDING it is 38 | // not sold for profit without the authors written consent, and 39 | // providing that this notice and the authors name is included. 40 | // 41 | // This file is provided "as is" with no expressed or implied warranty. 42 | // The author accepts no liability if it causes any damage to you or your 43 | // computer whatsoever. It's free, so don't hassle me about it. 44 | // 45 | // Beware of bugs. 46 | // 47 | // 48 | 49 | 50 | #include "stdafx.h" 51 | #include "UIlib.h" 52 | 53 | 54 | BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID /*lpReserved*/) 55 | { 56 | switch( dwReason ) { 57 | case DLL_PROCESS_ATTACH: 58 | case DLL_THREAD_ATTACH: 59 | case DLL_THREAD_DETACH: 60 | case DLL_PROCESS_DETACH: 61 | ::DisableThreadLibraryCalls((HMODULE)hModule); 62 | break; 63 | } 64 | return TRUE; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /UIDesigner/UICommandHistory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "UIDesignerView.h" 3 | #include "tinyxml.h" 4 | #include "..\DuiLib\UIlib.h" 5 | using DuiLib::CContainerUI; 6 | 7 | enum CommandType 8 | { 9 | cmdUndo, 10 | cmdRedo, 11 | }; 12 | enum ActionType 13 | { 14 | actionAdd, 15 | actionDelete, 16 | actionModify, 17 | }; 18 | 19 | ////////////////////////////////////////////////////////////////////////// 20 | //CUICommandElement 21 | 22 | class CUICommandNode; 23 | class CUICommandHistory; 24 | 25 | class CUICommandElement 26 | { 27 | friend CUICommandNode; 28 | friend CUICommandHistory; 29 | 30 | public: 31 | CUICommandElement(); 32 | CUICommandElement(CArray& arrSelected, BOOL bModify); 33 | CUICommandElement(const CUICommandElement& copy); 34 | 35 | ~CUICommandElement(); 36 | 37 | protected: 38 | TiXmlElement* m_pElementXml; 39 | }; 40 | 41 | ////////////////////////////////////////////////////////////////////////// 42 | //CUICommandNode 43 | 44 | class CUICommandHistory; 45 | 46 | class CUICommandNode 47 | { 48 | friend CUICommandHistory; 49 | 50 | public: 51 | CUICommandNode(ActionType type); 52 | CUICommandNode(CUICommandElement* pBefore, CUICommandElement* pAfter, ActionType type); 53 | 54 | ~CUICommandNode(); 55 | 56 | public: 57 | void Begin(CArray& arrSelected); 58 | void Begin(CControlUI* pControl, LPCTSTR pstrName, LPCTSTR pstrValue); 59 | void End(); 60 | void End(CControlUI* pControl, LPCTSTR pstrName, LPCTSTR pstrValue); 61 | 62 | protected: 63 | BOOL RemoveSameProperties(TiXmlNode* pBeforeElem, TiXmlNode* pAfterElem); 64 | inline void RemoveSameProperty(TiXmlNode* pBeforeElem, TiXmlNode* pAfterElem); 65 | 66 | protected: 67 | ActionType m_ActionType; 68 | CUICommandElement* m_pBefore; 69 | CUICommandElement* m_pAfter; 70 | CArray* m_pAllSelected; 71 | CControlUI* m_pControl; 72 | }; 73 | 74 | ////////////////////////////////////////////////////////////////////////// 75 | //CUICommandHistory 76 | 77 | typedef void (CALLBACK* UIACTIONPROC)(TiXmlNode*); 78 | 79 | class CUICommandHistory 80 | { 81 | public: 82 | CUICommandHistory(void); 83 | ~CUICommandHistory(void); 84 | 85 | public: 86 | void Begin(CArray& arrSelected, ActionType type); 87 | void Begin(CControlUI* pControl, LPCTSTR pstrName, LPCTSTR pstrValue); 88 | void End(); 89 | void End(CControlUI* pControl, LPCTSTR pstrName, LPCTSTR pstrValue); 90 | 91 | void Undo(); 92 | void Redo(); 93 | BOOL CanUndo(); 94 | BOOL CanRedo(); 95 | 96 | protected: 97 | BOOL AddUICommand(CUICommandNode* pNode); 98 | void UICommandAction(CommandType type); 99 | 100 | void ActionAdd(CUICommandElement* pAfter); 101 | void ActionModify(CUICommandElement* pAfter); 102 | void ActionDelete(CUICommandElement* pBefore); 103 | void SetUIAction(TiXmlNode* pElement, UIACTIONPROC Proc); 104 | 105 | private: 106 | static void CALLBACK UIAdd(TiXmlNode* pNode); 107 | static void CALLBACK UIModify(TiXmlNode* pNode); 108 | static void CALLBACK UIDelete(TiXmlNode* pNode); 109 | 110 | private: 111 | CUICommandNode* m_pNode; 112 | int m_nCommandIndex; 113 | CList m_lstCommandNodes; 114 | }; -------------------------------------------------------------------------------- /DuiLib/UIMarkup.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIMARKUP_H__ 2 | #define __UIMARKUP_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | 8 | enum 9 | { 10 | XMLFILE_ENCODING_UTF8 = 0, 11 | XMLFILE_ENCODING_UNICODE = 1, 12 | XMLFILE_ENCODING_ASNI = 2, 13 | }; 14 | 15 | class CMarkup; 16 | class CMarkupNode; 17 | 18 | 19 | class UILIB_API CMarkup 20 | { 21 | friend CMarkupNode; 22 | public: 23 | CMarkup(LPCTSTR pstrXML = NULL); 24 | ~CMarkup(); 25 | 26 | bool Load(LPCTSTR pstrXML); 27 | bool LoadFromMem(BYTE* pByte, DWORD dwSize, int encoding = XMLFILE_ENCODING_UTF8); 28 | bool LoadFromFile(LPCTSTR pstrFilename, int encoding = XMLFILE_ENCODING_UTF8); 29 | void Release(); 30 | bool IsValid() const; 31 | 32 | void SetPreserveWhitespace(bool bPreserve = true); 33 | void GetLastErrorMessage(LPTSTR pstrMessage, SIZE_T cchMax) const; 34 | void GetLastErrorLocation(LPTSTR pstrSource, SIZE_T cchMax) const; 35 | 36 | CMarkupNode GetRoot(); 37 | 38 | private: 39 | typedef struct tagXMLELEMENT 40 | { 41 | ULONG iStart; 42 | ULONG iChild; 43 | ULONG iNext; 44 | ULONG iParent; 45 | ULONG iData; 46 | } XMLELEMENT; 47 | 48 | LPTSTR m_pstrXML; 49 | XMLELEMENT* m_pElements; 50 | ULONG m_nElements; 51 | ULONG m_nReservedElements; 52 | TCHAR m_szErrorMsg[100]; 53 | TCHAR m_szErrorXML[50]; 54 | bool m_bPreserveWhitespace; 55 | 56 | private: 57 | bool _Parse(); 58 | bool _Parse(LPTSTR& pstrText, ULONG iParent); 59 | XMLELEMENT* _ReserveElement(); 60 | inline void _SkipWhitespace(LPTSTR& pstr) const; 61 | inline void _SkipWhitespace(LPCTSTR& pstr) const; 62 | inline void _SkipIdentifier(LPTSTR& pstr) const; 63 | inline void _SkipIdentifier(LPCTSTR& pstr) const; 64 | bool _ParseData(LPTSTR& pstrText, LPTSTR& pstrData, char cEnd); 65 | void _ParseMetaChar(LPTSTR& pstrText, LPTSTR& pstrDest); 66 | bool _ParseAttributes(LPTSTR& pstrText); 67 | bool _Failed(LPCTSTR pstrError, LPCTSTR pstrLocation = NULL); 68 | }; 69 | 70 | 71 | class UILIB_API CMarkupNode 72 | { 73 | friend CMarkup; 74 | private: 75 | CMarkupNode(); 76 | CMarkupNode(CMarkup* pOwner, int iPos); 77 | 78 | public: 79 | bool IsValid() const; 80 | 81 | CMarkupNode GetParent(); 82 | CMarkupNode GetSibling(); 83 | CMarkupNode GetChild(); 84 | CMarkupNode GetChild(LPCTSTR pstrName); 85 | 86 | bool HasSiblings() const; 87 | bool HasChildren() const; 88 | LPCTSTR GetName() const; 89 | LPCTSTR GetValue() const; 90 | 91 | bool HasAttributes(); 92 | bool HasAttribute(LPCTSTR pstrName); 93 | int GetAttributeCount(); 94 | LPCTSTR GetAttributeName(int iIndex); 95 | LPCTSTR GetAttributeValue(int iIndex); 96 | LPCTSTR GetAttributeValue(LPCTSTR pstrName); 97 | bool GetAttributeValue(int iIndex, LPTSTR pstrValue, SIZE_T cchMax); 98 | bool GetAttributeValue(LPCTSTR pstrName, LPTSTR pstrValue, SIZE_T cchMax); 99 | 100 | private: 101 | void _MapAttributes(); 102 | 103 | enum { MAX_XML_ATTRIBUTES = 64 }; 104 | 105 | typedef struct 106 | { 107 | ULONG iName; 108 | ULONG iValue; 109 | } XMLATTRIBUTE; 110 | 111 | int m_iPos; 112 | int m_nAttributes; 113 | XMLATTRIBUTE m_aAttributes[MAX_XML_ATTRIBUTES]; 114 | CMarkup* m_pOwner; 115 | }; 116 | 117 | } // namespace DuiLib 118 | 119 | #endif // __UIMARKUP_H__ 120 | -------------------------------------------------------------------------------- /UIDesigner/UIUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // DirectUI - UI Library 4 | // 5 | // Written by Bjarke Viksoe (bjarke@viksoe.dk) 6 | // Copyright (c) 2006-2007 Bjarke Viksoe. 7 | // 8 | // This code may be used in compiled form in any way you desire. These 9 | // source files may be redistributed by any means PROVIDING it is 10 | // not sold for profit without the authors written consent, and 11 | // providing that this notice and the authors name is included. 12 | // 13 | // This file is provided "as is" with no expressed or implied warranty. 14 | // The author accepts no liability if it causes any damage to you or your 15 | // computer whatsoever. It's free, so don't hassle me about it. 16 | // 17 | //// 18 | // Acknowledgements : 19 | // Bjarke Viksoe (http://www.viksoe.dk/code/windowless1.htm) 20 | // 21 | // 22 | // 23 | // Beware of bugs. 24 | // 25 | // 26 | // 27 | //////////////////////////////////////////////////////// 28 | #ifndef __UIUTIL_H__ 29 | #define __UIUTIL_H__ 30 | 31 | #ifdef _MSC_VER 32 | #pragma once 33 | #endif 34 | 35 | namespace StringConvertor { 36 | 37 | #pragma warning(disable: 4996) 38 | 39 | LPSTR WideToAnsi(LPCWSTR str, int len = -1); 40 | LPSTR WideToUtf8(LPCWSTR str, int len = -1); 41 | LPWSTR WideStrDup(LPCWSTR str, int len = -1); 42 | 43 | LPWSTR AnsiToWide(LPCSTR str, int len = -1); 44 | __declspec(deprecated) LPSTR AnsiToUtf8(LPCSTR str, int len = -1); 45 | __declspec(deprecated) LPSTR AnsiStrDup(LPCSTR str, int len = -1); 46 | 47 | LPWSTR Utf8ToWide(LPCSTR str, int len = -1); 48 | __declspec(deprecated) LPSTR Utf8ToAnsi(LPCSTR str, int len = -1); 49 | static __inline LPSTR Utf8StrDup(LPCSTR str, int len = -1) { return AnsiStrDup(str, len); } 50 | 51 | //StringAlloc takes the number of characters, not bytes! 52 | __declspec(deprecated) LPWSTR StringAllocW(size_t len); 53 | __declspec(deprecated) LPSTR StringAllocA(size_t len); 54 | void StringFree(LPWSTR str); 55 | void StringFree(LPSTR str); 56 | 57 | #define StringFreeW StringFree 58 | #define StringFreeA StringFree 59 | 60 | #ifdef UNICODE 61 | static __declspec(deprecated) __inline LPTSTR WideToTchar(LPCWSTR str, int len = -1) { return WideStrDup(str, len); } 62 | static __declspec(deprecated) __inline LPTSTR AnsiToTchar(LPCSTR str, int len = -1) { return AnsiToWide(str, len); } 63 | static __declspec(deprecated) __inline LPTSTR Utf8ToTchar(LPCSTR str, int len = -1) { return Utf8ToWide(str, len); } 64 | static __declspec(deprecated) __inline LPWSTR TcharToWide(LPCTSTR str, int len = -1) { return WideStrDup(str, len); } 65 | static __declspec(deprecated) __inline LPSTR TcharToAnsi(LPCTSTR str, int len = -1) { return WideToAnsi(str, len); } 66 | static __declspec(deprecated) __inline LPSTR TcharToUtf8(LPCTSTR str, int len = -1) { return WideToUtf8(str, len); } 67 | static __declspec(deprecated) __inline LPTSTR TcharStrDup(LPCTSTR str, int len = -1) { return WideStrDup(str, len); } 68 | static __declspec(deprecated) __inline LPTSTR StringAlloc(size_t len) { return StringAllocW(len); } 69 | #else 70 | static __declspec(deprecated) __inline LPTSTR WideToTchar(LPCWSTR str, int len = -1) { return WideToAnsi(str, len); } 71 | static __declspec(deprecated) __inline LPTSTR AnsiToTchar(LPCSTR str, int len = -1) { return AnsiStrDup(str, len); } 72 | static __declspec(deprecated) __inline LPTSTR Utf8ToTchar(LPCSTR str, int len = -1) { return Utf8ToAnsi(str, len); } 73 | static __declspec(deprecated) __inline LPWSTR TcharToWide(LPCTSTR str, int len = -1) { return AnsiToWide(str, len); } 74 | static __declspec(deprecated) __inline LPSTR TcharToAnsi(LPCTSTR str, int len = -1) { return AnsiStrDup(str, len); } 75 | static __declspec(deprecated) __inline LPSTR TcharToUtf8(LPCTSTR str, int len = -1) { return AnsiToUtf8(str, len); } 76 | static __declspec(deprecated) __inline LPTSTR TcharStrDup(LPCTSTR str, int len = -1) { return AnsiStrDup(str, len); } 77 | static __declspec(deprecated) __inline LPTSTR StringAlloc(size_t len) { return StringAllocA(len); } 78 | #endif 79 | 80 | #pragma warning(default: 4996) 81 | 82 | } // namespace StringConvertor 83 | 84 | #endif //__UIUTIL_H__ 85 | -------------------------------------------------------------------------------- /DuiLib/UICombo.h: -------------------------------------------------------------------------------- 1 | #ifndef __UICOMBO_H__ 2 | #define __UICOMBO_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | ///////////////////////////////////////////////////////////////////////////////////// 8 | // 9 | 10 | class CComboWnd; 11 | 12 | class UILIB_API CComboUI : public CContainerUI, public IListOwnerUI 13 | { 14 | friend CComboWnd; 15 | public: 16 | CComboUI(); 17 | 18 | LPCTSTR GetClass() const; 19 | LPVOID GetInterface(LPCTSTR pstrName); 20 | 21 | void DoInit(); 22 | UINT GetControlFlags() const; 23 | 24 | CStdString GetText() const; 25 | void SetEnabled(bool bEnable = true); 26 | 27 | CStdString GetDropBoxAttributeList(); 28 | void SetDropBoxAttributeList(LPCTSTR pstrList); 29 | SIZE GetDropBoxSize() const; 30 | void SetDropBoxSize(SIZE szDropBox); 31 | 32 | int GetCurSel() const; 33 | bool SelectItem(int iIndex, bool bTakeFocus = false); 34 | 35 | bool SetItemIndex(CControlUI* pControl, int iIndex); 36 | bool Add(CControlUI* pControl); 37 | bool AddAt(CControlUI* pControl, int iIndex); 38 | bool Remove(CControlUI* pControl); 39 | bool RemoveAt(int iIndex); 40 | void RemoveAll(); 41 | 42 | bool Activate(); 43 | 44 | RECT GetTextPadding() const; 45 | void SetTextPadding(RECT rc); 46 | LPCTSTR GetNormalImage() const; 47 | void SetNormalImage(LPCTSTR pStrImage); 48 | LPCTSTR GetHotImage() const; 49 | void SetHotImage(LPCTSTR pStrImage); 50 | LPCTSTR GetPushedImage() const; 51 | void SetPushedImage(LPCTSTR pStrImage); 52 | LPCTSTR GetFocusedImage() const; 53 | void SetFocusedImage(LPCTSTR pStrImage); 54 | LPCTSTR GetDisabledImage() const; 55 | void SetDisabledImage(LPCTSTR pStrImage); 56 | 57 | TListInfoUI* GetListInfo(); 58 | void SetItemFont(int index); 59 | void SetItemTextStyle(UINT uStyle); 60 | RECT GetItemTextPadding() const; 61 | void SetItemTextPadding(RECT rc); 62 | DWORD GetItemTextColor() const; 63 | void SetItemTextColor(DWORD dwTextColor); 64 | DWORD GetItemBkColor() const; 65 | void SetItemBkColor(DWORD dwBkColor); 66 | LPCTSTR GetItemBkImage() const; 67 | void SetItemBkImage(LPCTSTR pStrImage); 68 | bool IsAlternateBk() const; 69 | void SetAlternateBk(bool bAlternateBk); 70 | DWORD GetSelectedItemTextColor() const; 71 | void SetSelectedItemTextColor(DWORD dwTextColor); 72 | DWORD GetSelectedItemBkColor() const; 73 | void SetSelectedItemBkColor(DWORD dwBkColor); 74 | LPCTSTR GetSelectedItemImage() const; 75 | void SetSelectedItemImage(LPCTSTR pStrImage); 76 | DWORD GetHotItemTextColor() const; 77 | void SetHotItemTextColor(DWORD dwTextColor); 78 | DWORD GetHotItemBkColor() const; 79 | void SetHotItemBkColor(DWORD dwBkColor); 80 | LPCTSTR GetHotItemImage() const; 81 | void SetHotItemImage(LPCTSTR pStrImage); 82 | DWORD GetDisabledItemTextColor() const; 83 | void SetDisabledItemTextColor(DWORD dwTextColor); 84 | DWORD GetDisabledItemBkColor() const; 85 | void SetDisabledItemBkColor(DWORD dwBkColor); 86 | LPCTSTR GetDisabledItemImage() const; 87 | void SetDisabledItemImage(LPCTSTR pStrImage); 88 | DWORD GetItemLineColor() const; 89 | void SetItemLineColor(DWORD dwLineColor); 90 | bool IsItemShowHtml(); 91 | void SetItemShowHtml(bool bShowHtml = true); 92 | 93 | SIZE EstimateSize(SIZE szAvailable); 94 | void SetPos(RECT rc); 95 | void DoEvent(TEventUI& event); 96 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 97 | 98 | void DoPaint(HDC hDC, const RECT& rcPaint); 99 | void PaintText(HDC hDC); 100 | void PaintStatusImage(HDC hDC); 101 | 102 | protected: 103 | CComboWnd* m_pWindow; 104 | 105 | int m_iCurSel; 106 | RECT m_rcTextPadding; 107 | CStdString m_sDropBoxAttributes; 108 | SIZE m_szDropBox; 109 | UINT m_uButtonState; 110 | 111 | CStdString m_sNormalImage; 112 | CStdString m_sHotImage; 113 | CStdString m_sPushedImage; 114 | CStdString m_sFocusedImage; 115 | CStdString m_sDisabledImage; 116 | 117 | TListInfoUI m_ListInfo; 118 | }; 119 | 120 | } // namespace DuiLib 121 | 122 | #endif // __UICOMBO_H__ 123 | -------------------------------------------------------------------------------- /DuiLib/DuiLib.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {00241f87-afff-4329-8fa8-600dce74d6fa} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {5f569676-7d50-4e00-9cda-94111fcf8201} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | {e69988c2-7f21-4df4-8b2e-417a3681c32a} 14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | 71 | 72 | Header Files 73 | 74 | 75 | Header Files 76 | 77 | 78 | Header Files 79 | 80 | 81 | Header Files 82 | 83 | 84 | Header Files 85 | 86 | 87 | Header Files 88 | 89 | 90 | Header Files 91 | 92 | 93 | Header Files 94 | 95 | 96 | Header Files 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | Header Files 106 | 107 | 108 | Header Files 109 | 110 | 111 | Header Files 112 | 113 | 114 | Header Files 115 | 116 | 117 | -------------------------------------------------------------------------------- /UIDesigner/UIUtil.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIUtil.h" 3 | 4 | namespace StringConvertor { 5 | 6 | #pragma warning(disable: 4996) 7 | 8 | #if defined(USE_OP_LIBC) 9 | #define __malloc(size) ((void*)(op_malloc(size))) 10 | #define __free(ptr) ((void)(op_free(ptr))) 11 | #elif defined(USE_LIBC) 12 | #define __malloc(size) ((void*)(malloc(size))) 13 | #define __free(ptr) ((void)(free(ptr))) 14 | #else 15 | #define __malloc(size) ((void*)(LocalAlloc(LPTR, (size)))) 16 | #define __free(ptr) ((void)(LocalFree(ptr))) 17 | #endif 18 | 19 | enum FROM 20 | { 21 | ansi, 22 | wide 23 | }; 24 | 25 | template struct Conversion; 26 | template <> struct Conversion 27 | { 28 | typedef LPWSTR FromT; 29 | typedef LPCWSTR CFromT; 30 | typedef LPSTR ToT; 31 | enum { TO = ansi }; 32 | static __inline int Convert(UINT cp, CFromT strW, int lenW, ToT strA, int lenA) { return WideCharToMultiByte(cp, 0, strW, lenW, strA, lenA, NULL, NULL); } 33 | static __inline FromT Alloc(size_t len) { return StringAllocW(len); } 34 | static __inline size_t StrLen(CFromT strW) { return wcslen(strW); } 35 | static __inline size_t BufferSize(size_t len) { return len * sizeof(wchar_t); } 36 | }; 37 | 38 | template <> struct Conversion 39 | { 40 | typedef LPSTR FromT; 41 | typedef LPCSTR CFromT; 42 | typedef LPWSTR ToT; 43 | enum { TO = wide }; 44 | static __inline int Convert(UINT cp, CFromT strA, int lenA, ToT strW, int lenW) { return MultiByteToWideChar(cp, 0, strA, lenA, strW, lenW); } 45 | static __inline FromT Alloc(size_t len) { return StringAllocA(len); } 46 | static __inline size_t StrLen(CFromT strA) { return strlen(strA); } 47 | static __inline size_t BufferSize(size_t len) { return len; } 48 | }; 49 | 50 | template struct Decode 51 | { 52 | typedef typename Conversion::CFromT CFromT; 53 | typedef typename Conversion::ToT ToT; 54 | enum { OPPOSITE = Conversion::TO }; 55 | ToT out; 56 | __inline Decode(CFromT in, int in_len = -1): out(NULL) 57 | { 58 | if (!in) return; 59 | int out_len = Conversion::Convert(to, in, in_len, NULL, 0); 60 | if (out_len) 61 | { 62 | ++out_len; //this might be over-allocation 63 | out = Conversion< (FROM)OPPOSITE >::Alloc(out_len); 64 | if (out) 65 | { 66 | Conversion::Convert(to, in, in_len, out, out_len); 67 | } 68 | } 69 | } 70 | __inline operator ToT () const { return out; } 71 | }; 72 | 73 | template struct Recode 74 | { 75 | LPSTR out; 76 | __inline Recode(LPCSTR in, int len = -1): out(NULL) 77 | { 78 | LPWSTR mid = Decode(in, len); 79 | if (!mid) return; 80 | out = Decode(mid); 81 | StringFreeW(mid); 82 | } 83 | __inline operator LPSTR () const { return out; } 84 | }; 85 | 86 | template struct Duplicate 87 | { 88 | typedef typename Conversion::FromT FromT; 89 | typedef typename Conversion::CFromT CFromT; 90 | FromT out; 91 | __inline Duplicate(CFromT in, int in_len = -1): out(NULL) 92 | { 93 | if (!in) return; 94 | size_t len = ((in_len < 0) ? Conversion::StrLen(in) : (size_t)in_len) + 1; 95 | out = Conversion::Alloc(len); 96 | if (!out) return; 97 | CopyMemory(out, in, Conversion::BufferSize(len)); 98 | out[len - 1] = 0; 99 | } 100 | __inline operator FromT () const { return out; } 101 | }; 102 | 103 | LPSTR WideToAnsi(LPCWSTR str, int len) { return Decode(str, len); } 104 | LPSTR WideToUtf8(LPCWSTR str, int len) { return Decode(str, len); } 105 | LPWSTR AnsiToWide(LPCSTR str, int len) { return Decode(str, len); } 106 | LPWSTR Utf8ToWide(LPCSTR str, int len) { return Decode(str, len); } 107 | LPSTR AnsiToUtf8(LPCSTR str, int len) { return Recode(str, len); } 108 | LPSTR Utf8ToAnsi(LPCSTR str, int len) { return Recode(str, len); } 109 | LPWSTR WideStrDup(LPCWSTR str, int len) { return Duplicate(str, len); } 110 | LPSTR AnsiStrDup(LPCSTR str, int len) { return Duplicate(str, len); } 111 | 112 | //memory routines 113 | LPWSTR StringAllocW(size_t len) { return (LPWSTR)__malloc(len * sizeof(wchar_t)); } 114 | LPSTR StringAllocA(size_t len) { return (LPSTR)__malloc(len); } 115 | void StringFreeW(LPWSTR strW) { __free(strW); } 116 | void StringFreeA(LPSTR strA) { __free(strA); } 117 | 118 | } // namespace StringConvertor -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | DuiLib/[Dd]ebug_u/ 15 | [Dd]ebug_u/ 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | build/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # DNX 46 | project.lock.json 47 | artifacts/ 48 | 49 | *_i.c 50 | *_p.c 51 | *_i.h 52 | *.ilk 53 | *.meta 54 | *.obj 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.tmp_proj 66 | *.log 67 | *.vspscc 68 | *.vssscc 69 | .builds 70 | *.pidb 71 | *.svclog 72 | *.scc 73 | 74 | # Chutzpah Test files 75 | _Chutzpah* 76 | 77 | # Visual C++ cache files 78 | ipch/ 79 | *.aps 80 | *.ncb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | # TODO: Comment the next line if you want to checkin your web deploy settings 143 | # but database connection strings (with potential passwords) will be unencrypted 144 | *.pubxml 145 | *.publishproj 146 | 147 | # NuGet Packages 148 | *.nupkg 149 | # The packages folder can be ignored because of Package Restore 150 | **/packages/* 151 | # except build/, which is used as an MSBuild target. 152 | !**/packages/build/ 153 | # Uncomment if necessary however generally it will be regenerated when needed 154 | #!**/packages/repositories.config 155 | 156 | # Windows Azure Build Output 157 | csx/ 158 | *.build.csdef 159 | 160 | # Windows Store app package directory 161 | AppPackages/ 162 | 163 | # Visual Studio cache files 164 | # files ending in .cache can be ignored 165 | *.[Cc]ache 166 | # but keep track of directories ending in .cache 167 | !*.[Cc]ache/ 168 | 169 | # Others 170 | ClientBin/ 171 | [Ss]tyle[Cc]op.* 172 | ~$* 173 | *~ 174 | *.dbmdl 175 | *.dbproj.schemaview 176 | *.pfx 177 | *.publishsettings 178 | node_modules/ 179 | orleans.codegen.cs 180 | 181 | # RIA/Silverlight projects 182 | Generated_Code/ 183 | 184 | # Backup & report files from converting an old project file 185 | # to a newer Visual Studio version. Backup files are not needed, 186 | # because we have git ;-) 187 | _UpgradeReport_Files/ 188 | Backup*/ 189 | UpgradeLog*.XML 190 | UpgradeLog*.htm 191 | 192 | # SQL Server files 193 | *.mdf 194 | *.ldf 195 | 196 | # Business Intelligence projects 197 | *.rdl.data 198 | *.bim.layout 199 | *.bim_*.settings 200 | 201 | # Microsoft Fakes 202 | FakesAssemblies/ 203 | 204 | # Node.js Tools for Visual Studio 205 | .ntvs_analysis.dat 206 | 207 | # Visual Studio 6 build log 208 | *.plg 209 | 210 | # Visual Studio 6 workspace options file 211 | *.opt 212 | 213 | # Visual Studio LightSwitch build output 214 | **/*.HTMLClient/GeneratedArtifacts 215 | **/*.DesktopClient/GeneratedArtifacts 216 | **/*.DesktopClient/ModelManifest.xml 217 | **/*.Server/GeneratedArtifacts 218 | **/*.Server/ModelManifest.xml 219 | _Pvt_Extensions 220 | 221 | 222 | # Project Specific 223 | 224 | misc/ 225 | *.sublime* 226 | test.* 227 | src/ 228 | #*.sln 229 | run.bat 230 | external/ 231 | gb_gl_dsa.h 232 | -------------------------------------------------------------------------------- /UIDesigner/ToolBoxCtrl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | ////////////////////////////////////////////////////////////////////////// 4 | // CToolElement 5 | 6 | class CToolElement : public CObject 7 | { 8 | DECLARE_DYNAMIC(CToolElement) 9 | 10 | friend class CToolBoxCtrl; 11 | 12 | public: 13 | CToolElement(const CString& strTabName); 14 | CToolElement(const CString& strName,int nClass,UINT nIDIcon); 15 | virtual ~CToolElement(); 16 | 17 | public: 18 | BOOL AddSubTool(CToolElement* pTool); 19 | BOOL IsToolTab() const { return m_bTab; } 20 | void Expand(BOOL bExpand = TRUE); 21 | BOOL IsExpanded() const { return m_bExpanded; } 22 | BOOL IsEnabled() const { return m_bEnabled; } 23 | BOOL IsVisible() const { return m_bIsVisible; } 24 | void SetClass(int nClass) { m_nClass=nClass; } 25 | CToolElement* GetTool(int nClass) const; 26 | int GetClass() const { return m_nClass; } 27 | virtual BOOL IsSelected() const; 28 | virtual BOOL IsHovered() const; 29 | BOOL IsParentExpanded() const; 30 | int GetExpandedSubTools(BOOL bIncludeHidden = TRUE) const; 31 | BOOL RemoveSubTool(CToolElement*& pTool, BOOL bDelete = TRUE); 32 | CToolElement* HitTest(CPoint point); 33 | 34 | void Redraw(); 35 | virtual void OnDrawExpandBox(CDC* pDC, CRect rectExpand); 36 | virtual void OnDrawIcon(CDC* pDC, CRect rect); 37 | virtual void OnDrawName(CDC* pDC, CRect rect); 38 | 39 | protected: 40 | void Init(); 41 | BOOL IsSubTool(CToolElement* pTool) const; 42 | void SetOwnerList(CToolBoxCtrl* pWndList); 43 | void Reposition(int& y); 44 | 45 | protected: 46 | CString m_strName;//Tool Name 47 | int m_nClass;//Tool Class 48 | BOOL m_bTab;//Is ToolTab? 49 | HICON m_hIcon;//Tool Icon 50 | CRect m_Rect;//Tool rectangle (in the ToolBox.list coordinates) 51 | BOOL m_bEnabled; // Is Tool enabled? 52 | BOOL m_bIsVisible; // Is property visible 53 | BOOL m_bExpanded; // Is ToolTab expanded (for ToolTab only) 54 | BOOL m_bNameIsTruncated; 55 | 56 | CToolBoxCtrl* m_pWndList; // Pointer to the ToolBoxList window 57 | CToolElement* m_pParent; // Parent Tool (NULL for ToolTab) 58 | CList m_lstSubTools; // Sub-tools list 59 | }; 60 | 61 | //////////////////////////////////////////////////////////// 62 | // CToolBoxCtrl 63 | 64 | class CToolBoxCtrl : public CWnd 65 | { 66 | DECLARE_DYNAMIC(CToolBoxCtrl) 67 | 68 | friend class CToolElement; 69 | 70 | public: 71 | CToolBoxCtrl(); 72 | virtual ~CToolBoxCtrl(); 73 | 74 | public: 75 | virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); 76 | 77 | public: 78 | int AddToolTab(CToolElement* pToolTab, BOOL bRedraw = TRUE, BOOL bAdjustLayout = TRUE); 79 | BOOL DeleteToolTab(CToolElement*& pTool, BOOL bRedraw = TRUE, BOOL bAdjustLayout = TRUE); 80 | void RemoveAll(); 81 | int GetToolTabCount() const { return (int) m_lstToolTabs.GetCount(); } 82 | 83 | void SetCurSel(CToolElement* pTool, BOOL bRedraw = TRUE); 84 | void SetCurSel(int nClass,BOOL bRedraw=TRUE); 85 | CToolElement* GetCurSel() const { return m_pSel; } 86 | void ExpandAll(BOOL bExpand = TRUE); 87 | 88 | virtual void AdjustLayout(); 89 | CToolElement* HitTest(CPoint pt) const; 90 | 91 | public: 92 | virtual int OnDrawTool(CDC* pDC, CToolElement* pTool) const; 93 | void SetCustomColors(COLORREF clrBackground, COLORREF clrSelected, COLORREF clrHover, COLORREF m_clrSelectedBorder, 94 | COLORREF clrToolTab); 95 | void GetCustomColors(COLORREF& clrBackground, COLORREF& clrSelected, COLORREF& clrHover, COLORREF& m_clrSelectedBorder, 96 | COLORREF& clrToolTab); 97 | 98 | protected: 99 | virtual void OnFillBackground(CDC* pDC, CRect rectClient); 100 | virtual void OnDrawList(CDC* pDC); 101 | HFONT SetCurrFont(CDC* pDC); 102 | void CreateToolTabFont(); 103 | 104 | void ReposTools(); 105 | void SetScrollSizes(); 106 | int GetTotalItems(BOOL bIncludeHidden = TRUE) const; 107 | 108 | protected: 109 | CToolTipCtrl m_ToolTip; // Tooltip control 110 | CScrollBar m_wndScrollVert; // Vertical scroll bar 111 | 112 | protected: 113 | CList m_lstToolTabs; // List of ToolTab 114 | CToolElement* m_pSel; // Current selection 115 | CToolElement* m_pHover; //Hover over 116 | 117 | CRect m_rectList; // ToolBox area 118 | int m_nTabHeight; //ToolTab height of the single row 119 | int m_nToolHeight; // Tool height of the single row 120 | int m_nVertScrollOffset; // In rows 121 | int m_nVertScrollTotal; 122 | int m_nVertScrollPage; 123 | 124 | HFONT m_hFont; // ToolBox list regular font 125 | CFont m_fontToolTab; // ToolTab font 126 | CBrush m_brBackground; 127 | 128 | COLORREF m_clrBackground; 129 | COLORREF m_clrSelected; 130 | COLORREF m_clrHover; 131 | COLORREF m_clrSelectedBorder; 132 | COLORREF m_clrToolTab; 133 | 134 | protected: 135 | DECLARE_MESSAGE_MAP() 136 | public: 137 | afx_msg void OnPaint(); 138 | afx_msg void OnSize(UINT nType, int cx, int cy); 139 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 140 | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 141 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 142 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 143 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 144 | afx_msg BOOL OnEraseBkgnd(CDC* pDC); 145 | afx_msg void OnMouseLeave(); 146 | afx_msg void OnDestroy(); 147 | }; 148 | 149 | 150 | -------------------------------------------------------------------------------- /UIDesigner/MultiUITracker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "resource.h" 3 | #include "..\DuiLib\UIlib.h" 4 | using DuiLib::CControlUI; 5 | using DuiLib::INotifyUI; 6 | 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // CUITracker - Modified according to CRectTracker 9 | 10 | // the struct below is used to determine the qualities of a particular handle 11 | typedef struct tagHandleInfo 12 | { 13 | size_t nOffsetX; // offset within RECT for X coordinate 14 | size_t nOffsetY; // offset within RECT for Y coordinate 15 | int nCenterX; // adjust X by Width()/2 * this number 16 | int nCenterY; // adjust Y by Height()/2 * this number 17 | int nHandleX; // adjust X by handle size * this number 18 | int nHandleY; // adjust Y by handle size * this number 19 | int nInvertX; // handle converts to this when X inverted 20 | int nInvertY; // handle converts to this when Y inverted 21 | }HandleInfo; 22 | 23 | // the struct below gives us information on the layout of a RECT struct and 24 | // the relationship between its members 25 | typedef struct tagRectInfo 26 | { 27 | size_t nOffsetAcross; // offset of opposite point (ie. left->right) 28 | int nSignAcross; // sign relative to that point (ie. add/subtract) 29 | }RectInfo; 30 | 31 | // Style Flags 32 | enum StyleFlags 33 | { 34 | solidLine = 1, dottedLine = 2, hatchedBorder = 4, 35 | resizeInside = 8, resizeOutside = 16, hatchInside = 32, 36 | }; 37 | 38 | // Hit-Test codes 39 | enum TrackerHit 40 | { 41 | hitNothing = -1, 42 | hitTopLeft = 0, hitTopRight = 1, hitBottomRight = 2, hitBottomLeft = 3, 43 | hitTop = 4, hitRight = 5, hitBottom = 6, hitLeft = 7, hitMiddle = 8, 44 | }; 45 | 46 | class CUITracker 47 | { 48 | public: 49 | // Constructors 50 | CUITracker(); 51 | CUITracker(LPCRECT lpSrcRect, UINT nStyle); 52 | 53 | // Operations 54 | void GetTrueRect(LPRECT lpTrueRect) const; 55 | BOOL SetCursor(CPoint point, UINT nHitTest) const; 56 | BOOL Track(CWnd* pWnd, CPoint point, BOOL bAllowInvert = FALSE, 57 | CDC* pDCClipTo = NULL); 58 | BOOL TrackRubberBand(CWnd* pWnd, CPoint point, BOOL bAllowInvert = TRUE); 59 | int HitTest(CPoint point) const; 60 | int NormalizeHit(int nHandle) const; 61 | RECT GetRect() const { return m_rect; } 62 | 63 | void SetHandleSize(int nHandleSize) { m_nHandleSize=nHandleSize; } 64 | void SetStyle(UINT style) { m_nStyle=style; } 65 | 66 | // Overridables 67 | virtual void Draw(CDC* pDC) const; 68 | virtual void DrawTrackerRect(LPCRECT lpRect, CDC* pDC); 69 | virtual void AdjustRect(int nHandle, LPRECT lpRect); 70 | virtual void OnChangedRect(const CRect& rectOld); 71 | virtual UINT GetHandleMask() const; 72 | virtual int GetHandleSize(LPCRECT lpRect = NULL) const; 73 | virtual void SetControlType(int nType); 74 | 75 | // Implementation 76 | public: 77 | virtual ~CUITracker(); 78 | 79 | protected: 80 | // Attributes 81 | UINT m_nStyle; // current state 82 | CRect m_rect; // current position (always in pixels) 83 | CSize m_sizeMin; // minimum X and Y size during track operation 84 | int m_nHandleSize; // size of resize handles 85 | int m_nMoveHandleSize;//size of move handle 86 | UINT m_nMask; 87 | UINT m_nControlType; 88 | 89 | BOOL m_bAllowInvert; // flag passed to Track or TrackRubberBand 90 | CRect m_rectLast; 91 | CSize m_sizeLast; 92 | BOOL m_bErase; // TRUE if DrawTrackerRect is called for erasing 93 | BOOL m_bFinalErase; // TRUE if DragTrackerRect called for final erase 94 | 95 | static HCURSOR m_hCursors[10]; 96 | static HBRUSH m_hHatchBrush; 97 | COLORREF m_clrDottedLine; 98 | HPEN m_hDottedLinePen; 99 | COLORREF m_clrHandleBorder; 100 | HPEN m_hHandlePen; 101 | COLORREF m_clrHandleBackground; 102 | HBRUSH m_hHandleBrush; 103 | HBITMAP m_hMoveHandleBitmap; 104 | 105 | // implementation helpers 106 | int HitTestHandles(CPoint point) const; 107 | void GetHandleRect(int nHandle, CRect* pHandleRect) const; 108 | void GetMoveHandleRect(CRect* pHandleRect) const; 109 | void GetModifyPointers(int nHandle, int**ppx, int**ppy, int* px, int*py); 110 | BOOL TrackHandle(int nHandle, CWnd* pWnd, CDC* pDCClipTo); 111 | void Init(); 112 | void Construct(); 113 | }; 114 | 115 | //////////////////////////////////////////////////////////// 116 | // CTrackerElement 117 | 118 | class CMultiUITracker; 119 | 120 | class CTrackerElement 121 | { 122 | public: 123 | CTrackerElement(void); 124 | CTrackerElement(CControlUI* pControl,int nType,INotifyUI* pOwner); 125 | virtual ~CTrackerElement(void); 126 | 127 | friend CMultiUITracker; 128 | 129 | public: 130 | const RECT& GetPos() const; 131 | void SetPos(RECT rect,BOOL bMove=FALSE); 132 | CControlUI* GetControl() { return m_pControl; } 133 | 134 | protected: 135 | CControlUI * m_pControl; 136 | int m_nType; 137 | INotifyUI* m_pOwner; 138 | }; 139 | 140 | //////////////////////////////////////////////////////////// 141 | // CMultiUITracker 142 | 143 | class CMultiUITracker : public CUITracker 144 | { 145 | public: 146 | CMultiUITracker(void); 147 | virtual ~CMultiUITracker(void); 148 | 149 | public: 150 | void Draw(CDC* pDC,LPSIZE pOffset=NULL); 151 | 152 | int HitTest(CPoint point); 153 | int HitTestHandles(CPoint point); 154 | BOOL Track(CWnd* pWnd, CPoint point,BOOL bAllowInvert=FALSE,CDC* pDCClipTo=NULL); 155 | BOOL SetCursor(CPoint point, UINT nHitTest); 156 | 157 | BOOL Add(CTrackerElement * pTracker); 158 | BOOL Remove(CTrackerElement * pTracker); 159 | void RemoveAll(); 160 | BOOL SetFocus(CPoint point); 161 | BOOL SetFocus(CControlUI* pControl); 162 | CTrackerElement* FindTracker(CControlUI* pControl) const; 163 | CControlUI* GetFocused() const; 164 | BOOL GetSelected(CArray& arrSelected); 165 | BOOL IsEmpty() const { return m_arrTracker.IsEmpty(); } 166 | int GetSize() const { return m_arrTracker.GetSize(); } 167 | 168 | SIZE GetFormSize() const { return m_szForm; } 169 | void SetFormSize(SIZE size) { m_szForm=size; } 170 | 171 | protected: 172 | BOOL MultiTrackHandle(CWnd* pWnd,CDC* pDCClipTo); 173 | BOOL OneTrackHandle(int nHandle, CWnd* pWnd, BOOL bAllowInvert, CDC* pDCClipTo); 174 | void CopyUIRect(); 175 | void ClearUIRect(); 176 | void UpdateUIRect(); 177 | void ExcludeChildren(CArray& arrSelected); 178 | 179 | private: 180 | CArray m_arrTracker; //Tracking controls array 181 | CArray m_arrCloneRect;//Copies of the tracking rectangle 182 | CTrackerElement* m_pFocused; // Control has focus 183 | 184 | SIZE m_szForm; 185 | HCURSOR m_hNoDropCursor; 186 | }; 187 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | UIDesigner的原理 4 | 5 | 1、HOOKAPI 6 | 7 | ```c 8 | 9 | CHookAPI::CHookAPI(void) 10 | { 11 | #ifdef _DEBUG 12 | CreateFileAPI=(pfnCreateFile)HookAPI(_T("KERNEL32.dll"),LPCSTR("CreateFileW"),(FARPROC)Hook_CreateFile,GetModuleHandle(_T("Duilib_ud.dll"))); 13 | EnableCreateFile(true); 14 | 15 | HookAPI(_T("Duilib_ud.dll"),LPCSTR("?Invalidate@CPaintManagerUI@DuiLib@@QAEXAAUtagRECT@@@Z"),(FARPROC)Hook_Invalidate,m_InvalidateHookInfo); 16 | EnableInvalidate(true); 17 | 18 | HookAPI(_T("Duilib_ud.dll"),LPCSTR("?GetImageEx@CPaintManagerUI@DuiLib@@QAEPAUtagTImageInfo@2@PB_W0K@Z"),(FARPROC)Hook_GetImageEx,m_GetImageExHookInfo); 19 | EnableGetImageEx(true); 20 | #else 21 | CreateFileAPI=(pfnCreateFile)HookAPI(_T("KERNEL32.dll"),LPCSTR("CreateFileW"),(FARPROC)Hook_CreateFile,GetModuleHandle(_T("Duilib_u.dll"))); 22 | EnableCreateFile(true); 23 | 24 | HookAPI(_T("Duilib_u.dll"),LPCSTR("?Invalidate@CPaintManagerUI@DuiLib@@QAEXAAUtagRECT@@@Z"),(FARPROC)Hook_Invalidate,m_InvalidateHookInfo); 25 | EnableInvalidate(true); 26 | 27 | HookAPI(_T("Duilib_u.dll"),LPCSTR("?GetImageEx@CPaintManagerUI@DuiLib@@QAEPAUtagTImageInfo@2@PB_W0K@Z"),(FARPROC)Hook_GetImageEx,m_GetImageExHookInfo); 28 | EnableGetImageEx(true); 29 | #endif 30 | } 31 | 32 | ``` 33 | 34 | Hook_Invalidate的目的是为了绘制界面效果,增加控件的矩形大小,用来绘制绿色边框和虚线边框。 35 | 36 | ![Control_show.png](Control_show.png) 37 | 38 | 39 | 40 | 41 | 2、中间的画板区域 42 | 43 | CLayoutManager m_LayoutManager; 44 | 45 | CLayoutManager 继承自duilib的IDialogBuilderCallback类。 46 | 47 | 48 | ```c 49 | class CLayoutManager : public IDialogBuilderCallback 50 | 51 | CLayoutManager m_LayoutManager; 52 | 53 | ``` 54 | 55 | ```c 56 | // CUIDesignerView 绘制 57 | 58 | void CUIDesignerView::OnDraw(CDC* pDrawDC) 59 | { 60 | CUIDesignerDoc* pDoc = GetDocument(); 61 | ASSERT_VALID(pDoc); 62 | if (!pDoc) 63 | return; 64 | 65 | // TODO: 在此处为本机数据添加绘制代码 66 | CMemDC memDC(*pDrawDC, this); 67 | CDC* pDC = &memDC.GetDC(); 68 | 69 | CRect rectClient; 70 | GetClientRect(rectClient); 71 | CPoint point=GetScrollPosition(); 72 | rectClient.OffsetRect(point); 73 | pDC->FillSolidRect(rectClient,RGB(255, 255, 255)); 74 | 75 | // 获取duilib界面的大小 76 | CSize szForm=m_LayoutManager.GetForm()->GetInitSize(); 77 | CSize szFormOffset(FORM_OFFSET_X,FORM_OFFSET_Y); 78 | CDC hCloneDC; 79 | HBITMAP hNewBitmap; 80 | hCloneDC.CreateCompatibleDC(pDC); 81 | // 创建一张位图 82 | hNewBitmap=::CreateCompatibleBitmap(pDC->GetSafeHdc(),szForm.cx,szForm.cy); 83 | HBITMAP hOldBitmap=(HBITMAP)hCloneDC.SelectObject(hNewBitmap); 84 | // 这里绘制 85 | m_LayoutManager.Draw(&hCloneDC); 86 | pDC->BitBlt(szFormOffset.cx,szFormOffset.cy,szForm.cx,szForm.cy,&hCloneDC,0,0,SRCCOPY); 87 | hCloneDC.SelectObject(hOldBitmap); 88 | ::DeleteDC(hCloneDC); 89 | ::DeleteObject(hNewBitmap); 90 | 91 | m_MultiTracker.Draw(pDC,&szFormOffset); 92 | } 93 | 94 | ``` 95 | 96 | 97 | 3、控件跟踪器,负责选中控件的管理。内部有两个指针数组,分别保存选中的控件和控件的矩形大小。矩形数组主要是用于绘制。 98 | 99 | CUIDesignerView::OnLButtonDown ---> m_MultiTracker 100 | 101 | 102 | 鼠标单击控件是执行的操作。 103 | 104 | ```c 105 | void CUIDesignerView::OnLButtonDown(UINT nFlags, CPoint point) 106 | { 107 | // 。。。 108 | // 通过鼠标的点击点获取控件 109 | CControlUI* pControl=m_LayoutManager.FindControl(ptLogical); 110 | CTrackerElement* pTracker=NULL; 111 | if(pControl==NULL) 112 | pControl=m_LayoutManager.GetForm(); 113 | 114 | int nHit=m_MultiTracker.HitTest(ptLogical); 115 | int nType=GetControlType(pControl); 116 | if((nFlags&MK_CONTROL)==0&&nHit==hitNothing) 117 | m_MultiTracker.RemoveAll(); 118 | // 鼠标点有控件,new一个跟踪元素CTrackerElement。 119 | // 跟踪元素绑定通过Add绑定到跟踪器,支持多选 120 | if(nHit==hitNothing) 121 | m_MultiTracker.Add(CreateTracker(pControl)); 122 | else 123 | m_MultiTracker.SetFocus(ptLogical); 124 | if(nHit>=0||nType==typeControl) 125 | { 126 | // 注意这里面传入了dc,进行了绘制 127 | // DrawTrackerRect 128 | m_MultiTracker.Track(this, ptLogical, FALSE,&dc); 129 | } 130 | else 131 | { 132 | 133 | ``` 134 | 135 | 4、修改控件属性,分三步执行。 136 | 137 | (1)、PosBeginChanged通知m_UICommandHistory创建CUICommandElement* m_pBefore记录,内部保存一个TiXmlElement,用于保存此时的数据。 138 | 139 | ```xml 140 | 141 |