mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mswitchbutton.h
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 /*
14  * \file mswitchbutton.h
15  * \author miniStudio team of FMSoft
16  * \date 2010/10/09
17  *
18  \verbatim
19 
20  This file is part of mGNCS4Touch, one of MiniGUI components.
21 
22  Copyright (C) 2008-2018 FMSoft (http://www.fmsoft.cn).
23 
24  This program is free software: you can redistribute it and/or modify
25  it under the terms of the GNU General Public License as published by
26  the Free Software Foundation, either version 3 of the License, or
27  (at your option) any later version.
28 
29  This program is distributed in the hope that it will be useful,
30  but WITHOUT ANY WARRANTY; without even the implied warranty of
31  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32  GNU General Public License for more details.
33 
34  You should have received a copy of the GNU General Public License
35  along with this program. If not, see <http://www.gnu.org/licenses/>.
36 
37  Or,
38 
39  As this program is a library, any link to this program must follow
40  GNU General Public License version 3 (GPLv3). If you cannot accept
41  GPLv3, you need to be licensed from FMSoft.
42 
43  If you have got a commercial license of this program, please use it
44  under the terms and conditions of the commercial license.
45 
46  For more information about the commercial license, please refer to
47  <http://www.minigui.com/blog/minigui-licensing-policy/>.
48 
49  \endverbatim
50 */
51 
52 #ifndef __MGNCS4TOUCH_SWB_H__
53 #define __MGNCS4TOUCH_SWB_H__
54 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif /* __cplusplus */
62 
67 #define NCSCTRL_SWBUTTON NCSCLASSNAME("switchbutton")
68 
69 typedef struct _mSwitchButton mSwitchButton;
70 typedef struct _mSwitchButtonClass mSwitchButtonClass;
71 typedef struct _mSwitchButtonRenderer mSwitchButtonRenderer;
72 
86 };
87 
88 #define mSwitchButtonHeader(clsName) \
89  mWidgetHeader(clsName) \
90  DWORD status; \
91  BOOL pressOnBlock; \
92  int radius; \
93  int mouseX; \
94  int moveFrom; \
95  int dist; \
96  int step;
97 
106 struct _mSwitchButton {
107  mSwitchButtonHeader(mSwitchButton)
108 };
109 
110 #define mSwitchButtonClassHeader(clsName, parentClass) \
111  mWidgetClassHeader(clsName, parentClass) \
112  void (*runAnimation)(clsName*, int start, int end, int duration);
113 
120 struct _mSwitchButtonClass {
121  mSwitchButtonClassHeader(mSwitchButton, mWidget)
122 };
123 
124 #define mSwitchButtonRendererHeader(clsName, parentClass) \
125  mWidgetRendererHeader(clsName, parentClass)
126 
133 struct _mSwitchButtonRenderer {
134  mSwitchButtonRendererHeader(mSwitchButton, mWidget)
135 };
136 
141 MTOUCH_EXPORT extern mSwitchButtonClass g_stmSwitchButtonCls;
142 
148 #define NCSS_SWB_SHIFT (NCSS_WIDGET_SHIFT)
149 
162  NCSP_SWB_STATUS = NCSP_WIDGET_MAX + 1,
163  NCSP_SWB_MAX
164 };
165 
174  NCSN_SWB_STATUSCHANGED = NCSN_WIDGET_MAX + 1,
175  NCSN_SWB_MAX
176 };
177 
181 #ifdef __cplusplus
182 }
183 #endif /* __cplusplus */
184 
185 #endif /* __MGNCS4TOUCH_SWB_H__ */
186 
NCSN_SWB_STATUSCHANGED
@ NCSN_SWB_STATUSCHANGED
Identify switch control choice status changes.
Definition: mswitchbutton.h:174
mSwitchButtonNotify
mSwitchButtonNotify
the notification code of mSwitchButton
Definition: mswitchbutton.h:173
mSwitchButton
SwitchButton class, derived from mWidget.
mSwitchButtonProp
mSwitchButtonProp
the properties id of mSwitchButton
Definition: mswitchbutton.h:161
mSwitchButtonClass
switchbutton struct of switchbutton control, derived from mWidgetClass
g_stmSwitchButtonCls
MTOUCH_EXPORT mSwitchButtonClass g_stmSwitchButtonCls
global mSwitchButtonClass
NCS_SWB_ON
@ NCS_SWB_ON
SwitchButton status, ON.
Definition: mswitchbutton.h:85
NCSP_SWB_STATUS
@ NCSP_SWB_STATUS
Label control displays the switch status.
Definition: mswitchbutton.h:162
NCS_SWB_OFF
@ NCS_SWB_OFF
SwitchButton status, OFF.
Definition: mswitchbutton.h:84
mSwitchButtonRenderer
SwitchButton class renderer interface, derived from mWidgetRenderer.
mSwitchButtonStatus
mSwitchButtonStatus
define the check state of switchbutton
Definition: mswitchbutton.h:83