Spinner Series Control Class
Brief Introduction to Spinner Control Class
Spinner class control is usually composed of a group of arrow buttons (up and down, or left and right), which usually represent a range. Through arrow control, value can be changed step by step.
mGNCS provides two kinds of buttons, mSpinner and mSpinbox, and their inheritance relation is as follows
mSpinner
mSpinnerControl name:
NCSCTRL_SPINNEREnglish name: Spinner
Brief introduction: Control consisting of two arrow buttons (up and down or left and right) that can control values changing in a range
Schematic diagram:

Style of mSpinner
mSpinnerIt is inherited from the style of mWidget
Style ID
miniStudio name
Explanation
NCSS_SPNR_VERTICAL
Direction->Vert
Vertical style, up and down arrows. When clicking up and down arrows, it will send keyboard information of the up and down direction keys to the objective window
NCSS_SPNR_HORIZONTAL
Direction->Horz
Horizontal style, left and right arrows. When clicking the left and right arrows, it will send keyboard information of the left and right direction keys to the objective window
NCSS_SPNR_AUTOLOOP
AutoLoop
When reaching the maximum or minimum value, it will automatically loop to the minimum or maximum value
Property of mSpinner
mSpinnerIt is inherited from the property of mWidget
Property ID
miniStudio name
Type
Authority
Explanation
NCSP_SPNR_MAXPOS
MaxPos
int
RW
Maximum value of the change range
NCSP_SPNR_MINPOS
MinPos
int
RW
Minimum value of the change range
NCSP_SPNR_CURPOS
CurPos
int
RW
Current value
NCSP_SPNR_LINESTEP
LineStep
int
RW
Step length
NCSP_SPNR_TARGET
-
HWND
RW
Objective window sentence handle
Event of mSpinner
mSpinnerIt is inherited from the event if mWidget
Event ID
Parameter
Explanation
NCSN_SPNR_CHANGED
int current property value
Current value changes
NCSN_SPNR_REACHMAX
int current property value
The current value reaches the maximum value
NCSN_SPNR_REACHMIN
int current property value
The current value reaches the minimum value
Method of mSpinner
mSpinnerIt is inherited from the method of mWidget
The class does not have newly added method
Renderer of mSpinner
mSpinnermSpinner classic renderer
mSpinner classic rendererFor the non client area, refer to classic renderer of mWidget
Property name
Explanation
miniStudio property name
Type
Schematic diagram
NCS_BGC_3DBODY
Background color
ColorBg3DBody
DWORD(ARGB)
![]()
NCS_FGC_3DBODY
Color of the foreground arrow
ColorFg3DBody
DWORD(ARGB)
![]()
NCS_BGC_DISABLED_ITEM
Background color when it is invalid
ColorBgDisable
DWORD(ARGB)
![]()
NCS_FGC_DISABLED_ITEM
Color of the arrow when it is invalid
ColorFgDisable
DWORD(ARGB)
![]()
mSpinner Skin Renderer
mSpinner Skin RendererRefer to Specification for the Image Resource Used by Skin Renderer
mSpinner Fashion Renderer
mSpinner Fashion RendererProperty name
Explanation
miniStudio property name
Type
Schematic diagram
NCS_FGC_3DBODY
Button foreground color
ColorFg3DBody
DWORD(ARGB)
Same as Classic renderer
NCS_FGC_DISABLED_ITEM
Button foreground color when the window is invalid
ColorFgDisable
DWORD(ARGB)
Same as Classic renderer
NCS_BGC_3DBODY
Background color
ColorBg3DBody
DWORD(ARGB)
Same as Classic renderer
NCS_BGC_DISABLED_ITEM
Text background color when the window is invalid
ColorBgDisable
DWORD(ARGB)
Same as Classic renderer
mSpinner Flat Renderer
mSpinner Flat RendererProperty name
Explanation
miniStudio property name
Type
Schematic diagram
NCS_FGC_3DBODY
Button foreground color
ColorFg3DBody
DWORD(ARGB)
![]()
NCS_BGC_3DBODY
Background color
ColorBg3DBody
DWORD(ARGB)
![]()
Example of mSpinner
mSpinnerThe example below (for the screen shot, see the schematic diagram of mSpinner) demonstrates that Spinner is associated with a Static control. After pos of Spinner changes, Static will change correspondingly.
Properties mainly involved are
NCSP_SPN_MAXPOSNCSP_SPN_MINPOSNCSP_SPN_CURPOSEvent mainly involved is:
NCSN_SPN_CHANGED
For convenience, we mainly realize through the method of data binding
Example
In the template definition file of the window, set properties of spinner
In
MSG_CREATEmessage of the main window, establish connection with staticGet window object
Property of the connection window
Update the current information into Static
mSpinbox
mSpinboxControl window class name :
NCSCTRL_SPINBOXControl English name : Spinbox
Brief introduction : Combine the arrow button with the edit box, and control the content in the edit box through arrow button
Schematic diagram :

Style of mSpinbox
mSpinboxIt is inherited from the style of mSpinner.
Style ID
miniStudio name
Explanation
NCSS_SPNBOX_NUMBER
ContentType->Number
Display numerical value, display format can be appointed through corresponding properties
NCSS_SPNBOX_STRING
ContentType->String
Display character string
NCSS_SPNBOX_SORT
Sort
Character string automatic sorting
NCSS_SPNBOX_EDITNOBORDER
EditBorder
The edit box does not have border
NCSS_SPNBOX_EDITBASELINE
EditBaseLine
The edit box displays the underlined characters
NCSS_SPNBOX_READONLY
ReadOnly
Content displayed by the edit box is read only
NCSS_SPNBOX_UPPERCASE
Case->Upper
All the edit box display content is converted to capital letter display
NCSS_SPNBOX_LOWERCASE
Case->Lower
All the edit box display content is converted to lowercase letter display
NCSS_SPNBOX_AUTOFOCUS
AutoFocus
The control gets focus and automatically transfers to the edit box
Property of mSpinbox
mSpinboxIt is inherited from the property of mSpinner.
Event of mSpinbox
mSpinboxIt is inherited from the event of mSpinner.
Method of mSpinbox
mSpinboxIt is inherited from the method of mSpinner.
The functions below are only valid when spinbox contains NCSS_SPNBOX_STRING style
addItemadds a new item
Add a character string into spinbox
Parameter:
item : added character string
Returned value: successful-
TRUE; failed-FALSE;remove Item
Remove an item
Parameter:
index: the index of removing item 要删除item的索引
Returned: successful-
TRUE; failed-FALSE;setItem
Set character string content of an item
Parameter:
index Index to set
Item content of new item
Returned value: successful-
TRUE; failed-FALSE;getItem
Get character string content of item
Parameter
index of the index item
Returned value:
NULL- failed; valid character string pointer.
Renderer of mSpinbox
mSpinboxEffect of mSpinbox render is composed of the effects of mSpinner and mSlEdit, and the class itself does not have newly added properties.
Example of mSpinbox
mSpinboxThe example explains spinbox under numeric type and list type under horizontal style and vertical style.
Schematic diagram:

The main codes are as follow:
<< Slider Control Class | Table of Contents | Progress Bar Control Class >>
Last updated