soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SSpinButtonCtrl Class Reference

A spin button control class derived from TWindowProxy<ISpinButtonCtrl>. More...

#include <SSpinButtonCtrl.h>

Public Member Functions

 SSpinButtonCtrl (void)
 Define the SObject type and name, base class is SWindow, control name is spinButton.
 
 ~SSpinButtonCtrl (void)
 Destructor for SSpinButtonCtrl.
 
SWindowGetBuddy () const
 Retrieves the buddy window associated with the spin button.
 
void SetValue (int nValue) OVERRIDE
 Sets the current value of the spin button.
 
void SetRange (int nMin, int nMax) OVERRIDE
 Sets the range of values for the spin button.
 
void SetStep (UINT nStep) OVERRIDE
 Sets the step size for the spin button.
 
int GetValue () SCONST OVERRIDE
 Retrieves the current value of the spin button.
 
IWindow * GetIBuddy () SCONST OVERRIDE
 Retrieves the buddy window interface associated with the spin button.
 

Protected Types

enum  ActionButton { ACTION_NULL = -1 , ACTION_UP , ACTION_DOWN }
 Enumeration for action buttons. More...
 

Protected Member Functions

void GetDesiredSize (SIZE *psz, int nParentWid, int nParentHei) OVERRIDE
 Calculates the desired size of the control.
 
virtual BOOL NeedRedrawWhenStateChange () OVERRIDE
 Determines whether the control needs to be redrawn when its state changes.
 
virtual void OnColorize (COLORREF cr)
 Handles colorization of the control.
 
void OnValueChanged (bool bInit=false)
 Handles value change events.
 
void OnScaleChanged (int scale)
 Handles scale change events.
 
void OnLButtonDown (UINT nFlags, CPoint point)
 Handles left mouse button down events.
 
void OnLButtonUp (UINT nFlags, CPoint point)
 Handles left mouse button up events.
 
void OnMouseMove (UINT nFlags, CPoint point)
 Handles mouse move events.
 
void OnPaint (IRenderTarget *pRT)
 Handles paint events.
 
void OnTimer (char cTimerId)
 Handles timer events.
 
BOOL OnBuddyChange (IEvtArgs *pEvt)
 Handles buddy change events.
 
int OnCreate (void *)
 Handles creation events.
 
void OnClick ()
 Handles click events.
 
HRESULT OnAttrValue (const SStringW &strValue, BOOL bLoading)
 Maps messages to handler functions.
 
virtual HRESULT SetAttribute (const SNS::SStringW &amp;amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 Maps attributes to member variables.
 

Protected Attributes

int m_nMax
 
int m_nMin
 
int m_nValue
 
UINT m_uStep
 
BOOL m_bCircle
 
SStringW m_strBuddy
 
SAutoRefPtr< ISkinObjm_pUpSkin
 
SAutoRefPtr< ISkinObjm_pDownSkin
 
ActionButton m_iActionBtn
 

Detailed Description

A spin button control class derived from TWindowProxy<ISpinButtonCtrl>.

This class represents a spin button control that can be used to increase or decrease a value within a specified range.

Definition at line 21 of file SSpinButtonCtrl.h.

Member Enumeration Documentation

◆ ActionButton

Enumeration for action buttons.

Enumerator
ACTION_NULL 

No action.

ACTION_UP 

Up action.

ACTION_DOWN 

Down action.

Definition at line 216 of file SSpinButtonCtrl.h.

Constructor & Destructor Documentation

◆ SSpinButtonCtrl()

SNSBEGIN SSpinButtonCtrl::SSpinButtonCtrl ( void )

Define the SObject type and name, base class is SWindow, control name is spinButton.

Constructor for SSpinButtonCtrl.

Definition at line 5 of file SSpinButtonCtrl.cpp.

◆ ~SSpinButtonCtrl()

SSpinButtonCtrl::~SSpinButtonCtrl ( void )

Destructor for SSpinButtonCtrl.

Definition at line 18 of file SSpinButtonCtrl.cpp.

Member Function Documentation

◆ GetBuddy()

SWindow * SSpinButtonCtrl::GetBuddy ( ) const

Retrieves the buddy window associated with the spin button.

Returns
Pointer to the buddy SWindow object.

Definition at line 249 of file SSpinButtonCtrl.cpp.

◆ GetDesiredSize()

void SSpinButtonCtrl::GetDesiredSize ( SIZE * psz,
int nParentWid,
int nParentHei )
protected

Calculates the desired size of the control.

Parameters
pszPointer to the SIZE structure to receive the desired size.
nParentWidWidth of the parent window.
nParentHeiHeight of the parent window.

Definition at line 54 of file SSpinButtonCtrl.cpp.

◆ GetIBuddy()

IWindow * SSpinButtonCtrl::GetIBuddy ( )

Retrieves the buddy window interface associated with the spin button.

Returns
Pointer to the buddy IWindow interface.

Definition at line 49 of file SSpinButtonCtrl.cpp.

◆ GetValue()

int SSpinButtonCtrl::GetValue ( )

Retrieves the current value of the spin button.

Returns
The current value of the spin button.

Definition at line 44 of file SSpinButtonCtrl.cpp.

◆ NeedRedrawWhenStateChange()

virtual BOOL SSpinButtonCtrl::NeedRedrawWhenStateChange ( )
inlineprotectedvirtual

Determines whether the control needs to be redrawn when its state changes.

Returns
TRUE if the control needs to be redrawn, otherwise FALSE.

Reimplemented from SWindow.

Definition at line 89 of file SSpinButtonCtrl.h.

◆ OnAttrValue()

HRESULT SSpinButtonCtrl::OnAttrValue ( const SStringW & strValue,
BOOL bLoading )
protected

Maps messages to handler functions.

Handles attribute value changes.

Parameters
strValueThe new attribute value.
bLoadingFlag indicating if the change is during loading.
Returns
Result of the attribute change process.

Definition at line 76 of file SSpinButtonCtrl.cpp.

◆ OnBuddyChange()

BOOL SSpinButtonCtrl::OnBuddyChange ( IEvtArgs * pEvt)
protected

Handles buddy change events.

Parameters
pEvtPointer to the event arguments.
Returns
TRUE if the event was handled, otherwise FALSE.

Definition at line 176 of file SSpinButtonCtrl.cpp.

◆ OnClick()

void SSpinButtonCtrl::OnClick ( )
protected

Handles click events.

Definition at line 220 of file SSpinButtonCtrl.cpp.

◆ OnColorize()

void SSpinButtonCtrl::OnColorize ( COLORREF cr)
protectedvirtual

Handles colorization of the control.

Parameters
crColor reference for colorization.

Reimplemented from SWindow.

Definition at line 132 of file SSpinButtonCtrl.cpp.

◆ OnCreate()

int SSpinButtonCtrl::OnCreate ( void * )
protected

Handles creation events.

Parameters
lpCreate structure.
Returns
Result of the creation process.

Definition at line 207 of file SSpinButtonCtrl.cpp.

◆ OnLButtonDown()

void SSpinButtonCtrl::OnLButtonDown ( UINT nFlags,
CPoint point )
protected

Handles left mouse button down events.

Parameters
nFlagsFlags associated with the mouse event.
pointThe position of the mouse cursor.

Definition at line 101 of file SSpinButtonCtrl.cpp.

◆ OnLButtonUp()

void SSpinButtonCtrl::OnLButtonUp ( UINT nFlags,
CPoint point )
protected

Handles left mouse button up events.

Parameters
nFlagsFlags associated with the mouse event.
pointThe position of the mouse cursor.

Definition at line 109 of file SSpinButtonCtrl.cpp.

◆ OnMouseMove()

void SSpinButtonCtrl::OnMouseMove ( UINT nFlags,
CPoint point )
protected

Handles mouse move events.

Parameters
nFlagsFlags associated with the mouse event.
pointThe position of the mouse cursor.

Definition at line 116 of file SSpinButtonCtrl.cpp.

◆ OnPaint()

void SSpinButtonCtrl::OnPaint ( IRenderTarget * pRT)
protected

Handles paint events.

Parameters
pRTPointer to the render target.

Definition at line 142 of file SSpinButtonCtrl.cpp.

◆ OnScaleChanged()

void SSpinButtonCtrl::OnScaleChanged ( int scale)
protectedvirtual

Handles scale change events.

Parameters
scaleThe new scale value.

Reimplemented from SWindow.

Definition at line 200 of file SSpinButtonCtrl.cpp.

◆ OnTimer()

void SSpinButtonCtrl::OnTimer ( char cTimerId)
protected

Handles timer events.

Parameters
cTimerIdIdentifier for the timer.

Definition at line 166 of file SSpinButtonCtrl.cpp.

◆ OnValueChanged()

void SSpinButtonCtrl::OnValueChanged ( bool bInit = false)
protected

Handles value change events.

Parameters
bInitFlag indicating if the change is during initialization.

Definition at line 86 of file SSpinButtonCtrl.cpp.

◆ SetAttribute()

virtual HRESULT SSpinButtonCtrl::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlineprotectedvirtual

Maps attributes to member variables.

Reimplemented from SWindow.

Definition at line 190 of file SSpinButtonCtrl.h.

◆ SetRange()

void SSpinButtonCtrl::SetRange ( int nMin,
int nMax )

Sets the range of values for the spin button.

Parameters
nMinThe minimum value of the range.
nMaxThe maximum value of the range.

Definition at line 28 of file SSpinButtonCtrl.cpp.

◆ SetStep()

void SSpinButtonCtrl::SetStep ( UINT nStep)

Sets the step size for the spin button.

Parameters
nStepThe step size to use when incrementing or decrementing the value.

Definition at line 39 of file SSpinButtonCtrl.cpp.

◆ SetValue()

void SSpinButtonCtrl::SetValue ( int nValue)

Sets the current value of the spin button.

Parameters
nValueThe new value to set.

Definition at line 22 of file SSpinButtonCtrl.cpp.

Member Data Documentation

◆ m_bCircle

BOOL SSpinButtonCtrl::m_bCircle
protected

Flag indicating if the spin button is circular.

Definition at line 206 of file SSpinButtonCtrl.h.

◆ m_iActionBtn

ActionButton SSpinButtonCtrl::m_iActionBtn
protected

Current action button.

Definition at line 222 of file SSpinButtonCtrl.h.

◆ m_nMax

int SSpinButtonCtrl::m_nMax
protected

Maximum value of the spin button.

Definition at line 202 of file SSpinButtonCtrl.h.

◆ m_nMin

int SSpinButtonCtrl::m_nMin
protected

Minimum value of the spin button.

Definition at line 203 of file SSpinButtonCtrl.h.

◆ m_nValue

int SSpinButtonCtrl::m_nValue
protected

Current value of the spin button.

Definition at line 204 of file SSpinButtonCtrl.h.

◆ m_pDownSkin

SAutoRefPtr<ISkinObj> SSpinButtonCtrl::m_pDownSkin
protected

Skin object for the down button.

Definition at line 210 of file SSpinButtonCtrl.h.

◆ m_pUpSkin

SAutoRefPtr<ISkinObj> SSpinButtonCtrl::m_pUpSkin
protected

Skin object for the up button.

Definition at line 209 of file SSpinButtonCtrl.h.

◆ m_strBuddy

SStringW SSpinButtonCtrl::m_strBuddy
protected

Buddy window identifier.

Definition at line 207 of file SSpinButtonCtrl.h.

◆ m_uStep

UINT SSpinButtonCtrl::m_uStep
protected

Step size for incrementing or decrementing the value.

Definition at line 205 of file SSpinButtonCtrl.h.


The documentation for this class was generated from the following files: