Programming Microsoft Visual C++
As we learned in Chapter 9, Visual C++ 6.0 contains many features that are part of Internet Explorer 4.0: the Internet Explorer Common Controls. One of the new controls in the IE Common Controls is a new kind of toolbar called a rebar.
You're probably already familiar with the rebar if you have ever used Internet Explorer 4.0. The rebar differs from the default MFC toolbar in that it provides grippers and allows the user to "slide" its horizontal and vertical positions, whereas the MFC toolbar's position is changed via drag-and-drop docking. Rebars also allow the developer to provide many more internal control typessuch as drop-down menusthan are available in CToolBar.
Anatomy of a Rebar
Figure 14-5 shows the various terminology used on a rebar. Each internal toolbar in a rebar is called a band. The raised edge where the user slides the band is called a gripper. Each band can also have a label.
Figure 14-5. Rebar terminology.
MFC provides two classes that facilitate working with rebars:
- CReBarA high-level abstraction class that provides members for adding CToolBar and CDialogBar classes to rebars as bands. CReBar also handles communication (such as message notifications) between the underlying control and the MFC framework.
- CReBarCtrlA low-level wrapper class that wraps the IE ReBar control. This class provides numerous members for creating and manipulating rebars but does not provide the niceties that are found in CReBar.
Most MFC applications use CReBar and call the member function GetReBarCtrl, which returns a CReBarCtrl pointer to gain access to the lower-level control if needed.
Категории