环境:
下载 https://github.com/duilib/duilib
在VS2013中编译, 分别编译解决方案, 分别得到 
点击(此处)折叠或打开
  1. DuiLib.dll* duilib.xml DuiLib_d.lib DuiLib_u.lib DuiLib_ud.lib DuiLib.lib
  2. DuiLib_d.dll* DuiLib_u.dll* DuiLib_ud.dll*
从源码中抽取必要的 文件, 得到 开发环境包. DUILIB 的配置和使用-LMLPHPduilib_dev.zip
新建一个VS2013 的 WIN32工程.  在 sln 工程目录下加入 duilib的开发包.
并在工程属性: 

点击(此处)折叠或打开

  1. <VC++目录>/<包含目录> 添加 $(SolutionDir)/duilib/inc
  2. <VC++目录>/<包含目录> 添加 $(SolutionDir)/duilib/lib
  3. <链接器>/<附加依赖项> 添加对应的 lib 文件.
代码 stdafx.h 加入
点击(此处)折叠或打开
  1. //引入 DUILIB
  2. #include "UIlib.h"
  3. using namespace DuiLib;

  4. #ifdef _DEBUG
  5. # ifdef _UNICODE
  6. #        pragma comment(lib, "DuiLib_ui.lib")
  7. #    else
  8. #        pragma comment(lib, "DuiLib_d.lib")
  9. #    endif
  10. #else
  11. # ifdef _UNICODE
  12. # pragma comment(lib, "DuiLib_u.lib")
  13. # else
  14. # pragma comment(lib, "DuiLib.lib")
  15. # endif
  16. #endif
加入XML 的 UI文件. 到对应的 Debug/release/unicode_debug等目录中. 同时拷贝对应 DLL 文件到这行执行目录中.

点击(此处)折叠或打开

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Window mininfo="200,360" size="360,600">
  3.     <Font shared="true" id="0" name="幼圆" size="12" default="true" />
  4.     <Font shared="true" id="1" name="微软雅黑" size="18" />
  5.     <Include source="scrollbar.xml" />
  6.     <Default shared="true" name="Slider" value="thumbsize="10,10" bkimage="file='bg.bmp' corner='6,0,6,0' mask='#FFFF00FF'" foreimage="file='fg.bmp' corner='6,0,6,0' mask='#FFFF00FF'" thumbimage="file='thumb.bmp' source='30,0,40,10' mask='#FFDAEBF9'" thumbhotimage="file='thumb.bmp' source='10,0,20,10' mask='#FFDAEBF9'" " />
  7.     <Default shared="true" name="Button" value="textcolor="#000000" hottextcolor="#FFFFFF" focusedtextcolor="#000000" pushedtextcolor="#77a8de" normalimage="file='Button/btn.png' corner='5,11,5,11' source='0,0,96,24'" hotimage="file='Button/btn.png' corner='5,11,5,11' source='0,24,96,48'" pushedimage="file='Button/btn.png' corner='5,11,5,11' source='0,48,96,72'" disabledimage="file='Button/btn.png' corner='5,11,5,11' source='0,72,96,96'"" />
  8.     <Default shared="true" name="Option" value="textcolor="#FFbac0c5" hottextcolor="#FF386382" selectedtextcolor="#FF386382" disabledtextcolor="#FFbac0c5" textpadding="18,2,0,0" align="left" selectedimage="file='Button/RadioBtnSel.png' source='0,0,13,13' dest='0,5,14,19'" normalimage="file='Button/RadioBtnNon.png' source='0,0,13,13' dest='0,5,14,19'"" />
  9.     <Default shared="true" name="CheckBox" value="textcolor="#FFbac0c5" hottextcolor="#FF386382" selectedtextcolor="#FF386382" disabledtextcolor="#FFbac0c5" textpadding="20,2,0,0" align="left" selectedimage="file='Icon/checked.png' dest='0,2,16,18'" normalimage="file='Icon/unchecked.png' dest='0,2,16,18'"" />
  10.     
  11.     <VerticalLayout inset="10,6,10,6" bkcolor="#FFEA679F" colorhsl="true" bkimage="file='voice_rect.png' xtiled='true' ytiled='true' dest='0,0,200,400'">
  12.         <Slider name="alpha_controlor" min="20" max="255" value="255"/>
  13.         <Control height="4"/>
  14.         <Slider name="h_controlor" max="360" value="180"/>
  15.         <Control height="4"/>
  16.         <Slider name="s_controlor" max="200" value="100"/>
  17.         <Control height="4"/>
  18.         <Slider name="l_controlor" max="200" value="100"/>
  19.         <Button name="changeskinbtn" height="20" text="换肤" maxwidth="120" />
  20.         <RichEdit name="testrichedit" bordercolor="#FF0000" bordersize="0" borderround="18,18" inset="4,2,4,2" bkcolor="#A0F2F5FA" bkcolor2="#A0FF0000" bkcolor3="#A0F2F5FA" font="1" multiline="true" vscrollbar="true" autovscroll="true" enabled="true" rich="true" readonly="false" text="1爱3">
  21.             <Control bkcolor="#FFF22E2E" float="true" pos="80,40,260,220" bkimage="winbk.bmp" />
  22.             <Button name="insertimagebtn" float="0.5,0.5,0.5,0.5" pos="-80,-10,80,10" text="删除自己" />
  23.         </RichEdit>
  24.         <Control height="26"/>
  25.         <Edit name="testedit" text="{a www.baidu.com}ddd{/a}" showhtml="true" maxwidth="280" bkcolor="#0000E000" nativebkcolor="#0000E000"/>
  26.         <RichEdit name="testrichedit1" bordercolor="#FF0000" bordersize="2" borderround="8,8" inset="4,2,4,2" bkcolor="#FFE2E5EA" bkcolor2="#FF00F5DA" bkcolor3="#FFF2F5FA" font="1" multiline="false" rich="false" hscrollbar="true" autohscroll="true"/>
  27.         <DateTime name="DateTime" width="200" height="30" bkcolor="#FFE2E5EA" padding="0,5,0,0" />
  28.         <CheckBox name="CheckBox1" width="20" height="20" bkcolor="#FFEA679F" />
  29.         <ComboBox name="ComboBox1" width="200" height="30" bkcolor="#FFEA679F" bordersize="1" bordercolor="0xFFFF0000">
  30.             <ListLabelElement text="11111111111111"/>
  31.             <ListLabelElement text="22222222222222"/>
  32.             <ListLabelElement text="33333333333333" selected="true"/>
  33.             <ListLabelElement text="44444444444444"/>
  34.             <ListLabelElement text="55555555555555"/>
  35.             <ComboBox height="30" bkcolor="#FF00679F" >
  36.                 <Edit text="{a www.baidu.com}ddd{/a}" />
  37.                 <ListLabelElement text="666666666666666"/>
  38.             </ComboBox>
  39.             <Edit text="{a www.baidu.com}ddd{/a}" />
  40.         </ComboBox>
  41.         <TreeView bkcolor="#ffffffff" visiblefolderbtn="true" visiblecheckbtn="true" vscrollbar="true" >
  42.             <TreeNode text="A1" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
  43.             <TreeNode text="B1" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
  44.                 <TreeNode text="C1" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
  45.                     <TreeNode text="D1" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
  46.                         <Button text="扩展按钮" width="100" />
  47.                     </TreeNode>
  48.                     <Button text="扩展按钮" width="100" />
  49.                 </TreeNode>
  50.                 <Edit text="扩展文本框" tipvalue="扩展文本框" width="100" />
  51.             </TreeNode>
  52.             <Edit text="扩展文本框" tipvalue="扩展文本框" width="100" />
  53.             </TreeNode>
  54.             <TreeNode text="A2" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
  55.             <TreeNode text="B2" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
  56.                 <TreeNode text="C2" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
  57.                     <TreeNode text="D2" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
  58.                         <Option text="扩展单选框" width="100" group="RadioBoxTest" />
  59.                     </TreeNode>
  60.                     <Option text="扩展单选框" width="100" group="RadioBoxTest" />
  61.                 </TreeNode>
  62.                 <CheckBox text="扩展复选框" width="100" />
  63.             </TreeNode>
  64.             <CheckBox text="扩展复选框" width="100" />
  65.             </TreeNode>
  66.         </TreeView>
  67.     </VerticalLayout>
  68. </Window>
去掉原工程中的代码. 添加为自己的. 
DUILIB 的配置和使用-LMLPHPWin32Prj_Duilib.zip




01-08 14:44