Chapter 12 -- Toolbars, Status Bars, and Rebars

[Previous] [Next]

Chapter 12

In this chapter, we'll continue our look at MFC by examining two new classes that you can use to enhance your applications' user interfaces: CToolBar and CStatusBar. CToolBar implements toolbars—ribbonlike windows containing push buttons (and sometimes other types of controls) that provide swift access to commonly used commands. CStatusBar is MFC's status bar class. A status bar is a window that displays context-sensitive help for menu items and toolbar buttons as well as other helpful information. Adding toolbars and status bars to MFC applications is easy because CToolBar and CStatusBar provide thorough encapsulations of these ubiquitous user interface (UI) elements.

Another feature of MFC that you'll learn about in this chapter is the new CReBar class, which wraps the rebar controls that were introduced with Microsoft Internet Explorer. Rebars convert ordinary toolbars into the stylized toolbars (also known as "coolbars") featured in Internet Explorer, Microsoft Visual C++, and other Microsoft applications. They are also the basis for "command bars"—menu bars with items that highlight like push buttons when the cursor passes over them—similar to the one that serves as the main menu in Visual C++. Thanks to CReBar, an MFC programmer can transform a CToolBar into a coolbar with just one or two lines of code. You'll see how in just a few moments.



Programming Windows with MFC
Programming Windows with MFC, Second Edition
ISBN: 1572316950
EAN: 2147483647
Year: 1999
Pages: 101
Authors: Jeff Prosise

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net