Overview
In the book's examples so far, mouse clicks have triggered most program activity. Even though menu commands might have been more appropriate, we've used mouse clicks because mouse-click messages are handled simply and directly within the Microsoft Foundation Class (MFC) library view window. If you want program activity to be triggered when the user chooses a command from a menu, you must first become familiar with the other application framework elements.This chapter concentrates on menus and the command routing architecture. Along the way, I'll introduce frames and documents and explain the relationships between these new application framework elements and the already familiar view element. You'll use the menu editor to lay out a menu visually, and you'll use the code wizards available from Class View to link document and view member functions to menu commands. You'll learn how to use special update command user interface member functions to enable and disable menu commands, and you'll learn how to use keyboard accelerators as menu shortcut keys.Because you're probably tired of circles and dialog boxes, we'll first examine two new MFC building blocks: the rich edit common control, which can add powerful text editing features to your application, and property sheets, which are ideal for setting edit options.