几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(VB.NET/C#) (http://www.dimcax.com/hust/forumdisplay.php?f=176)
-   -   【转帖】[r16.2 and plus]加载工具条[xml无处不在] - 精华帖集合 (http://www.dimcax.com/hust/showthread.php?t=14077)

yang686526 2009-04-29 04:57 PM

【转帖】[r16.2 and plus]加载工具条[xml无处不在] - 精华帖集合
 
[r16.2 and plus]加载工具条[xml无处不在] - 精华帖集合
www.dimcax.com
[r16.2 and plus]加载工具条[xml无处不在]
不能贴图了?
//-------------------------
autocad 2006 customization guide>
customize the user interface
//-------------------------
autocad 2008 customization guide>
customize the user interface
//---------------------------------
在帮助文档中有如下描述:
the xml-based cui file replaces the menu files used in releases prior to autocad 2006. instead of using a text editor to customize menu files (mnu and mns files), you customize the user interface from within autocad.
这意味着 做工具条和菜单很简单,开发者专心把对象和命令写好,autodesk帮你实现了风格一致、可自动加载的主要界面元素。mnu 文件和编译代码实现工具条成为历史!
//----------------------------------------
实例:
adobe toolbar
google earth toolbar
在(r16.2 and plus)都这么用。
初探:
c:\documents and settings\xxx\application data\autodesk\autocad 2008\r17.1\enu\support
(注:xxx可不是我的用户名,只是临时修改了一下,别误会啊!)
acad.cui
复制一份,改扩展名 xml,用dreamweaver或vs2005 打开。(能折叠标签)
< custsection>
<header>
<commonconfiguration>
<commonitems>
<partialmenufile>googleearth.cui</partialmenufile> //注意这里
</commonitems>
</commonconfiguration>
<workspaceroot>

</workspaceroot>
</header>
<menugroup>
<menuroot>
<popmenuroot>
</popmenuroot>
<toolbarroot>
<toolbar>
</toolbar>
<toolbar>
</toolbar>
</toolbarroot>
<menuroot>
</menugroup>
< /custsection>

//------------------------------------------------
好了,仔细阅读 guide吧
[ ]
有xml方法,用程序实现就显得。。。下面附com方法的源代码和简单使用说明:
关于代码使用的几点说明:
1 修改createtoolbar()函数的button个数和addtoolbarbutton()中的参数
2 在入口函数的载入部分加上
createtoolbar();
3 在入口函数的卸载部分加上
cleanuptoolbar();
//------------------------------------------代码-------------------------
hr = tlbr->addtoolbarbutton(index, l"road", l"creates a road: agzs_road", l"gzs_road ", vtfalse, &button1);
button1->setbitmaps(l"agzs\\support\\data_16_road.bmp",l"agzs\\support\\data_16_road.bmp");
button1->release();
//-------------------------------------------说明------------------------
l 由于com要求字符串为unicode编码,所有字符串前加 l,以便转化成宽字符
l"road" 是button的名字,也是鼠标放上后的tip显示
l"creates a road: agzs_road" 鼠标放上后,在状态栏显示的说明性内容
l"gzs_road " 命令对应的字符串+一个空格,为什么加一个空格?
为了按下button后自动运行命令,如果不加,
则需要按回车才能运行命令,假如注册命令的函数如下:
acedregcmds->addcommand(_t("test_commands"),
_t("agzs_road"),
_t("gzs_road"),
acrx_cmd_transparent,
createroad);
agzs\\support\\data_16_road.bmp
把图片放到autocad搜索路径。比如安装目录,以上字符串表明在安装目录建立了
agzs\support文件夹。
          图片最好是16*16的,24位bmp。
[ ]
l"gzs_road " 命令对应的字符串+一个空格,注意字符串最后为空格字符的原因是
为 了按下button后自动运行命令,如果不加,
多谢斑竹,可是如果偶想用mfc的方式该怎么办,有没有个简单例子呀
多谢,多谢,版主真是雪中送炭呀。牛
版主什么时候有空呀
怎么实现带下拉菜单的工具栏按钮
看不到啊
更新
这回圆满了
晕,下载不了


所有的时间均为北京时间。 现在的时间是 04:30 AM.