Main Page   Compound List   File List   Compound Members  

CSliderCtrlWithEcho Class Reference

List of all members.

Detailed Description

Specialized slider control that contains a text box.


Public Member Functions

 CSliderCtrlWithEcho ()
void Initialize (float min, float max, float init)
bool SetSliderValue (float userValue)
float GetSliderValue ()

Protected Member Functions

int ConvertUserValueToSliderPosition (float userValue) const
float ConvertSliderPositionToUserValue (int position) const
void UpdateSliderEcho ()
afx_msg void HScroll (UINT nSBCode, UINT nPos)
afx_msg void VScroll (UINT nSBCode, UINT nPos)
afx_msg void OnShowWindow (BOOL bShow, UINT nStatus)
bool IsOrientedVertical () const
virtual void OnScroll (float new_value)

Protected Attributes

float m_minimum_value
float m_value_range
CStatic m_MessageWnd

Static Protected Attributes

const int SLIDER_RESOLUTION = 100000


Constructor & Destructor Documentation

CSliderCtrlWithEcho::CSliderCtrlWithEcho  ) 
 

macro for adding runtime type information to this class. The cpp file will also need an IMPLEMENT_DYNAMIC declaration


Member Function Documentation

void CSliderCtrlWithEcho::Initialize float  min,
float  max,
float  init
 

Initialize the range and initial value of the control

Parameters:
min The value that the slider represents when the tick is all the way to the left/bottom
max The value that the slider represents when the tick is all the way to the right/top
init initial value (position) that the tick should be located at

bool CSliderCtrlWithEcho::SetSliderValue float  userValue  ) 
 

Set the controls tick pposition to represent a value between the min and max values of the slider See Initialize

Parameters:
userValue The position to set the tick to that represents a value
Returns:
true on success. If userValue is outside the min/max range of the control, return false

float CSliderCtrlWithEcho::GetSliderValue  ) 
 

Return the current value that the slider tick represents

int CSliderCtrlWithEcho::ConvertUserValueToSliderPosition float  userValue  )  const [protected]
 

Convert a floating point value to an integer tick position value

float CSliderCtrlWithEcho::ConvertSliderPositionToUserValue int  position  )  const [protected]
 

Convert an integer tick position to a floating point value

void CSliderCtrlWithEcho::UpdateSliderEcho  )  [protected]
 

Update the text in the static control that displays the current value the slider represents

void CSliderCtrlWithEcho::HScroll UINT  nSBCode,
UINT  nPos
[protected]
 

Called when the parent dialog receives a WM_HSCROLL message and the dialog "reflects" the message back to this control See MSDN documentation for information on parameters

void CSliderCtrlWithEcho::VScroll UINT  nSBCode,
UINT  nPos
[protected]
 

Called when the parent dialog receives a WM_VSCROLL message and the dialog "reflects" the message back to this control See MSDN documentation for information on parameters

void CSliderCtrlWithEcho::OnShowWindow BOOL  bShow,
UINT  nStatus
[protected]
 

Called when this control receives a WM_SHOWWINDOW message This control creates a static control to display the slider status. This message is caught to make sure the visibility state of the static text matches this control's state See MSDN documentation for information on parameters

bool CSliderCtrlWithEcho::IsOrientedVertical  )  const [protected]
 

True if this control is oriented vertically False if this control is oriented horizontally


Member Data Documentation

const int CSliderCtrlWithEcho::SLIDER_RESOLUTION = 100000 [static, protected]
 

A slider control uses integer values for positions. The position value needs to be converted into a floating point value for the user. By using a high position resolution, we can get higher precision floating point values

float CSliderCtrlWithEcho::m_minimum_value [protected]
 

floating point value representing the minimum value in the slider rance

float CSliderCtrlWithEcho::m_value_range [protected]
 

Total range of values covered from minimum to maximum. The maximum value is m_minimum_value + m_value_range

CStatic CSliderCtrlWithEcho::m_MessageWnd [protected]
 

A static "buddy" control for displaying the current slider value. The control is created and placed next to this control automatically


The documentation for this class was generated from the following files:
Generated on Thu Oct 2 02:02:54 2008 for MFC_SliderCtrlWithEcho by doxygen 1.3.1