Advanced MFC Programming
Advanced MFC Programming Advanced MFC Programming
Table of Contents TOOL BAR AND DIALOG BAR 1.1. Adding an Extra Docking Tool Bar Default Tool Bar Tool Bar Implementation Message Mapping Adding New Tool Bar Resource Declaring New Member Variable Creating New Tool Bar Command Message Mapping 1.2. Imitating the Behavior of Radio Buttons Radio Button & Check Box Sample 1.3. Check Box Implementation Using Boolean Type Variables Function CButton::SetButtonInfo(…) 1.4. Message Mapping for a Contiguous Range of Command IDs Contiguous IDs Modifying an ID 1.5. Fixing the Size of Tool Bar 1.6. Adding Combo Box to Tool Bar 1.7. Modifying the Default Styles of Tool Bar 1.8. Dialog Bar 1.9. Resizable Dialog Bar Deriving New Class from CDialogBar Resizing Edit Control Dynamic Layout Using the New Class 1.10. Adding Flyby and Tool Tip 1.11. Toggling Control Bars On/Off Summary: MENU 2.1 Message WM_COMMAND and UPDATE_COMMAND_UI Handling WM_COMMAND Command Enabling & Disabling a Command Changing Menu Text ii
Checking a Menu Item 2.2 Right Click Pop Up Menu Adding Menu Resource Trapping Right Button Clicking Event Using Class CMenu Implementing Right-Click Menu Message Mapping for Right-Click Menu 2.3 Updating Menu Dynamically Menu Struture Inserting and Removing Menu Item Sample Implementation 2.4 Bitmap Check 2.5 System Menu and Bitmap Menu Item System Menu Bitmap Menu Item New Functions Menu Modification Message Mapping for System Command 2.6 Owner-Draw Menu Overriding Two Functions Drawing a Bitmap Deriving a New Class from CMenu Overriding Function CMenu::MeasureItem(…) Overriding Function CMenu::DrawItem(…) Using the New Class 2.7 Changing the Whole Menu Dynamically Summary SPLITTER WINDOW 3.1 Implementing Static Splitter Windows 3.2 Dynamic Splitter Window 3.3 Customizing the Behavior of Split Bar Splitter Window Layout Overriding CSplitterWnd::DeleteRow(…) and CSplitterWnd:: DeleteColumn(…) Using the New Class 3.4 Customizing the Default Appearance Drawing Functions Sample 3.5 Splitter Window That Can’t be Resized by Tracking Summary iii
- Page 1: Advanced MFC Programming Supporting
- Page 5 and 6: Trapping Double Clicking Message Re
- Page 7 and 8: COMMON DIALOG BOXES 7.1 File Open a
- Page 9 and 10: 9.1 Outputting Text Using Different
- Page 11 and 12: Summary SAMPLE: SIMPLE PAINT 11.0 P
- Page 13 and 14: 13.2 Creating Applications without
- Page 15 and 16: Functions Implementing Comparisons
- Page 17 and 18: Chapter 1. Tool Bar and Dialog Bar
- Page 19 and 20: Chapter 1. Tool Bar and Dialog Bar
- Page 21 and 22: Chapter 1. Tool Bar and Dialog Bar
- Page 23 and 24: Chapter 1. Tool Bar and Dialog Bar
- Page 25 and 26: Chapter 1. Tool Bar and Dialog Bar
- Page 27 and 28: Chapter 1. Tool Bar and Dialog Bar
- Page 29 and 30: Chapter 1. Tool Bar and Dialog Bar
- Page 31 and 32: Chapter 1. Tool Bar and Dialog Bar
- Page 33 and 34: Chapter 1. Tool Bar and Dialog Bar
- Page 35 and 36: Chapter 1. Tool Bar and Dialog Bar
- Page 37 and 38: Chapter 1. Tool Bar and Dialog Bar
- Page 39 and 40: Chapter 1. Tool Bar and Dialog Bar
- Page 41 and 42: Chapter 1. Tool Bar and Dialog Bar
- Page 43 and 44: Chapter 1. Tool Bar and Dialog Bar
- Page 45 and 46: Chapter 1. Tool Bar and Dialog Bar
- Page 47 and 48: Chapter 1. Tool Bar and Dialog Bar
- Page 49 and 50: Chapter 2. Menu Chapter 2 Menu Menu
- Page 51 and 52: Chapter 2. Menu ON_COMMAND(ID_EDIT_
Table of Contents<br />
TOOL BAR AND DIALOG BAR<br />
1.1. Adding an Extra Docking Tool Bar<br />
Default Tool Bar<br />
Tool Bar Implementation<br />
Message Mapping<br />
Adding New Tool Bar Resource<br />
Declaring New Member Variable<br />
Creating New Tool Bar<br />
Command Message Mapping<br />
1.2. Imitating the Behavior of Radio Buttons<br />
Radio Button & Check Box<br />
Sample<br />
1.3. Check Box Implementation<br />
Using Boolean Type Variables<br />
Function CButton::SetButtonInfo(…)<br />
1.4. Message Mapping for a Contiguous Range of Command IDs<br />
Contiguous IDs<br />
Modifying an ID<br />
1.5. Fixing the Size of Tool Bar<br />
1.6. Adding Combo Box to Tool Bar<br />
1.7. Modifying the Default Styles of Tool Bar<br />
1.8. Dialog Bar<br />
1.9. Resizable Dialog Bar<br />
Deriving New Class from CDialogBar<br />
Resizing Edit Control<br />
Dynamic Layout<br />
Using the New Class<br />
1.10. Adding Flyby and Tool Tip<br />
1.11. Toggling Control Bars On/Off<br />
Summary:<br />
MENU<br />
2.1 Message WM_COMMAND and UPDATE_COMMAND_UI<br />
Handling WM_COMMAND Command<br />
Enabling & Disabling a Command<br />
Changing Menu Text<br />
ii