Tutorial 6
SliderCtrlWithEcho class
GOAL: Improve our knowledge from previous classes and define/customize
a new GUI element class, allowing increasing ability to read and maintain our system
PREREQUISITES: Tutorial 3 and the
'
SliderCtrlWithEcho' class added to the project
Learn and Use 'SliderCtrlWithEcho' class
- In 'TutorialDlg.h', add #include "SliderCtrlWithEcho.h" to the top
- Re-compile 'StdAfx.cpp', to update the pre-compile header.
- Add a Slider Control to the dialog window,
inside the Properties window, change
- to "Vertical" or "Horizontal"
- Add an output Control Variable to the slider, with
- Category to
- Variable Name to "m_SliderBar"
- Variable Type to
- In 'Tutorial.cpp', inside OnInitDialog(), add
// Initialize the slider bar with
// specific range and starting position
m_SliderBar.Initialize(0.0f, 100.0f, 1.0f);
- In 'Tutorial.cpp', inside OnTimer(...), you may add
// to retrieve slider position
float slideValue = m_SliderBar.GetSliderValue();
// and to set slider position
m_SliderBar.SetSliderValue(slideValue);
UpdateData(FALSE);
- In the Visual Studio project window, click
- >>
- >> to run
Figure 6.1 - Application Window
» Written by
William Frankhouser (
wjf2@washington.edu)
» Advised by
Kelvin Sung (
ksung@washington.edu)
as part of the project sponsored by the National Science Foundation under Grant No. 0442420. Any opinions, findings, and conclusions or recommendations expressed in this
material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
» Produced in the "Essential Concepts for Building Interactive Computer Graphics Applications", A.K. Peters, Ltd.