Graphics Reference
In-Depth Information
.lib library file. A developer who uses our MFC _ Library1 library must
Compile results. The
Microsoft Visual Studio IDE
stores the compile results from
C++ projects in the Debug or
the Release folder.
include this library file in the final linking of her program.
The library we have created, MFC _ Library1 , contains the SliderCtrlWith
Echo class and a utility function ( ReplaceDialogControl() ).
Let's examine
this function in more detail.
Tutorial 2.8. Grouping of GUI Elements
Tutorial 2.8.
Project Name:
MFC _ GroupControls
Library Support:
MFC _ Library1
Goal. Demonstrate that sometimes it is advantageous to work with a con-
tainer GUI element and the corresponding programming code to organize a
user interface.
Approach. Define a container object to contain related GUI elements and
define a corresponding data type and control variable to manage the new
container object.
Figure 2.11 is a screenshot of running Tutorial 2.8. The checkbox and the slider
bar at the lower-left corner are meant for controlling the radius of a circle. Since
we have not learned how to draw a circle, this application does not do anything.
In this case, we are interested in the organization of the circle radius control GUI
elements and the corresponding programming code.
Figure 2.11.
Tutorial
2.8.
GUI Element: Application Window
GUI ID: IDD_GROUPCONTROLS_DIALOG
Control Variable: m_pMainWnd (TutorialApp)
Contrl Variable Data Type: CTutorialDlg
GUI Element: Place Holder
GUI ID: IDC_PLACEHOLDER
Control Variable: none
Contrl Variable Data Type: N/A
GUI Element: Circle Radius Control
GUI ID: IDD_CONTROLS_CHILDDLG
Control Variable: m_circle_controls (TutorialDlg.h)
Contrl Variable Data Type: CCircleRadiusControls
Place into
IDC_PLACEHOLDER
to present to users
GUI Element: Slider Contrl With Echo
GUI ID: IDC_RADIUS_SLIDER_BAR
Control Variable: m_CircleRadiusBar (CircleRadiusControls.h)
Contrl Variable Data Type: CSliderCtrlWithEcho
Figure 2.12.
GUI elements in Tutorial 2.8.
 
 
Search WWH ::




Custom Search