共7条
1/1 1 跳转至页
[原创]用TCL为Tornado增加Dos Shell按钮

10.3.1.1 用TCL为Tornado增加Dos Shell按钮
by amine@263.net
有的用户经常需要使用命令行窗口,先运行Torvars.bat建立环境,再切换到工作目录,如果所有一切通过Tornado工具按钮来完成将非常方便。下面例子来自WindRiver网站的Techtip文章,讲述如何利用TCL完成这一简单的Tornado定制工作。
定制工作需要制作两个文件,一个为TCL脚本描述文件,另一个为按钮图标文件。两文件需要放到WIND_BASE下指定目录,如:
$WIND_BASE/host/resource/tcl/app-config/Tornado/03MsDos.win32.tcl
$WIND_BASE/host/resource/bitmaps/Launch/controls/msdos.bmp
重启Tornado后,会看到Dos Shell按钮和菜单项。激活按钮,会启动DOS窗口,Torvars.bat已经运行,并切换到相应的工程目录,可立即继续用户的操作。如下图:
[upload=jpg]UploadFile/2003111418445156642.jpg[/upload]
03MsDos.win32.tcl的内容如下:
proc dosShellInitUI {} {
controlCreate launch [list toolbarbutton \
-callback "LaunchDosShell" \
-name dosshell \
-tooltip "Launch DOS shell" \
-bitmap "[wtxPath host resource bitmaps launch controls]msdos.bmp"]
menuItemInsert \
-callback {LaunchDosShell} \
-after -bypath \
{&Tools &Debugger...} "&DOS Shell"
}
proc LaunchDosShell {} {
global tcl_platform
# get the directory for current project
set projDir [::Workspace::projectDirGet]
regsub -all {/} $projDir {\\} projDir
# determine which OS we are running under and
# store the appropriate command interpreter name
if { $tcl_platform(os) == "Windows NT"} {
# set to use NT command interpreter
set cmd_interp cmd.exe
} else {
# set to use 95 command interpreter
set cmd_interp1 "[wtxPath host x86-win32 bin]torvars.bat"
regsub -all {/} $cmd_interp1 {\\} cmd_interp1
set cmd_interp "command.com /K $cmd_interp1"
}
# start the command interpreter
toolLaunch "DosShell" "$cmd_interp" "$projDir" 0 0 0 0 0 0
}
dosShellInitUI
图标文件msdos.bmp的制作简单,只不过注意大小,一般20X20就行。
[align=right][color=#000066][此贴子已经被作者于2003-11-14 18:46:38编辑过][/color][/align]
关键词: 原创 Tornado 增加 Shell 按钮

共7条
1/1 1 跳转至页
回复
打赏帖 | |
---|---|
分享汽车防盗系统的组成与分类(一)被打赏5分 | |
VOFA+波形显示+JYD-31蓝牙发送和解析不定长数据被打赏10分 | |
宏定义和const关键字定义被打赏5分 | |
换取逻辑分析仪】STM32G4从入门到大师之五:ADC中断方式单路采集电压被打赏16分 | |
【换取逻辑分析仪】STM32G4从入门到大师之四:ADC查询方式单路采集电压被打赏14分 | |
【分享开发笔记,赚取电动螺丝刀】几个单片机I2S外设的BLCK时钟对比被打赏20分 | |
【功率监测与控制系统DIY活动成果贴】DIY功率计与LabVIEW数据采集被打赏100分 | |
【分享开发笔记,赚取电动螺丝刀】使用ESP32S3调试I2S音频模块MAX98357被打赏22分 | |
【Freertos】任务管理被打赏10分 | |
分享博世的两种不同的喷射系统模式被打赏5分 |