Status Bars and Toolbars
l Working with Toolbarsm Deleting Toolbar Buttons
m Adding Buttons to a Toolbar
m The CToolBar Class's Member Functions
l Working with Status Bars
m Creating a New Command ID
m Creating the Default String
m Adding the ID to the Indicators Array
m Creating the Pane's Command-Update Handler
m Setting the Status Bar's Appearance
l Working with Rebars
Building a good user interface is half the battle of programming a Windows application.
Luckily, Visual C++ and its AppWizard supply an amazing amount of help in creating an
application that supports all the expected user-interface elements, including menus,
dialog boxes, toolbars, and status bars. The subjects of menus and dialog boxes are
covered in Chapters 2, "Dialogs and Controls," and 8, "Building a Complete Application:
ShowString." In this chapter, you learn how to get the most out of toolbars and status
bars.
Working with Toolbars
The buttons on a toolbar correspond to commands, just as the items on a menu do.
Although you can add a toolbar to your application with AppWizard, you still need to
use a little programming polish to make things just right. This is because every
application is different and AppWizard can create only the most generally useful
toolbar for most applications. When you create your own toolbars, you will probably
want to add or delete buttons to support your application's unique command set.
For example, when you create a standard AppWizard application with a toolbar,
AppWizard creates the toolbar shown in Figure 9.1. This toolbar provides buttons for
the commonly used commands in the File and Edit menus, as well as a button for
displaying the About dialog box. What if your application does not support these
commands? It's up to you to modify the default toolbar to fit your application.
FIG. 9.1 The default toolbar provides buttons for commonly used commands.
No comments:
Post a Comment