mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mitem.h
Go to the documentation of this file.
1 
43 #ifndef _MGUI_WIDGET_ITEM_H
44 #define _MGUI_WIDGET_ITEM_H
45 
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif /* __cplusplus */
50 
56 typedef struct _mItem mItem;
57 typedef struct _mItemClass mItemClass;
58 
63 typedef GHANDLE HITEM;
64 
69 #define hEditor HWND
70 
75 #define NCSF_ITEM_SHIFT 4
76 
81 #define NCSF_ITEM_MASK 0xFFFF
82 
87 #define NCSF_ITEM_NORMAL 0x0000
88 
93 #define NCSF_ITEM_SELECTED 0x0001
94 
99 #define NCSF_ITEM_DISABLED 0x0002
100 
105 #define NCSF_ITEM_USEBITMAP 0x0004
106 
111 #define NCSF_ITEM_USEICON 0x0008
112 
117 #define NCSF_ITEM_IMAGEMASK (NCSF_ITEM_USEBITMAP | NCSF_ITEM_USEICON)
118 
119 #define mItemHeader(className) \
120  mObjectHeader(className) \
121  list_t list; \
122  list_t selList; \
123  DWORD flags; \
124  char *string; \
125  DWORD image; \
126  hEditor editor; \
127  int height; \
128  DWORD addData;
129 
167 struct _mItem
168 {
169  mItemHeader(mItem)
170 };
171 
172 #define mItemClassHeader(clsName, superCls) \
173  mObjectClassHeader(clsName, superCls) \
174  BOOL (*setProperty)(clsName*, int id, DWORD value); \
175  DWORD (*getProperty)(clsName*, int id); \
176  BOOL (*isSelectedItem)(clsName*); \
177  BOOL (*isEnabledItem)(clsName*); \
178  void (*setItemEditor)(clsName*, hEditor editor); \
179  hEditor (*getItemEditor)(clsName*); \
180  void (*setItemAddData)(clsName*, DWORD addData); \
181  DWORD (*getItemAddData)(clsName*); \
182  void (*setItemImage)(clsName*, DWORD image); \
183  DWORD (*getItemImage)(clsName*); \
184  void (*setItemFlags)(clsName*, DWORD flags); \
185  DWORD (*getItemFlags)(clsName*); \
186  BOOL (*setItemHeight)(clsName*, int height); \
187  int (*getItemHeight)(clsName*); \
188  BOOL (*setItemString)(clsName*, const char* string);\
189  char* (*getItemString)(clsName*);
190 
262 struct _mItemClass
263 {
264  mItemClassHeader(mItem, mObject)
265 };
266 
272 {
277 
282 
287 };
288 
295 MGNCS_EXPORT extern mItemClass g_stmItemCls;
296 
299 #ifdef __cplusplus
300 }
301 #endif /* __cplusplus */
302 
303 #endif /* _MGUI_WIDGET_ITEM_H */
304 
mItemProp
The properties id of mItem.
Definition: mitem.h:271
GHANDLE HITEM
The handle of item widget.
Definition: mitem.h:63
the Object struct
The virtual function table of mItemClass.
MGNCS_EXPORT mItemClass g_stmItemCls
The instance of mItemClass.
The structure of mItem. It is the abstract superclass of all items occur within specific controls...