Advanced MFC Programming

Advanced MFC Programming Advanced MFC Programming

math.hcmuns.edu.vn
from math.hcmuns.edu.vn More from this publisher
11.04.2014 Views

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

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!