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. | |
SWindow * | GetBuddy () 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;strAttribName, const SNS::SStringW &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< ISkinObj > | m_pUpSkin |
SAutoRefPtr< ISkinObj > | m_pDownSkin |
ActionButton | m_iActionBtn |
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.
|
protected |
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.
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 | ( | void | ) |
Destructor for SSpinButtonCtrl.
Definition at line 18 of file SSpinButtonCtrl.cpp.
SWindow * SSpinButtonCtrl::GetBuddy | ( | ) | const |
Retrieves the buddy window associated with the spin button.
Definition at line 249 of file SSpinButtonCtrl.cpp.
|
protected |
Calculates the desired size of the control.
psz | Pointer to the SIZE structure to receive the desired size. |
nParentWid | Width of the parent window. |
nParentHei | Height of the parent window. |
Definition at line 54 of file SSpinButtonCtrl.cpp.
IWindow * SSpinButtonCtrl::GetIBuddy | ( | ) |
Retrieves the buddy window interface associated with the spin button.
Definition at line 49 of file SSpinButtonCtrl.cpp.
int SSpinButtonCtrl::GetValue | ( | ) |
Retrieves the current value of the spin button.
Definition at line 44 of file SSpinButtonCtrl.cpp.
|
inlineprotectedvirtual |
Determines whether the control needs to be redrawn when its state changes.
Reimplemented from SWindow.
Definition at line 89 of file SSpinButtonCtrl.h.
|
protected |
Maps messages to handler functions.
Handles attribute value changes.
strValue | The new attribute value. |
bLoading | Flag indicating if the change is during loading. |
Definition at line 76 of file SSpinButtonCtrl.cpp.
|
protected |
Handles buddy change events.
pEvt | Pointer to the event arguments. |
Definition at line 176 of file SSpinButtonCtrl.cpp.
|
protected |
Handles click events.
Definition at line 220 of file SSpinButtonCtrl.cpp.
|
protectedvirtual |
Handles colorization of the control.
cr | Color reference for colorization. |
Reimplemented from SWindow.
Definition at line 132 of file SSpinButtonCtrl.cpp.
|
protected |
Handles creation events.
lp | Create structure. |
Definition at line 207 of file SSpinButtonCtrl.cpp.
|
protected |
Handles left mouse button down events.
nFlags | Flags associated with the mouse event. |
point | The position of the mouse cursor. |
Definition at line 101 of file SSpinButtonCtrl.cpp.
|
protected |
Handles left mouse button up events.
nFlags | Flags associated with the mouse event. |
point | The position of the mouse cursor. |
Definition at line 109 of file SSpinButtonCtrl.cpp.
|
protected |
Handles mouse move events.
nFlags | Flags associated with the mouse event. |
point | The position of the mouse cursor. |
Definition at line 116 of file SSpinButtonCtrl.cpp.
|
protected |
Handles paint events.
pRT | Pointer to the render target. |
Definition at line 142 of file SSpinButtonCtrl.cpp.
|
protectedvirtual |
Handles scale change events.
scale | The new scale value. |
Reimplemented from SWindow.
Definition at line 200 of file SSpinButtonCtrl.cpp.
|
protected |
Handles timer events.
cTimerId | Identifier for the timer. |
Definition at line 166 of file SSpinButtonCtrl.cpp.
|
protected |
Handles value change events.
bInit | Flag indicating if the change is during initialization. |
Definition at line 86 of file SSpinButtonCtrl.cpp.
|
inlineprotectedvirtual |
Maps attributes to member variables.
Reimplemented from SWindow.
Definition at line 190 of file SSpinButtonCtrl.h.
void SSpinButtonCtrl::SetRange | ( | int | nMin, |
int | nMax ) |
Sets the range of values for the spin button.
nMin | The minimum value of the range. |
nMax | The maximum value of the range. |
Definition at line 28 of file SSpinButtonCtrl.cpp.
void SSpinButtonCtrl::SetStep | ( | UINT | nStep | ) |
Sets the step size for the spin button.
nStep | The step size to use when incrementing or decrementing the value. |
Definition at line 39 of file SSpinButtonCtrl.cpp.
void SSpinButtonCtrl::SetValue | ( | int | nValue | ) |
Sets the current value of the spin button.
nValue | The new value to set. |
Definition at line 22 of file SSpinButtonCtrl.cpp.
|
protected |
Flag indicating if the spin button is circular.
Definition at line 206 of file SSpinButtonCtrl.h.
|
protected |
Current action button.
Definition at line 222 of file SSpinButtonCtrl.h.
|
protected |
Maximum value of the spin button.
Definition at line 202 of file SSpinButtonCtrl.h.
|
protected |
Minimum value of the spin button.
Definition at line 203 of file SSpinButtonCtrl.h.
|
protected |
Current value of the spin button.
Definition at line 204 of file SSpinButtonCtrl.h.
|
protected |
Skin object for the down button.
Definition at line 210 of file SSpinButtonCtrl.h.
|
protected |
Skin object for the up button.
Definition at line 209 of file SSpinButtonCtrl.h.
|
protected |
Buddy window identifier.
Definition at line 207 of file SSpinButtonCtrl.h.
|
protected |
Step size for incrementing or decrementing the value.
Definition at line 205 of file SSpinButtonCtrl.h.