42 #ifndef _MGUI_WIDGET_NODE_H 43 #define _MGUI_WIDGET_NODE_H 55 typedef struct _mNode
mNode;
62 #define NCSS_NODE_LTEXTRS 0x0000 69 #define NCSS_NODE_SMALLICON 0x0001 75 #define NCSS_NODE_LTEXTBS 0x0002 81 #define NCSS_NODE_TICTACTOEMIDLET 0x0004 83 #define NCSS_NODE_LAYOUT_MASK 0x00FF 89 #define NCSS_NODE_HIDETEXT 0x0010 95 #define NCSS_NODE_HIDEIMAGE 0x0020 101 #define NCSS_NODE_DISABLED 0x0040 107 #define NCSS_NODE_SHIFT 7 116 #define mNodeDataInfoHeader \ 125 typedef struct _NCS_NODE_DATA
131 #define NCSF_NODE_MASK 0xFFFF 132 #define NCSF_NODE_NORMAL 0x0000 133 #define NCSF_NODE_SELECTED 0x0001 134 #define NCSF_NODE_DISABLED 0x0002 135 #define NCSF_NODE_INVISIBLE 0x0004 136 #define NCSF_NODE_DEFHEIGHT 0x0008 138 #define NCSF_NODE_HIDETEXT 0x0010 139 #define NCSF_NODE_HIDEIMAGE 0x0020 141 typedef struct _NCS_NODE_LAYOUTOPS
145 void (*paint)(
mNode *
self, HDC hdc,
const RECT *rect,
mObject *owner);
148 #define mNodeHeader(className) \ 149 mObjectHeader(className) \ 150 NCS_NODE_LAYOUTOPS *layout; \ 193 typedef struct _NCS_MENU_DATA
196 struct _NCS_MENU_DATA *child;
200 MGNCS_EXPORT
void ncsSetMenuData(
mObject *
self, NCS_MENU_DATA *pMenuData,
int count);
202 typedef struct _NCS_MENU_INFO
208 MGNCS_EXPORT
void ncsSetMenu(
mObject *
self, NCS_MENU_INFO *pMenuInfo);
226 PBITMAP image,
int height,
int style, DWORD addData);
248 PBITMAP image,
int height,
int style, DWORD addData);
274 #define mNodeClassHeader(clsName, superCls) \ 275 mObjectClassHeader(clsName, superCls) \ 276 BOOL (*setProperty)(clsName*, int id, DWORD value); \ 277 DWORD (*getProperty)(clsName*, int id); \ 278 BOOL (*computeSize)(clsName*, HDC hdc, SIZE *size); \ 279 BOOL (*canAsRoot)(clsName*); \ 280 int (*addNode)(clsName*, mNode *node); \ 281 int (*removeNode)(clsName*, mNode *node); \ 282 int (*insertNode)(clsName*, mNode *node, mNode *prev, mNode *next, int index);\ 283 int (*moveNode)(clsName*, mNode *curNode, int count, mNode *prevNode); \ 284 mNode* (*findNode)(mNode *self, DWORD info, int type, BOOL recursion, int startIndex);\ 285 mNode* (*findNodeEx)(mNode *self, DWORD info, int type, BOOL recursion, int startIndex, \ 286 int (*cb)(mNode *node, DWORD info)); \ 287 void (*removeAll)(clsName*); \ 288 void (*sendEvent)(clsName*, int eventId); \ 289 mNode* (*getNode)(clsName*, int index); \ 290 int (*indexOf)(clsName*); \ 291 mNode* (*getPrev)(clsName*); \ 292 mNode* (*getNext)(clsName*); \ 293 BOOL (*isEnabled)(clsName*); \ 294 BOOL (*isSelected)(clsName*); \ 295 BOOL (*hasChildren)(clsName*); \ 296 BOOL (*setText)(clsName*, const char* text); \ 297 BOOL (*setImage)(clsName*, const PBITMAP image); \ 298 const char* (*getText)(clsName*); \ 299 PBITMAP (*getImage)(clsName*); \ 300 void (*paint)(clsName*, HDC hdc, const RECT *rect, mObject *owner); \ 301 int (*msgHandler)(clsName*, int msg, WPARAM wParam, LPARAM lParam, mObject *owner); 408 typedef struct _mNodeEventData
536 typedef struct _mGroupNode mGroupNode;
537 typedef struct _mGroupNodeClass mGroupNodeClass;
539 typedef struct _NCS_GROUPNODE_DATA
545 #define mGroupNodeHeader(className) \ 546 mNodeHeader(className) \ 550 mGroupNodeHeader(mGroupNode)
553 #define mGroupNodeClassHeader(clsName, superCls) \ 554 mNodeClassHeader(clsName, superCls) 555 struct _mGroupNodeClass
557 mGroupNodeClassHeader(mGroupNode,
mNode)
568 MGNCS_EXPORT
mNode* ncsAddGroupNode(
mObject *parent,
const char* text,
569 PBITMAP image,
int height,
int style, DWORD addData,
int id);
572 #define NCS_CREATE_NODE(_retnode, _clstype, _parent, _text, _image, _height, _style, _add_data)\ 574 NCS_NODE_DATA data; \ 575 if (!_parent || (!INSTANCEOF(_parent, mNode) && !INSTANCEOF(_parent, mAbstractList))){ \ 578 data.text = (char*)_text; \ 579 data.image = _image; \ 580 data.height = _height; \ 581 data.style = _style; \ 582 data.addData = _add_data; \ 583 data.parent = _parent; \ 584 _retnode = NEWEX(_clstype, (DWORD)&data); \ 587 #define NCS_ADD_NODE(_retnode, _clstype, _parent, text, image, height, style, _add_data)\ 589 NCS_CREATE_NODE(_retnode, _clstype, _parent, text, image, height, style, _add_data);\ 591 if (_retnode && _parent && INSTANCEOF(_parent, mAbstractList)) {\ 592 mAbstractList *list = (mAbstractList*)_parent; \ 593 if (_c(list)->addNode) \ 594 ret = _c(list)->addNode(list, (mNode*)_retnode); \ 596 else if (_retnode && _parent && INSTANCEOF(_parent, mNode)) { \ 597 mNode *list = (mNode *)_parent; \ 598 if (_c(list)->addNode) \ 599 ret = _c(list)->addNode(list, (mNode*)_retnode); \
The virtual function table of mNodeClass.
The structure of mNode. It is the basic class of all nodes occur within specific controls. For example, a list can contain it.