mGNCS API Reference  v1.2.5
A new control set and a new framework for MiniGUI apps
mlist.h
Go to the documentation of this file.
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 
54 #ifdef _MGNCSCTRL_LIST
55 
56 #ifndef _MGUI_NCSCTRL_LIST_H
57 #define _MGUI_NCSCTRL_LIST_H
58 
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif /* __cplusplus */
63 
73 #define NCSCTRL_LIST NCSCLASSNAME("list")
74 
75 typedef struct _mList mList;
76 typedef struct _mListClass mListClass;
77 typedef struct _mListRenderer mListRenderer;
78 
83 #define NCSS_LIST_LOOP (0x0001<<NCSS_ASTLST_SHIFT)
84 
89 #define NCSS_LIST_MULTIPLE (0x0002<<NCSS_ASTLST_SHIFT)
90 
95 #define NCSS_LIST_SHIFT (NCSS_ASTLST_SHIFT+2)
96 
97 #define mListHeader(clsName) \
98  mAbstractListHeader(clsName) \
99  list_t selList; \
100  mListLayout *layout; \
101  mNode *hiliteNode; \
102  Uint16 nodesHeight; \
103  Uint16 nodesWidth;
104 
121 struct _mList
122 {
123  mListHeader(mList)
124 };
125 
126 #define mListClassHeader(clsName, superCls) \
127  mAbstractListClassHeader(clsName, superCls) \
128  void (*resetContent)(clsName*); \
129  void (*removeAll)(clsName*); \
130  void (*enterSubList)(clsName*, mNode* selNode); \
131  void (*backUpList)(clsName*, mNode* selNode); \
132  BOOL (*setNodeDefSize)(clsName*, int defW,int defH);\
133  BOOL (*setLayout)(clsName*, mListLayout* layout, int defNodeW, int defNodeH); \
134  mListLayout* (*getLayout)(clsName*);
135 
167 struct _mListClass
168 {
169  mListClassHeader(mList, mAbstractList)
170 };
171 
172 #define mListRendererHeader(clsName, parentClass) \
173  mAbstractListRendererHeader(clsName, parentClass)
174 
180 struct _mListRenderer {
181  mListRendererHeader(mList, mAbstractList)
182 };
183 
184 
189 enum ncsListLayoutID
190 {
194  NCS_LIST_LLIST = 0,
195 
199  NCS_LIST_LICONV,
200 
201  NCS_LIST_LICONH,
202 
203  NCS_LIST_LCBOXH,
204 
205  NCS_LIST_LGROUP,
206 
207  NCS_LIST_LUSERDEFINED,
211  NCS_LIST_MAX,
212 };
213 
214 enum mListEvent
215 {
216  NCSE_LIST_FONTCHANGED = 100,
217  NCSE_LIST_SIZECHANGED,
218  NCSE_LIST_ROOTCHANGING, //new root
219  NCSE_LIST_ROOTCHANGED, //new root
220 };
221 
222 enum mListDirKeyFlags{
223  NCSF_LIST_UP = 0x01,
224  NCSF_LIST_DOWN = 0x02,
225  NCSF_LIST_LEFT = 0x04,
226  NCSF_LIST_RIGHT = 0x08,
227  NCSF_LIST_HOME = 0x10,
228  NCSF_LIST_END = 0x20,
229  NCSF_LIST_LOOP = 0x100,
230  NCSF_LIST_DIRMASK= 0xFF,
231 };
236 enum mListProp
237 {
241  NCSP_LIST_LAYOUT = NCSP_ASTLST_MAX + 1,
242 
246  NCSP_LIST_DEFNODEWIDTH,
247 
251  NCSP_LIST_DEFNODEHEIGHT,
252 
256  NCSP_LIST_MAX,
257 };
258 
263 enum mListNotify
264 {
269  NCSN_LIST_SELCHANGED = NCSN_ASTLST_MAX + 1,
270 
275  NCSN_LIST_ENTER,
276 
281  NCSN_LIST_BACKSPACE,
282 
287  NCSN_LIST_ENTERSUBLIST,
288 
293  NCSN_LIST_BACKUPLIST,
294 
295  NCSN_LIST_ROOTNODECHANGED,
299  NCSN_LIST_MAX,
300 };
301 
308 MGNCS_EXPORT extern mListClass g_stmListCls;
309 
314 MGNCS_EXPORT void mList_foreachNode(mList *list, void (*foreach)(mNode *node, void* param), void* param);
315 
318 #ifdef __cplusplus
319 }
320 #endif /* __cplusplus */
321 
322 #endif /* _MGUI_NCSCTRL_LIST_H */
323 #endif //_MGNCSCTRL_LIST
The structure of mNode. It is the basic class of all nodes occur within specific controls. For example, a list can contain it.
The structure of mAbstractList, which derived from mScrollWidget. It is the abstract superclass of al...