1 / 17

Windows Programming Using MFC and Visual C ++ .Net

Windows Programming Using MFC and Visual C ++ .Net. Menus and Tool Bars. Menus. AppWizard creates two menu resources IDR_MAINFRAME The mainFrame menu is displayed when there is no childFrame. IDR_MAINFRAME. Menus. IDR_ " DocType " Type

schuyler
Download Presentation

Windows Programming Using MFC and Visual C ++ .Net

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows Programming Using MFC andVisual C++ .Net Menus and Tool Bars

  2. Menus • AppWizard creates two menu resources • IDR_MAINFRAME • The mainFrame menu is displayed when there is no childFrame IDR_MAINFRAME Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  3. Menus • IDR_"DocType"Type • The mainFrame menu when there is at least one childFrame IDR_IntroType Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  4. Place holder for new menu Menus • Menus are created or modified using the Menu Editor Menu resources Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  5. Menus • To create a new menu • Type a name in a menu placeholder • Set the menu's properties Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  6. Menus • Decide which class must handle this menu command • Document ? • View? • Mainframe? • App? • ChildFrame? • Use the class wizard to write a handler for the menu's COMMAND message Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  7. Menus Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  8. Menus Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  9. Menu Prompt • Menu prompt is the message that appears inside the status bar when the mouse is on the menu Menu Prompt • Enter menu's prompt in its property box Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  10. Short Cuts • For Alt key short cut, put & in front of a letter in the menu's caption New Men&u Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  11. Short Cuts • Enter other short cuts in the Accelerator Table Place holder for a new accelerator Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  12. Short Cut Properties Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  13. Menu State • A menu can be in one of the following states: • Enabled • Enabled(TRUE); • Disabled • Enable(FALSE); • Checked • SetCheck(TRUE); • Unchecked • SetCheck(FALSE); Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  14. Menu State • The state of a menu is set in the handler for the menu UPDATE_COMMAND_UI message void CIntroView::OnUpdateEditNew(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here pCmdUI->SetCheck(TRUE); } Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  15. Command Routing • Menus and Tools bars are a part of the MainFrame. • Who gets the menu commands? • Menu commands are routed to the following objects to a find a event handler • View • Document • ChildFrame • MainFrame • Application Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  16. ToolBars • Similar to Menus • Can have the same ID as a menu item • Can have Tool Tip Tool Tip Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

  17. ToolBars • A Toolbar Button's Tool Tip is also entered in its prompt property box • Prompt and Tool Tip strings are seperated by \n Introduction to Windows Programming Using MFC and Visual C++ .Net Menus and Tool Bars

More Related