mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
mitem.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 
55 #ifndef _MGUI_WIDGET_ITEM_H
56 #define _MGUI_WIDGET_ITEM_H
57 
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif /* __cplusplus */
62 
68 typedef struct _mItem mItem;
69 typedef struct _mItemClass mItemClass;
70 
75 typedef GHANDLE HITEM;
76 
81 #define hEditor HWND
82 
87 #define NCSF_ITEM_SHIFT 4
88 
93 #define NCSF_ITEM_MASK 0xFFFF
94 
99 #define NCSF_ITEM_NORMAL 0x0000
100 
105 #define NCSF_ITEM_SELECTED 0x0001
106 
111 #define NCSF_ITEM_DISABLED 0x0002
112 
117 #define NCSF_ITEM_USEBITMAP 0x0004
118 
123 #define NCSF_ITEM_USEICON 0x0008
124 
129 #define NCSF_ITEM_IMAGEMASK (NCSF_ITEM_USEBITMAP | NCSF_ITEM_USEICON)
130 
131 #define mItemHeader(className) \
132  mObjectHeader(className) \
133  list_t list; \
134  list_t selList; \
135  DWORD flags; \
136  char *string; \
137  DWORD image; \
138  hEditor editor; \
139  int height; \
140  DWORD addData;
141 
179 struct _mItem
180 {
181  mItemHeader(mItem)
182 };
183 
184 #define mItemClassHeader(clsName, superCls) \
185  mObjectClassHeader(clsName, superCls) \
186  BOOL (*setProperty)(clsName*, int id, DWORD value); \
187  DWORD (*getProperty)(clsName*, int id); \
188  BOOL (*isSelectedItem)(clsName*); \
189  BOOL (*isEnabledItem)(clsName*); \
190  void (*setItemEditor)(clsName*, hEditor editor); \
191  hEditor (*getItemEditor)(clsName*); \
192  void (*setItemAddData)(clsName*, DWORD addData); \
193  DWORD (*getItemAddData)(clsName*); \
194  void (*setItemImage)(clsName*, DWORD image); \
195  DWORD (*getItemImage)(clsName*); \
196  void (*setItemFlags)(clsName*, DWORD flags); \
197  DWORD (*getItemFlags)(clsName*); \
198  BOOL (*setItemHeight)(clsName*, int height); \
199  int (*getItemHeight)(clsName*); \
200  BOOL (*setItemString)(clsName*, const char* string);\
201  char* (*getItemString)(clsName*);
202 
274 struct _mItemClass
275 {
276  mItemClassHeader(mItem, mObject)
277 };
278 
284 {
289 
294 
299 };
300 
307 MGNCS_EXPORT extern mItemClass g_stmItemCls;
308 
311 #ifdef __cplusplus
312 }
313 #endif /* __cplusplus */
314 
315 #endif /* _MGUI_WIDGET_ITEM_H */
316 
HITEM
GHANDLE HITEM
The handle of item widget.
Definition: mitem.h:75
mObject
the Object struct
NCSP_ITEM_HEIGHT
@ NCSP_ITEM_HEIGHT
Definition: mitem.h:288
mItemProp
mItemProp
The properties id of mItem.
Definition: mitem.h:283
NCSP_ITEM_FLAGS
@ NCSP_ITEM_FLAGS
Definition: mitem.h:293
mItem
The structure of mItem. It is the abstract superclass of all items occur within specific controls....
g_stmItemCls
MGNCS_EXPORT mItemClass g_stmItemCls
The instance of mItemClass.
mItemClass
The virtual function table of mItemClass.
NCSP_ITEM_MAX
@ NCSP_ITEM_MAX
Definition: mitem.h:298