
1.4 集成开发环境的工具栏
虽然通过菜单可以调用各种命令,但是菜单的操作相对比较繁琐,而快捷键又需要用户记忆,所以有时候还显得不够方便。Visual C++ 6.0提供了一批预先定义好的工具栏,只要单击其中相应的按钮就能访问那些经常使用的命令。
Visual C++ 6.0 IDE的工具栏以停靠窗口的形式出现,工具栏的位置可以通过鼠标拖曳的方法来改变,并可以根据需要在显示与隐藏之间进行切换。一般的方法是执行Tools菜单中的Customize菜单命令,打开Customize对话框,然后单击Toolbars标签,并根据需要在Toolbars列表中选择要放到工具栏上的按钮图标,如图1-3所示。也可以在菜单栏或工具栏的空白处右击,然后在一个弹出式菜单中选择要显示或隐藏的工具,如图1-4所示。

图1-3 在Customize对话框中设置要显示的工具栏

图1-4 在弹出菜单中设置要显示的工具栏
如果要恢复工具栏或菜单栏到系统原来的默认状态,则在Customize对话框中单击Reset或Reset All按钮即可。
1.4.1 Standard工具栏
Standard工具栏中包括一些与文件和编辑有关的常用操作命令,每个按钮的功能与文件(File)、编辑(Edit)和查看(View)等主菜单中的某个菜单项对应。图1-5给出了Standard工具栏的一般形式,Standard工具栏按钮从左到右依次对应的菜单项为New Text File、Open、Save、Save All、Cut、Copy、Paste、Undo、Redo、Workspace、Output、Window List、Find in Files、Find、Search。

图1-5 Standard工具栏
1.4.2 Build MiniBar工具栏
Build MiniBar工具栏中主要包括工程的选择、编译、链接和调试等操作命令,每个按钮的功能与编译和调试菜单中某个菜单项对应。图1-6给出了编译微型条工具栏(Build MiniBar)的一般形式,Build MiniBar工具栏按钮从左到右依次对应的菜单项为Compile、Build、Stop Build、Execute Program、Go、Insert/Remove Breakpoint。

图1-6 Build MiniBar工具栏
1.4.3 Debug工具栏
当程序编译、链接完成后,若发现某对象的结果有误,可启用调试器Debugger对程序进行调试,从而发现并改正程序中的错误。图1-7给出了Debug工具栏的一般形式,工具栏按钮从左到右依次为Restart、Stop Debugging、Break Execution、Show Next Statement、StepInto、StepOver、StepOut、Run toCursor、QuickWatch、Watch、Variables、Registers、Memory、Call Stack、Disassembly。当处于调试状态时,Debug菜单会取代Build菜单出现在菜单栏中,Debug菜单项与Debug工具栏中的部分按钮相对应。

图1-7 Debug工具栏