Chinaunix首页 | 论坛 | 博客
  • 博客访问: 34449
  • 博文数量: 18
  • 博客积分: 485
  • 博客等级: 下士
  • 技术积分: 125
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-28 11:55
文章分类
文章存档

2011年(18)

我的朋友

分类: C/C++

2011-05-14 18:39:32

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

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

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

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

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

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

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

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

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

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

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

描述XML如下:

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

XML如下:

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

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

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

附件下载:


 

阅读(1283) | 评论(0) | 转发(0) |
0

上一篇:Lua compared to Squirrel

下一篇:FLTK编程模型

给主人留下些什么吧!~~