mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mwidget.h
1 /*
2  * \file mwidget.h
3  * \author ChaiPeng
4  * \date 2009/01/01
5  *
6  * This file include the base widget control definition.
7  *
8  \verbatim
9 
10  This file is part of mGNCS, a component for MiniGUI.
11 
12  Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd.
13 
14  This program is free software: you can redistribute it and/or modify
15  it under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with this program. If not, see <http://www.gnu.org/licenses/>.
26 
27  Or,
28 
29  As this program is a library, any link to this program must follow
30  GNU General Public License version 3 (GPLv3). If you cannot accept
31  GPLv3, you need to be licensed from FMSoft.
32 
33  If you have got a commercial license of this program, please use it
34  under the terms and conditions of the commercial license.
35 
36  For more information about the commercial license, please refer to
37  <http://www.minigui.com/en/about/licensing-policy/>.
38 
39  \endverbatim
40  */
41 
42 #ifndef _MGUI_NCSCTRL_WIDGET_H
43 #define _MGUI_NCSCTRL_WIDGET_H
44 
45 #include <stdint.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif /* __cplusplus */
50 
51 
52 #define TOWIDGET(x) ((mWidget *)x)
53 #define TOWIDGETCLASS(x) ((mWidgetClass *)x)
54 
55 #define RendererType(className) className##Renderer
56 
57 
67 #define NCSCTRL_WIDGET NCSCLASSNAME("widget")
68 
69 typedef struct _mWidgetClass mWidgetClass;
70 typedef struct _mWidget mWidget;
71 
77 
78 
79 
80 
81 typedef struct _mWidgetRenderer mWidgetRenderer;
82 
83 #define mWidgetRendererHeader(clsName, parentClass) \
84  const char* rdr_name; \
85  /*renderer private method and data * every class must set NULL or it's ownd data */ \
86  void (*class_init)(RendererType(clsName)* rdr); \
87  RendererType(parentClass) *ptrParentClass; \
88  BOOL (*init_self)(RendererType(clsName) *rdr); \
89  void (*uninit_self)(RendererType(clsName) *rdr); \
90  void * prv_data; \
91  /*renderer drivedable method and data, * these data can be used directly by drived class */ \
92  void (*drawFocusFrame)(clsName*, HDC, const RECT* ); \
93  BOOL (*drawBkground)(clsName*, HDC, const RECT*); \
94  void (*draw3dbox)(clsName*, HDC, const RECT*, DWORD,DWORD); \
95  void (*drawCheckbox)(clsName*, HDC, const RECT*, DWORD); \
96  void (*drawRadio)(clsName*, HDC, const RECT*, DWORD); \
97  void (*drawArrow)(clsName*, HDC, const RECT*, int arrow,DWORD, DWORD); \
98  void (*drawItem)(clsName*, HDC, const RECT*, DWORD);
99 
105  NCSRS_NORMAL = 0x00,
111 };
138 #define NCSR_STATUS(flag) ((flag)&0xFFFF)
139 
145  NCSRF_INNERFRAME = 0x010000,
146  NCSRF_FILL = 0x020000,
147  NCSRF_FRAME = 0x040000,
148 };
171 };
276 struct _mWidgetRenderer {
277  mWidgetRendererHeader(mWidget, mWidget)
278 };
279 
280 
281 #define NCSSPEC_OBJ_CONTENT MAX_USER_SPECIAL_KEY + 1
282 
283 #define mWidgetHeader(clsName) \
284  mComponentHeader(clsName) \
285  HWND hwnd; \
286  RendererType(clsName) *renderer; \
287  mComponent* comps; \
288  ImageDrawInfo bkimg; \
289  mObject *body;
290 
309 struct _mWidget
310 {
311  mWidgetHeader(mWidget)
312 };
313 
314 #define mWidgetClassHeader(clsName, parentClass) \
315  mComponentClassHeader(clsName, parentClass) \
316  DWORD dlgCode; \
317  mObject * (*createBody)(clsName*); \
318  LRESULT (*wndProc)(clsName* , UINT, WPARAM, LPARAM); \
319  BOOL (*callUserHandler)(clsName* self, void *handler, \
320  UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pRet); \
321  BOOL (*onCreate)(clsName*, LPARAM); \
322  BOOL (*addChildren)(clsName*, NCS_WND_TEMPLATE* children,int count); \
323  void (*onPaint)(clsName*, HDC, const PCLIPRGN pClip); \
324  int (*onLButtonDown)(clsName*, int x, int y, DWORD keyFlags); \
325  int (*onLButtonUp)(clsName*, int x, int y, DWORD keyFlags); \
326  int (*onMouseMove)(clsName*, int x, int y, DWORD keyFlags); \
327  int (*onKeyDown)(clsName*, int scancode, DWORD keyFlags); \
328  int (*onKeyUp)(clsName*, int scancode, DWORD keyFlags); \
329  int (*onSizeChanged)(clsName*, RECT* rtClient); \
330  BOOL (*onEraseBkgnd)(clsName*, HDC hdc, const RECT* invRect); \
331  \
332  BOOL (*refresh)(clsName *);
333 
334 
361 struct _mWidgetClass
362 {
363  mWidgetClassHeader(mWidget, mComponent)
364 };
365 
366 #define SET_DLGCODE(code) _class->dlgCode = (code);
367 
374 MGNCS_EXPORT extern mWidgetClass g_stmWidgetCls;
375 
376 
377 /* property support */
378 
390  NCSP_WIDGET_MAX
391 };
438 #define NCSS_NOTIFY (0x1)
439 
440 #define IsNotify(self) \
441  (GetWindowStyle(self->hwnd)&NCSS_NOTIFY)
442 
443 #define NCSS_WIDGET_SHIFT 1
444 
445 /*
446  * \def NCSS_EX_UNNEEDIME
447  * \brief the edit uneed ime or not
448  */
449 #define NCSS_EX_UNNEEDIME 0x1
450 
461  NCSN_WIDGET_MAX
462 };
463 
492 #define NCSR_CONTINUE_MSG FALSE
493 
500 #define NCSR_STOP_MSG TRUE
501 
512 typedef void (*NCS_CB_ONNCCREATE)(mWidget*);
513 
528 typedef BOOL (*NCS_CB_ONCREATE)(mWidget*, DWORD dwAddData);
529 
543 typedef BOOL (*NCS_CB_ONINITDLG)(mWidget*, HWND hFocus, DWORD dwAddData);
544 
555 typedef BOOL (*NCS_CB_ONVOID)(mWidget*, UINT message);
567 typedef void (*NCS_CB_ONSZCHGING)(mWidget*, const PRECT prcExpect, PRECT prcResult);
568 
582 typedef BOOL (*NCS_CB_ONSZCHGED)(mWidget*,PRECT prcClient);
583 //MSG_CSIZECHANGED
595 typedef void (*NCS_CB_ONCSZCHGED)(mWidget*, int clientWidth, int clientHeight);
596 
608 typedef BOOL (*NCS_CB_ONFONTCHGING)(mWidget*, PLOGFONT logFont);
621 typedef BOOL (*NCS_CB_ONERASEBKGND)(mWidget*, HDC hdc, const PRECT clip);
631 typedef void (*NCS_CB_ONPAINT)(mWidget*, HDC hdc, const PCLIPRGN clipRgn);
640 typedef BOOL (*NCS_CB_ONCLOSE)(mWidget*);
641 
655 typedef BOOL (*NCS_CB_ONKEY)(mWidget*, UINT message, int code, DWORD keyStatus);
656 
670 typedef BOOL(*NCS_CB_ONMOUSE)(mWidget*, UINT message, int x, int y, DWORD keyStatus);
684 typedef BOOL (*NCS_CB_ONNCMOUSE)(mWidget*, UINT message, int x, int y, int hitCode);
696 typedef int (*NCS_CB_ONHITTEST)(mWidget*, UINT message,int x, int y);
697 
707 typedef void (*NCS_CB_ONSCROLL)(mWidget*, UINT message, int code, int pos);
719 typedef BOOL (*NCS_CB_ONCMD)(mWidget*, int id, int nc, HWND hCtrl);
728 typedef void (*NCS_CB_WIDGET_ONTIMER)(mWidget*, int id, DWORD count);
741 typedef int (*NCS_CB_ONMSG)(mWidget*, UINT message, WPARAM wParam, LPARAM lParam);
751 typedef void (*NCS_CB_NOTIFY)(mWidget*, int id, int ncCode, DWORD addData);
752 
759 #define NCS_NOTIFY_CODE(code) (0xFFFF0000 | (code))
760 
764 #define NCS_MAP_NOTIFY(code, handler) { NCS_NOTIFY_CODE(code), (void*)(handler) }
765 
766 
768 void mWidget_captureHotPiece(mWidget *self, mObject *hotpice);
769 mObject * mWidget_getCapturedHotPiece(mWidget *self);
770 void mWidget_releaseCapturedHotPiece(void);
771 
772 void mWidget_setHoveringFocus(mWidget *self, mObject *hotpiece);
773 mObject * mWidget_getHoveringFocus(mWidget *self);
774 void mWidget_releaseHoveringFocus(void);
775 
776 void mWidget_setInputFocus(mWidget *self, mObject *hotpiece);
777 mObject * mWidget_getInputFocus(mWidget *self);
778 void mWidget_releaseInputFocus(void);
779 
780 #ifdef _MGNCS_GUIBUILDER_SUPPORT
781 //only for GUI Builder
782 //used to create default content
783 #define NCSP_DEFAULT_CONTENT 10000
784 #endif
785 
786 
810 MGNCS_EXPORT BOOL ncsSetFont (HWND hWnd, const char *fontName);
811 
824 MGNCS_EXPORT BOOL ncsSetProperty(HWND hWnd, int id, DWORD value);
836 MGNCS_EXPORT DWORD ncsGetProperty(HWND hWnd, int id);
837 
845 typedef struct _NCS_PROP_ENTRY {
849  int id;
853  DWORD value;
855 
863 typedef struct _NCS_RDR_ELEMENT {
867  int id;
871  DWORD value;
873 
879 typedef struct _NCS_RDR_INFO {
883  const char* glb_rdr;
887  const char* ctl_rdr;
892 }NCS_RDR_INFO;
893 
904 typedef struct _NCS_CREATE_NOTIFY_INFO {
905  BOOL (*onCreated)(struct _NCS_CREATE_NOTIFY_INFO*, mComponent*, DWORD special_id);
907 
908 typedef struct _NCS_CREATE_INFO{
914  NCS_PROP_ENTRY * props;
920  NCS_RDR_INFO * rdr_info;
926  NCS_EVENT_HANDLER *handlers;
932  NCS_WND_TEMPLATE * ctrls;
936  int ctrl_count;
940  DWORD user_data;
941 
942  //FIXED ME Maybe I should not put these two param here
951  DWORD bk_color;
955  const char* font_name;
956 
957  // don't use in the control, to make the NCS_MNWND_TEMPLATE and NCS_WND_TEMPLATE same
958  HICON hIcon;
959  HMENU hMenu;
960 
961  NCS_CREATE_NOTIFY_INFO * notify_info;
962  DWORD special_id;
963 
964 }NCS_CREATE_INFO;
965 
998 MGNCS_EXPORT mWidget* ncsCreateWindow (const char *className, const char *caption, DWORD style, DWORD exStyle, \
999  int id, int x, int y, int w, int h, HWND parent, \
1000  NCS_PROP_ENTRY * props, \
1001  NCS_RDR_INFO * rdrInfo, \
1002  NCS_EVENT_HANDLER * handlers, \
1003  DWORD addData);
1004 
1013 typedef struct _NCS_MAIN_CREATE_INFO {
1023  const char* className;
1027  NCS_CREATE_INFO * create_info;
1029 
1066 MGNCS_EXPORT mWidget* ncsCreateMainWindow (const char *className, const char *caption,
1067  DWORD style, DWORD exStyle, \
1068  int id, int x, int y, int w, int h, HWND host, \
1069  HICON hIcon, HMENU hMenu,
1070  NCS_PROP_ENTRY * props, \
1071  NCS_RDR_INFO * rdrInfo, \
1072  NCS_EVENT_HANDLER * handlers, \
1073  DWORD addData);
1074 
1086  const char* class_name;
1090  intptr_t id;
1094  int x, y, w, h;
1098  DWORD style;
1102  DWORD ex_style;
1106  const char* caption;
1107 
1108  //same struct as NCS_CREATE_INFO
1115  NCS_RDR_INFO* rdr_info;
1116  NCS_EVENT_HANDLER* handlers;
1117  NCS_WND_TEMPLATE* ctrls;
1118  intptr_t count;
1119  DWORD user_data;
1120 
1121  //FIXED ME Maybe I should not put these two param here
1122  DWORD bk_color;
1123  const char* font_name;
1124 
1125  // don't use in the control, to make the NCS_MNWND_TEMPLATE and NCS_WND_TEMPLATE same
1126  HICON hIcon;
1127  HMENU hMenu;
1128 
1129  NCS_CREATE_NOTIFY_INFO * notify_info;
1130  DWORD special_id;
1131 };
1132 
1133 //create control window indirect
1146 MGNCS_EXPORT mWidget* ncsCreateWindowIndirect( const NCS_WND_TEMPLATE* tmpl, HWND hParent);
1147 
1155 typedef struct _NCS_MNWND_TEMPLATE{
1156  const char* class_name;
1157  intptr_t id;
1158  int x, y, w, h;
1159  DWORD style;
1160  DWORD ex_style;
1161  const char* caption;
1162 
1163  NCS_PROP_ENTRY* props;
1164  NCS_RDR_INFO* rdr_info;
1165  NCS_EVENT_HANDLER* handlers;
1166  NCS_WND_TEMPLATE* ctrls;
1167  intptr_t count;
1168  DWORD user_data;
1169 
1170  //FIXED ME Maybe I should not put these two param here
1171  DWORD bk_color;
1172  const char* font_name;
1173 
1174  HICON hIcon;
1175  HMENU hMenu;
1176 
1177 
1178  NCS_CREATE_NOTIFY_INFO * notify_info;
1179  DWORD special_id;
1180 
1182 
1194 MGNCS_EXPORT mWidget* ncsCreateMainWindowIndirect(const NCS_MNWND_TEMPLATE* tmpl, HWND hHost);
1195 
1207 MGNCS_EXPORT mWidgetClass* ncsGetMainWndClass(const char* className);
1208 
1220 MGNCS_EXPORT void ncsNotifyParentEx(mWidget * self, int code, DWORD addData);
1221 
1222 #define ncsNotifyParent(self, code) ncsNotifyParentEx((mWidget*)(self), code, 0)
1223 
1232 static inline mWidget* ncsObjFromHandle(HWND hwnd)
1233 {
1234  if(IsWindow(hwnd))
1235  return (mWidget*)(GetWindowAdditionalData2(hwnd));
1236  return NULL;
1237 }
1238 
1248 static inline mWidget* ncsGetChildObj(HWND hwnd, int id)
1249 {
1250  mWidget * self = ncsObjFromHandle(hwnd);
1251  return (mWidget*)(self?_c(self)->getChild(self, id):NULL);
1252 }
1253 
1262 static inline mWidget* ncsGetParentObj(HWND hwnd)
1263 {
1264  return ncsObjFromHandle(GetParent(hwnd));
1265 }
1266 
1267 
1276 static inline DWORD ncsGetDlgCode(HWND hwnd)
1277 {
1278 
1279 #if 0
1280  mWidget * widget;
1281  if((widget=ncsObjFromHandle(hwnd)))
1282  {
1283  return _c(widget)->dlgCode;
1284  }
1285  return 0;
1286 #endif
1287  return (DWORD)SendMessage(hwnd, MSG_GETDLGCODE, 0, 0);
1288 }
1289 
1295 MGNCS_EXPORT void ncsDestroyWindow(mWidget* self, DWORD endCode);
1296 
1297 #define ncsDeleteWidget(self) ncsDestroyWindow(self, 0)
1298 
1299 
1300 #define NCS_FETCH_MSGBINDINFO(sender, param, lParam) do{ \
1301  void ** __tmp = (void**)(lParam); \
1302  if(__tmp){ \
1303  register DWORD* __param = (DWORD*)(void*)&(param); \
1304  register void** __sender = (void**)(void*)&(sender); \
1305  *__param = (DWORD)__tmp[0]; \
1306  *__sender = __tmp[1]; \
1307  free(__tmp); \
1308  } \
1309 }while(0)
1310 
1311 MGNCS_EXPORT BOOL ncsBindEventsToMessage(mObject *sender, HWND hwnd_listener, UINT message, int* event_ids);
1312 MGNCS_EXPORT BOOL ncsBindEventToMessage(mObject* sender, HWND hwnd_listener, UINT message, int event_ids);
1313 MGNCS_EXPORT void ncsRemoveBindWindow(HWND hwnd_listener);
1314 MGNCS_EXPORT void ncsRemoveBindMessage(HWND hwnd_listener, UINT message, mObject* sender/*=NULL*/, int event_id/*=0*/);
1315 
1316 
1322 #ifdef __cplusplus
1323 }
1324 #endif /* __cplusplus */
1325 
1326 #endif /* _MGUI_NCSCTRL_WIDGET_H */
1327 
BOOL(* NCS_CB_ONINITDLG)(mWidget *, HWND hFocus, DWORD dwAddData)
the callback of event MSG_INITDIALOG, only valid in mDialogBox, when a dialog is created ...
Definition: mwidget.h:543
ncsRDRArrow
the arrow define of renderer
Definition: mwidget.h:166
Set the renderer class name.
Definition: mwidget.h:385
void(* NCS_CB_ONSCROLL)(mWidget *, UINT message, int code, int pos)
the callback of events MSG_HSCROLL , MSG_VSCROLL
Definition: mwidget.h:707
MGNCS_EXPORT BOOL ncsSetFont(HWND hWnd, const char *fontName)
set control&#39;s font
send by a widget is cliced by left button
Definition: mwidget.h:457
indicate that fill a box or other shape
Definition: mwidget.h:146
void(* NCS_CB_ONPAINT)(mWidget *, HDC hdc, const PCLIPRGN clipRgn)
the callback of event MSG_PAINT
Definition: mwidget.h:631
indiate a down arrow
Definition: mwidget.h:170
BOOL(* NCS_CB_ONCREATE)(mWidget *, DWORD dwAddData)
the callback of event MSG_CREATE
Definition: mwidget.h:528
static mWidget * ncsGetChildObj(HWND hwnd, int id)
Get the child object pointer of window.
Definition: mwidget.h:1248
MGNCS_EXPORT DWORD ncsGetProperty(HWND hWnd, int id)
get control&#39;s property
BOOL(* NCS_CB_ONNCMOUSE)(mWidget *, UINT message, int x, int y, int hitCode)
the callback of events MSG_NCLBUTTONDOWN MSG_NCLBUTTONUP MSG_NCLBUTTONDBCLK MSG_NCMOUSEMOVE MSG_NCRBU...
Definition: mwidget.h:684
MGNCS_EXPORT void ncsNotifyParentEx(mWidget *self, int code, DWORD addData)
raise a notification event
struct _NCS_RDR_INFO NCS_RDR_INFO
Set the widget&#39;s back image.
Definition: mwidget.h:387
static mWidget * ncsGetParentObj(HWND hwnd)
Get the parent object pointer of window.
Definition: mwidget.h:1262
NCS_RDR_ELEMENT * elements
Definition: mwidget.h:891
int(* NCS_CB_ONHITTEST)(mWidget *, UINT message, int x, int y)
the callback of events MSG_HITTEST MSG_NCHITTEST
Definition: mwidget.h:696
indiate a left arrow
Definition: mwidget.h:167
send by a widget is disabled
Definition: mwidget.h:460
struct _NCS_RDR_ELEMENT NCS_RDR_ELEMENT
MGNCS_EXPORT mWidgetClass g_stmWidgetCls
the instance of mWigetClass
const char * className
Definition: mwidget.h:1023
MGNCS_EXPORT mWidget * ncsCreateMainWindowIndirect(const NCS_MNWND_TEMPLATE *tmpl, HWND hHost)
create a main window from a template
indicate that draw a inner frame box or shape
Definition: mwidget.h:145
half selected state
Definition: mwidget.h:109
define the mWidget members, inherit from mComponent
the Object struct
send by a widget is double cliced by left button
Definition: mwidget.h:458
Definition: mwidget.h:845
void(* NCS_CB_ONCSZCHGED)(mWidget *, int clientWidth, int clientHeight)
the callbace of event MSG_CSIZECHANGED
Definition: mwidget.h:595
disable state
Definition: mwidget.h:110
BOOL(* NCS_CB_ONMOUSE)(mWidget *, UINT message, int x, int y, DWORD keyStatus)
the callback of events MSG_LBUTTONDOWN MSG_LBUTTONUP MSG_LBUTTONDBCLK MSG_MOUSEMOVE MSG_RBUTTONDOWN M...
Definition: mwidget.h:670
#define _c(ths)
the marco get the class of a object
Definition: mobject.h:60
indiate a up arrow
Definition: mwidget.h:169
struct _NCS_PROP_ENTRY NCS_PROP_ENTRY
const char * class_name
Definition: mwidget.h:1086
normal state
Definition: mwidget.h:105
BOOL(* NCS_CB_ONFONTCHGING)(mWidget *, PLOGFONT logFont)
the callback of event MSG_FONTCHANGING
Definition: mwidget.h:608
BOOL(* NCS_CB_ONCMD)(mWidget *, int id, int nc, HWND hCtrl)
the callback of event MSG_COMMAND
Definition: mwidget.h:719
MGNCS_EXPORT BOOL ncsSetProperty(HWND hWnd, int id, DWORD value)
set control&#39;s property
struct _NCS_MNWND_TEMPLATE NCS_MNWND_TEMPLATE
BOOL(* NCS_CB_ONVOID)(mWidget *, UINT message)
the callback of events MSG_ACTIVE MSG_FONTCHANGED MSG_KEYLONGPRESS MSG_KEYALWAYSPRESS MSG_DESTROY ...
Definition: mwidget.h:555
mWidgetNotify
the notification code of mWidget
Definition: mwidget.h:456
struct _NCS_CREATE_NOTIFY_INFO NCS_CREATE_NOTIFY_INFO
significant state
Definition: mwidget.h:107
the VTable of mWidget, drived from mComponentClass
void(* NCS_CB_ONNCCREATE)(mWidget *)
the Callback of Event MSG_NCCREATE, which is the first message of a control
Definition: mwidget.h:512
indiate a right arrow
Definition: mwidget.h:168
Set the widget&#39;s back image from file.
Definition: mwidget.h:389
struct _NCS_MAIN_CREATE_INFO NCS_MAIN_CREATE_INFO
int id
Definition: mwidget.h:849
indicate that draw a box or other shape with a frame
Definition: mwidget.h:147
ncsRendererFlag
the flag defines of renderer
Definition: mwidget.h:144
send by a widget is enabled
Definition: mwidget.h:459
const char * glb_rdr
Definition: mwidget.h:883
static DWORD ncsGetDlgCode(HWND hwnd)
Get the dialog code of a NCS window.
Definition: mwidget.h:1276
MGNCS_EXPORT void ncsDestroyWindow(mWidget *self, DWORD endCode)
delete the widget window created by ncs.
MGNCS_EXPORT mWidget * ncsCreateMainWindow(const char *className, const char *caption, DWORD style, DWORD exStyle, int id, int x, int y, int w, int h, HWND host, HICON hIcon, HMENU hMenu, NCS_PROP_ENTRY *props, NCS_RDR_INFO *rdrInfo, NCS_EVENT_HANDLER *handlers, DWORD addData)
create a NCS main window
the component member define
static mWidget * ncsObjFromHandle(HWND hwnd)
Get a Object from window handle.
Definition: mwidget.h:1232
NCS_CREATE_INFO * create_info
Definition: mwidget.h:1027
BOOL(* NCS_CB_ONSZCHGED)(mWidget *, PRECT prcClient)
the callback of event MSG_SIZECHANGED
Definition: mwidget.h:582
a box or item is selected
Definition: mwidget.h:108
MGNCS_EXPORT mWidgetClass * ncsGetMainWndClass(const char *className)
Get a Main window Class by className.
BOOL(* NCS_CB_ONCLOSE)(mWidget *)
the callback of event MSG_CLOSE
Definition: mwidget.h:640
int(* NCS_CB_ONMSG)(mWidget *, UINT message, WPARAM wParam, LPARAM lParam)
the callback of a common message event
Definition: mwidget.h:741
ncsRendererState
define the renderer state of widget
Definition: mwidget.h:104
higlight state
Definition: mwidget.h:106
BOOL(* NCS_CB_ONKEY)(mWidget *, UINT message, int code, DWORD keyStatus)
the callback of event MSG_KEYDOWN MSG_KEYUP MSG_CHAR MSG_SYSKEYDOWN MSG_SYSKEYUP MSG_SYSCHAR ...
Definition: mwidget.h:655
DWORD value
Definition: mwidget.h:853
MGNCS_EXPORT mWidget * ncsCreateWindow(const char *className, const char *caption, DWORD style, DWORD exStyle, int id, int x, int y, int w, int h, HWND parent, NCS_PROP_ENTRY *props, NCS_RDR_INFO *rdrInfo, NCS_EVENT_HANDLER *handlers, DWORD addData)
create a NCS widget
NCS_PROP_ENTRY * props
Definition: mwidget.h:1114
void(* NCS_CB_ONSZCHGING)(mWidget *, const PRECT prcExpect, PRECT prcResult)
the callback of event MSG_SIZECHANGING, when a widget&#39;s bound is changing. If you want change the wid...
Definition: mwidget.h:567
Set the widget &#39;s text, same as SetWindowText.
Definition: mwidget.h:386
Widget class&#39;s Renderer interface.
Set the widget&#39;s back image mode.
Definition: mwidget.h:388
void mWidget_captureHotPiece(mWidget *self, mObject *hotpice)
const char * ctl_rdr
Definition: mwidget.h:887
void(* NCS_CB_WIDGET_ONTIMER)(mWidget *, int id, DWORD count)
the callback of event MSG_TIMER
Definition: mwidget.h:728
void(* NCS_CB_NOTIFY)(mWidget *, int id, int ncCode, DWORD addData)
the callback of all notification event
Definition: mwidget.h:751
MGNCS_EXPORT mWidget * ncsCreateWindowIndirect(const NCS_WND_TEMPLATE *tmpl, HWND hParent)
create a mComponent by NCS_WND_TEMPLATE,
mWidgetProp
the properties id of mWidget
Definition: mwidget.h:384
BOOL(* NCS_CB_ONERASEBKGND)(mWidget *, HDC hdc, const PRECT clip)
the callback of event MSG_ERASEBKGND
Definition: mwidget.h:621
const char * caption
Definition: mwidget.h:1106