金山卫士界面源码解读及界面库分离(1)

金山对其金山卫士进行了开源,目前已经公开了6个子项目。

 

不过也许很多人和我一样对安全部分的功能并不感兴趣,毕竟那需要比较艰辛的工作。

 

但对其所运用的界面库部分可能比较感兴趣,该库是基于目前比较流行的DIRECTUI技术,非常适合于工具软件的开发,例如互联网软件及娱乐软件等。

 

不过目前该库是作为源代码进行调用的,使用并不方便。所以我准备将其从金山卫士的项目中分离出来,作为独立的库进行调用,并同时撰写其使用文档资料,欢迎有此同好的朋友加入。

 

原来希望将库做成DLL形式的,后来发现全部是模版实现,没办法导出.

 

所以暂时先以源码形式调用,以后有机会再看如何处理成DLL的.

 

要阅读金山代码需要一定的WTL编程经验。

 

 

 使用方法可以先参考附件当中的样例代码,详细文档资料将陆续编写出来.

 

该界面库是典型的DirectUI的实现方法,相信TX的也是基本类似,不过TX肯定实现的更加深入一些,

 

但通过该框架,继续深入开发估计也不会太困难.

 

目前编写了两个预览界面,如下所示:

金山卫士界面源码解读及界面库分离(1)_第1张图片

描述XML如下:

<layer title="sample1" width="600" height="470" appwin="1"> <header class="mainhead" width="full" height="23"> <icon src="ICON_MAIN" mce_src="ICON_MAIN" pos="5,4"/> <text class="dlgtitle" pos="25,6">样例程序1</text> <imgbtn id="60003" class="linkimage" skin="minbtn" pos="-105,1"/> <imgbtn id="60002" class="linkimage" skin="maxbtn" pos="-73,1"/> <imgbtn id="60001" class="linkimage" skin="closeonlybtn" pos="-43,1"/> </header> <body class="mainbody" width="full" height="full"> <dlg pos="0,0,-0,-0" crbg=F7FBBF> <text class="hellowordstyle" pos="50,200">hello world!</text> </dlg> </body> <footer class="mainfoot" width="full" height="23" crbg=FFB9B9> </footer> </layer>

 

金山卫士界面源码解读及界面库分离(1)_第2张图片

XML如下:

<layer title="sample1" width="600" height="470" appwin="1"> <header class="mainhead" width="full" height="31"> <icon src="ICON_MAIN" mce_src="ICON_MAIN" pos="5,4"/> <text class="dlgtitle" pos="25,6">样例程序1</text> <imgbtn id="60003" class="linkimage" skin="minbtn" pos="-105,0"/> <imgbtn id="60002" class="linkimage" skin="maxbtn" pos="-79,0"/> <imgbtn id="60001" class="linkimage" skin="closeonlybtn" pos="-53,0"/> </header> <body class="mainbody" width="full" height="full"> <button id="1" class="normalbtn" pos="50,20,110,40">普通按钮</button> <text class="infostyle" pos="120,25,180">信息显示:</text> <text id="2" class="infostyle" pos="200,25">Ready</text> <hr style="dot" mce_style="dot" size=1 pos="50,50,250,50" crbg=888888 /> <check id="3" check=4 pos="50,60">复选框1</check> <check id="4" pos="50,80">复选框2</check> <hr style="dot" mce_style="dot" size=1 pos="50,100,250,100" crbg=888888 /> <radio id="5" check=4 pos="50,120">Radio按钮1</radio> <radio id="6" pos="50,140">Radio按钮2</radio> <radio id="7" pos="50,160">Radio按钮3</radio> <progress id="8" pos="50,200,250,210" min="0" max="100" value="30" showpercent="1" bgskin="progressbg" posskin="progresspos" show="1" /> <button id="9" class="normalbtn" pos="50,220,110,240">增加</button> <button id="10" class="normalbtn" pos="120,220,180,240">减少</button> <img id="11" pos="50,250" skin="loading" sub="0"/> <text class="infostyle" pos="70,250">Loading...</text> </body> <footer class="mainfoot" width="full" height="34" crbg=FFB9B9> </footer> </layer>

 

 

 

 

两个界面都是比较基础的界面,没有使用典型的TAB布局,更加深入的文章请关注后续文章.

 

 

先看各位同学看代码,有哪方面的疑惑,我再针对反馈来写其他的介绍文章.

 

附件下载:

http://download.csdn.net/source/3108296

 

你可能感兴趣的:(header,Class,文档,dll,金山,layer)