mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mspinnerpiece.h
1 /*
2  * This file is part of mGNCS, a component for MiniGUI.
3  *
4  * Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Or,
20  *
21  * As this program is a library, any link to this program must follow
22  * GNU General Public License version 3 (GPLv3). If you cannot accept
23  * GPLv3, you need to be licensed from FMSoft.
24  *
25  * If you have got a commercial license of this program, please use it
26  * under the terms and conditions of the commercial license.
27  *
28  * For more information about the commercial license, please refer to
29  * <http://www.minigui.com/en/about/licensing-policy/>.
30  */
31 #ifdef _MGNCSCTRL_SPINNER
32 
33 #ifndef _MGUI_NCSCTRL_SPINNERPIECE_H
34 #define _MGUI_NCSCTRL_SPINNERPIECE_H
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 typedef struct _mSpinnerPieceClass mSpinnerPieceClass;
41 typedef struct _mSpinnerPiece mSpinnerPiece;
42 
43 #define mSpinnerPieceClassHeader(clss, superCls) \
44  mContainerPieceClassHeader(clss, superCls) \
45  int (*lineStep)(clss*, BOOL bPrev); \
46  \
47  mHotPiece *(*getIncPiece)(clss *); \
48  mHotPiece *(*getDecPiece)(clss *); \
49  void (*onPosChanged)(clss *);
50 
51 struct _mSpinnerPieceClass
52 {
53  mSpinnerPieceClassHeader(mSpinnerPiece, mContainerPiece)
54 };
55 
56 MGNCS_EXPORT extern mSpinnerPieceClass g_stmSpinnerPieceCls;
57 
58 #define mSpinnerPieceHeader(clss) \
59  mContainerPieceHeader(clss) \
60  int max; \
61  int min; \
62  int cur_pos; \
63  int line_step; \
64  int loop_flag;
65 
66 struct _mSpinnerPiece
67 {
68  mSpinnerPieceHeader(mSpinnerPiece)
69 };
70 
71 enum mSpinnerPieceProps{
72  NCSP_SPNRPIECE_MAXPOS = PIECECOMM_PROP_MAX,
73  NCSP_SPNRPIECE_MINPOS = PIECECOMM_PROP_MIN,
74  NCSP_SPNRPIECE_LINESTEP = PIECECOMM_PROP_LINESTEP,
75  NCSP_SPNRPIECE_CURPOS = PIECECOMM_PROP_POS,
76  NCSP_SPNRPIECE_LOOP = SPINBOXPIECE_PROP_BEGIN
77 };
78 
79 enum mSpinnerPieceEvents{
80  NCSN_SPNRPIECE_INC = SPINBOXPIECE_EVENT_BEGIN,
81  NCSN_SPNRPIECE_DEC,
82  NCSN_SPNRPIECE_REACHMIN,
83  NCSN_SPNRPIECE_REACHMAX,
84  NCSN_SPNRPIECE_MAX
85 };
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif
92 #endif //_MGNCSCTRL_SPINNER
93