mGNCS API Reference  v1.2.5
A new control set and a new framework for MiniGUI apps
mwidget.h
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 /*
14  * \file mwidget.h
15  * \author ChaiPeng
16  * \date 2009/01/01
17  *
18  * This file include the base widget control definition.
19  *
20  \verbatim
21 
22  This file is part of mGNCS, a component for MiniGUI.
23 
24  Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd.
25 
26  This program is free software: you can redistribute it and/or modify
27  it under the terms of the GNU General Public License as published by
28  the Free Software Foundation, either version 3 of the License, or
29  (at your option) any later version.
30 
31  This program is distributed in the hope that it will be useful,
32  but WITHOUT ANY WARRANTY; without even the implied warranty of
33  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34  GNU General Public License for more details.
35 
36  You should have received a copy of the GNU General Public License
37  along with this program. If not, see <http://www.gnu.org/licenses/>.
38 
39  Or,
40 
41  As this program is a library, any link to this program must follow
42  GNU General Public License version 3 (GPLv3). If you cannot accept
43  GPLv3, you need to be licensed from FMSoft.
44 
45  If you have got a commercial license of this program, please use it
46  under the terms and conditions of the commercial license.
47 
48  For more information about the commercial license, please refer to
49  <http://www.minigui.com/blog/minigui-licensing-policy/>.
50 
51  \endverbatim
52  */
53 
54 #ifndef _MGUI_NCSCTRL_WIDGET_H
55 #define _MGUI_NCSCTRL_WIDGET_H
56 
57 #include <stdint.h>
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif /* __cplusplus */
62 
63 
64 #define TOWIDGET(x) ((mWidget *)x)
65 #define TOWIDGETCLASS(x) ((mWidgetClass *)x)
66 
67 #define RendererType(className) className##Renderer
68 
69 
79 #define NCSCTRL_WIDGET NCSCLASSNAME("widget")
80 
81 typedef struct _mWidgetClass mWidgetClass;
82 typedef struct _mWidget mWidget;
83 
89 
90 
91 
92 
93 typedef struct _mWidgetRenderer mWidgetRenderer;
94 
95 #define mWidgetRendererHeader(clsName, parentClass) \
96  const char* rdr_name; \
97  /*renderer private method and data * every class must set NULL or it's ownd data */ \
98  void (*class_init)(RendererType(clsName)* rdr); \
99  RendererType(parentClass) *ptrParentClass; \
100  BOOL (*init_self)(RendererType(clsName) *rdr); \
101  void (*uninit_self)(RendererType(clsName) *rdr); \
102  void * prv_data; \
103  /*renderer drivedable method and data, * these data can be used directly by drived class */ \
104  void (*drawFocusFrame)(clsName*, HDC, const RECT* ); \
105  BOOL (*drawBkground)(clsName*, HDC, const RECT*); \
106  void (*draw3dbox)(clsName*, HDC, const RECT*, DWORD,DWORD); \
107  void (*drawCheckbox)(clsName*, HDC, const RECT*, DWORD); \
108  void (*drawRadio)(clsName*, HDC, const RECT*, DWORD); \
109  void (*drawArrow)(clsName*, HDC, const RECT*, int arrow,DWORD, DWORD); \
110  void (*drawItem)(clsName*, HDC, const RECT*, DWORD);
111 
117  NCSRS_NORMAL = 0x00,
123 };
150 #define NCSR_STATUS(flag) ((flag)&0xFFFF)
151 
157  NCSRF_INNERFRAME = 0x010000,
158  NCSRF_FILL = 0x020000,
159  NCSRF_FRAME = 0x040000,
160 };
183 };
288 struct _mWidgetRenderer {
289  mWidgetRendererHeader(mWidget, mWidget)
290 };
291 
292 
293 #define NCSSPEC_OBJ_CONTENT MAX_USER_SPECIAL_KEY + 1
294 
295 #define mWidgetHeader(clsName) \
296  mComponentHeader(clsName) \
297  HWND hwnd; \
298  RendererType(clsName) *renderer; \
299  mComponent* comps; \
300  ImageDrawInfo bkimg; \
301  mObject *body;
302 
321 struct _mWidget
322 {
323  mWidgetHeader(mWidget)
324 };
325 
326 #define mWidgetClassHeader(clsName, parentClass) \
327  mComponentClassHeader(clsName, parentClass) \
328  DWORD dlgCode; \
329  mObject * (*createBody)(clsName*); \
330  LRESULT (*wndProc)(clsName* , UINT, WPARAM, LPARAM); \
331  BOOL (*callUserHandler)(clsName* self, void *handler, \
332  UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pRet); \
333  BOOL (*onCreate)(clsName*, LPARAM); \
334  BOOL (*addChildren)(clsName*, NCS_WND_TEMPLATE* children,int count); \
335  void (*onPaint)(clsName*, HDC, const PCLIPRGN pClip); \
336  int (*onLButtonDown)(clsName*, int x, int y, DWORD keyFlags); \
337  int (*onLButtonUp)(clsName*, int x, int y, DWORD keyFlags); \
338  int (*onMouseMove)(clsName*, int x, int y, DWORD keyFlags); \
339  int (*onKeyDown)(clsName*, int scancode, DWORD keyFlags); \
340  int (*onKeyUp)(clsName*, int scancode, DWORD keyFlags); \
341  int (*onSizeChanged)(clsName*, RECT* rtClient); \
342  BOOL (*onEraseBkgnd)(clsName*, HDC hdc, const RECT* invRect); \
343  \
344  BOOL (*refresh)(clsName *);
345 
346 
373 struct _mWidgetClass
374 {
375  mWidgetClassHeader(mWidget, mComponent)
376 };
377 
378 #define SET_DLGCODE(code) _class->dlgCode = (code);
379 
386 MGNCS_EXPORT extern mWidgetClass g_stmWidgetCls;
387 
388 
389 /* property support */
390 
402  NCSP_WIDGET_MAX
403 };
450 #define NCSS_NOTIFY (0x1)
451 
452 #define IsNotify(self) \
453  (GetWindowStyle(self->hwnd)&NCSS_NOTIFY)
454 
455 #define NCSS_WIDGET_SHIFT 1
456 
457 /*
458  * \def NCSS_EX_UNNEEDIME
459  * \brief the edit uneed ime or not
460  */
461 #define NCSS_EX_UNNEEDIME 0x1
462 
473  NCSN_WIDGET_MAX
474 };
475 
504 #define NCSR_CONTINUE_MSG FALSE
505 
512 #define NCSR_STOP_MSG TRUE
513 
524 typedef void (*NCS_CB_ONNCCREATE)(mWidget*);
525 
540 typedef BOOL (*NCS_CB_ONCREATE)(mWidget*, DWORD dwAddData);
541 
555 typedef BOOL (*NCS_CB_ONINITDLG)(mWidget*, HWND hFocus, DWORD dwAddData);
556 
567 typedef BOOL (*NCS_CB_ONVOID)(mWidget*, UINT message);
579 typedef void (*NCS_CB_ONSZCHGING)(mWidget*, const PRECT prcExpect, PRECT prcResult);
580 
594 typedef BOOL (*NCS_CB_ONSZCHGED)(mWidget*,PRECT prcClient);
595 //MSG_CSIZECHANGED
607 typedef void (*NCS_CB_ONCSZCHGED)(mWidget*, int clientWidth, int clientHeight);
608 
620 typedef BOOL (*NCS_CB_ONFONTCHGING)(mWidget*, PLOGFONT logFont);
633 typedef BOOL (*NCS_CB_ONERASEBKGND)(mWidget*, HDC hdc, const PRECT clip);
643 typedef void (*NCS_CB_ONPAINT)(mWidget*, HDC hdc, const PCLIPRGN clipRgn);
652 typedef BOOL (*NCS_CB_ONCLOSE)(mWidget*);
653 
667 typedef BOOL (*NCS_CB_ONKEY)(mWidget*, UINT message, int code, DWORD keyStatus);
668 
682 typedef BOOL(*NCS_CB_ONMOUSE)(mWidget*, UINT message, int x, int y, DWORD keyStatus);
696 typedef BOOL (*NCS_CB_ONNCMOUSE)(mWidget*, UINT message, int x, int y, int hitCode);
708 typedef int (*NCS_CB_ONHITTEST)(mWidget*, UINT message,int x, int y);
709 
719 typedef void (*NCS_CB_ONSCROLL)(mWidget*, UINT message, int code, int pos);
731 typedef BOOL (*NCS_CB_ONCMD)(mWidget*, int id, int nc, HWND hCtrl);
740 typedef void (*NCS_CB_WIDGET_ONTIMER)(mWidget*, int id, DWORD count);
753 typedef int (*NCS_CB_ONMSG)(mWidget*, UINT message, WPARAM wParam, LPARAM lParam);
763 typedef void (*NCS_CB_NOTIFY)(mWidget*, int id, int ncCode, DWORD addData);
764 
771 #define NCS_NOTIFY_CODE(code) (0xFFFF0000 | (code))
772 
776 #define NCS_MAP_NOTIFY(code, handler) { NCS_NOTIFY_CODE(code), (void*)(handler) }
777 
778 
780 void mWidget_captureHotPiece(mWidget *self, mObject *hotpice);
781 mObject * mWidget_getCapturedHotPiece(mWidget *self);
782 void mWidget_releaseCapturedHotPiece(void);
783 
784 void mWidget_setHoveringFocus(mWidget *self, mObject *hotpiece);
785 mObject * mWidget_getHoveringFocus(mWidget *self);
786 void mWidget_releaseHoveringFocus(void);
787 
788 void mWidget_setInputFocus(mWidget *self, mObject *hotpiece);
789 mObject * mWidget_getInputFocus(mWidget *self);
790 void mWidget_releaseInputFocus(void);
791 
792 #ifdef _MGNCS_GUIBUILDER_SUPPORT
793 //only for GUI Builder
794 //used to create default content
795 #define NCSP_DEFAULT_CONTENT 10000
796 #endif
797 
798 
822 MGNCS_EXPORT BOOL ncsSetFont (HWND hWnd, const char *fontName);
823 
836 MGNCS_EXPORT BOOL ncsSetProperty(HWND hWnd, int id, DWORD value);
848 MGNCS_EXPORT DWORD ncsGetProperty(HWND hWnd, int id);
849 
857 typedef struct _NCS_PROP_ENTRY {
861  int id;
865  DWORD value;
867 
875 typedef struct _NCS_RDR_ELEMENT {
879  int id;
883  DWORD value;
885 
891 typedef struct _NCS_RDR_INFO {
895  const char* glb_rdr;
899  const char* ctl_rdr;
904 }NCS_RDR_INFO;
905 
916 typedef struct _NCS_CREATE_NOTIFY_INFO {
917  BOOL (*onCreated)(struct _NCS_CREATE_NOTIFY_INFO*, mComponent*, DWORD special_id);
919 
920 typedef struct _NCS_CREATE_INFO{
926  NCS_PROP_ENTRY * props;
932  NCS_RDR_INFO * rdr_info;
938  NCS_EVENT_HANDLER *handlers;
944  NCS_WND_TEMPLATE * ctrls;
948  int ctrl_count;
952  DWORD user_data;
953 
954  //FIXED ME Maybe I should not put these two param here
963  DWORD bk_color;
967  const char* font_name;
968 
969  // don't use in the control, to make the NCS_MNWND_TEMPLATE and NCS_WND_TEMPLATE same
970  HICON hIcon;
971  HMENU hMenu;
972 
973  NCS_CREATE_NOTIFY_INFO * notify_info;
974  DWORD special_id;
975 
976 }NCS_CREATE_INFO;
977 
1010 MGNCS_EXPORT mWidget* ncsCreateWindow (const char *className, const char *caption, DWORD style, DWORD exStyle, \
1011  int id, int x, int y, int w, int h, HWND parent, \
1012  NCS_PROP_ENTRY * props, \
1013  NCS_RDR_INFO * rdrInfo, \
1014  NCS_EVENT_HANDLER * handlers, \
1015  DWORD addData);
1016 
1025 typedef struct _NCS_MAIN_CREATE_INFO {
1035  const char* className;
1039  NCS_CREATE_INFO * create_info;
1041 
1078 MGNCS_EXPORT mWidget* ncsCreateMainWindow (const char *className, const char *caption,
1079  DWORD style, DWORD exStyle, \
1080  int id, int x, int y, int w, int h, HWND host, \
1081  HICON hIcon, HMENU hMenu,
1082  NCS_PROP_ENTRY * props, \
1083  NCS_RDR_INFO * rdrInfo, \
1084  NCS_EVENT_HANDLER * handlers, \
1085  DWORD addData);
1086 
1098  const char* class_name;
1102  intptr_t id;
1106  int x, y, w, h;
1110  DWORD style;
1114  DWORD ex_style;
1118  const char* caption;
1119 
1120  //same struct as NCS_CREATE_INFO
1127  NCS_RDR_INFO* rdr_info;
1128  NCS_EVENT_HANDLER* handlers;
1129  NCS_WND_TEMPLATE* ctrls;
1130  intptr_t count;
1131  DWORD user_data;
1132 
1133  //FIXED ME Maybe I should not put these two param here
1134  DWORD bk_color;
1135  const char* font_name;
1136 
1137  // don't use in the control, to make the NCS_MNWND_TEMPLATE and NCS_WND_TEMPLATE same
1138  HICON hIcon;
1139  HMENU hMenu;
1140 
1141  NCS_CREATE_NOTIFY_INFO * notify_info;
1142  DWORD special_id;
1143 };
1144 
1145 //create control window indirect
1158 MGNCS_EXPORT mWidget* ncsCreateWindowIndirect( const NCS_WND_TEMPLATE* tmpl, HWND hParent);
1159 
1167 typedef struct _NCS_MNWND_TEMPLATE{
1168  const char* class_name;
1169  intptr_t id;
1170  int x, y, w, h;
1171  DWORD style;
1172  DWORD ex_style;
1173  const char* caption;
1174 
1175  NCS_PROP_ENTRY* props;
1176  NCS_RDR_INFO* rdr_info;
1177  NCS_EVENT_HANDLER* handlers;
1178  NCS_WND_TEMPLATE* ctrls;
1179  intptr_t count;
1180  DWORD user_data;
1181 
1182  //FIXED ME Maybe I should not put these two param here
1183  DWORD bk_color;
1184  const char* font_name;
1185 
1186  HICON hIcon;
1187  HMENU hMenu;
1188 
1189 
1190  NCS_CREATE_NOTIFY_INFO * notify_info;
1191  DWORD special_id;
1192 
1194 
1206 MGNCS_EXPORT mWidget* ncsCreateMainWindowIndirect(const NCS_MNWND_TEMPLATE* tmpl, HWND hHost);
1207 
1219 MGNCS_EXPORT mWidgetClass* ncsGetMainWndClass(const char* className);
1220 
1232 MGNCS_EXPORT void ncsNotifyParentEx(mWidget * self, int code, DWORD addData);
1233 
1234 #define ncsNotifyParent(self, code) ncsNotifyParentEx((mWidget*)(self), code, 0)
1235 
1244 static inline mWidget* ncsObjFromHandle(HWND hwnd)
1245 {
1246  if(IsWindow(hwnd))
1247  return (mWidget*)(GetWindowAdditionalData2(hwnd));
1248  return NULL;
1249 }
1250 
1260 static inline mWidget* ncsGetChildObj(HWND hwnd, int id)
1261 {
1262  mWidget * self = ncsObjFromHandle(hwnd);
1263  return (mWidget*)(self?_c(self)->getChild(self, id):NULL);
1264 }
1265 
1274 static inline mWidget* ncsGetParentObj(HWND hwnd)
1275 {
1276  return ncsObjFromHandle(GetParent(hwnd));
1277 }
1278 
1279 
1288 static inline DWORD ncsGetDlgCode(HWND hwnd)
1289 {
1290 
1291 #if 0
1292  mWidget * widget;
1293  if((widget=ncsObjFromHandle(hwnd)))
1294  {
1295  return _c(widget)->dlgCode;
1296  }
1297  return 0;
1298 #endif
1299  return (DWORD)SendMessage(hwnd, MSG_GETDLGCODE, 0, 0);
1300 }
1301 
1307 MGNCS_EXPORT void ncsDestroyWindow(mWidget* self, DWORD endCode);
1308 
1309 #define ncsDeleteWidget(self) ncsDestroyWindow(self, 0)
1310 
1311 
1312 #define NCS_FETCH_MSGBINDINFO(sender, param, lParam) do{ \
1313  void ** __tmp = (void**)(lParam); \
1314  if(__tmp){ \
1315  register DWORD* __param = (DWORD*)(void*)&(param); \
1316  register void** __sender = (void**)(void*)&(sender); \
1317  *__param = (DWORD)__tmp[0]; \
1318  *__sender = __tmp[1]; \
1319  free(__tmp); \
1320  } \
1321 }while(0)
1322 
1323 MGNCS_EXPORT BOOL ncsBindEventsToMessage(mObject *sender, HWND hwnd_listener, UINT message, int* event_ids);
1324 MGNCS_EXPORT BOOL ncsBindEventToMessage(mObject* sender, HWND hwnd_listener, UINT message, int event_ids);
1325 MGNCS_EXPORT void ncsRemoveBindWindow(HWND hwnd_listener);
1326 MGNCS_EXPORT void ncsRemoveBindMessage(HWND hwnd_listener, UINT message, mObject* sender/*=NULL*/, int event_id/*=0*/);
1327 
1328 
1334 #ifdef __cplusplus
1335 }
1336 #endif /* __cplusplus */
1337 
1338 #endif /* _MGUI_NCSCTRL_WIDGET_H */
1339 
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:555
ncsRDRArrow
the arrow define of renderer
Definition: mwidget.h:178
Set the renderer class name.
Definition: mwidget.h:397
void(* NCS_CB_ONSCROLL)(mWidget *, UINT message, int code, int pos)
the callback of events MSG_HSCROLL , MSG_VSCROLL
Definition: mwidget.h:719
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:469
indicate that fill a box or other shape
Definition: mwidget.h:158
void(* NCS_CB_ONPAINT)(mWidget *, HDC hdc, const PCLIPRGN clipRgn)
the callback of event MSG_PAINT
Definition: mwidget.h:643
indiate a down arrow
Definition: mwidget.h:182
BOOL(* NCS_CB_ONCREATE)(mWidget *, DWORD dwAddData)
the callback of event MSG_CREATE
Definition: mwidget.h:540
static mWidget * ncsGetChildObj(HWND hwnd, int id)
Get the child object pointer of window.
Definition: mwidget.h:1260
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:696
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:399
static mWidget * ncsGetParentObj(HWND hwnd)
Get the parent object pointer of window.
Definition: mwidget.h:1274
NCS_RDR_ELEMENT * elements
Definition: mwidget.h:903
int(* NCS_CB_ONHITTEST)(mWidget *, UINT message, int x, int y)
the callback of events MSG_HITTEST MSG_NCHITTEST
Definition: mwidget.h:708
indiate a left arrow
Definition: mwidget.h:179
send by a widget is disabled
Definition: mwidget.h:472
struct _NCS_RDR_ELEMENT NCS_RDR_ELEMENT
MGNCS_EXPORT mWidgetClass g_stmWidgetCls
the instance of mWigetClass
const char * className
Definition: mwidget.h:1035
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:157
half selected state
Definition: mwidget.h:121
define the mWidget members, inherit from mComponent
the Object struct
send by a widget is double cliced by left button
Definition: mwidget.h:470
Definition: mwidget.h:857
void(* NCS_CB_ONCSZCHGED)(mWidget *, int clientWidth, int clientHeight)
the callbace of event MSG_CSIZECHANGED
Definition: mwidget.h:607
disable state
Definition: mwidget.h:122
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:682
#define _c(ths)
the marco get the class of a object
Definition: mobject.h:72
indiate a up arrow
Definition: mwidget.h:181
struct _NCS_PROP_ENTRY NCS_PROP_ENTRY
const char * class_name
Definition: mwidget.h:1098
normal state
Definition: mwidget.h:117
BOOL(* NCS_CB_ONFONTCHGING)(mWidget *, PLOGFONT logFont)
the callback of event MSG_FONTCHANGING
Definition: mwidget.h:620
BOOL(* NCS_CB_ONCMD)(mWidget *, int id, int nc, HWND hCtrl)
the callback of event MSG_COMMAND
Definition: mwidget.h:731
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:567
mWidgetNotify
the notification code of mWidget
Definition: mwidget.h:468
struct _NCS_CREATE_NOTIFY_INFO NCS_CREATE_NOTIFY_INFO
significant state
Definition: mwidget.h:119
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:524
indiate a right arrow
Definition: mwidget.h:180
Set the widget&#39;s back image from file.
Definition: mwidget.h:401
struct _NCS_MAIN_CREATE_INFO NCS_MAIN_CREATE_INFO
int id
Definition: mwidget.h:861
indicate that draw a box or other shape with a frame
Definition: mwidget.h:159
ncsRendererFlag
the flag defines of renderer
Definition: mwidget.h:156
send by a widget is enabled
Definition: mwidget.h:471
const char * glb_rdr
Definition: mwidget.h:895
static DWORD ncsGetDlgCode(HWND hwnd)
Get the dialog code of a NCS window.
Definition: mwidget.h:1288
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:1244
NCS_CREATE_INFO * create_info
Definition: mwidget.h:1039
BOOL(* NCS_CB_ONSZCHGED)(mWidget *, PRECT prcClient)
the callback of event MSG_SIZECHANGED
Definition: mwidget.h:594
a box or item is selected
Definition: mwidget.h:120
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:652
int(* NCS_CB_ONMSG)(mWidget *, UINT message, WPARAM wParam, LPARAM lParam)
the callback of a common message event
Definition: mwidget.h:753
ncsRendererState
define the renderer state of widget
Definition: mwidget.h:116
higlight state
Definition: mwidget.h:118
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:667
DWORD value
Definition: mwidget.h:865
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:1126
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:579
Set the widget &#39;s text, same as SetWindowText.
Definition: mwidget.h:398
Widget class&#39;s Renderer interface.
Set the widget&#39;s back image mode.
Definition: mwidget.h:400
void mWidget_captureHotPiece(mWidget *self, mObject *hotpice)
const char * ctl_rdr
Definition: mwidget.h:899
void(* NCS_CB_WIDGET_ONTIMER)(mWidget *, int id, DWORD count)
the callback of event MSG_TIMER
Definition: mwidget.h:740
void(* NCS_CB_NOTIFY)(mWidget *, int id, int ncCode, DWORD addData)
the callback of all notification event
Definition: mwidget.h:763
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:396
BOOL(* NCS_CB_ONERASEBKGND)(mWidget *, HDC hdc, const PRECT clip)
the callback of event MSG_ERASEBKGND
Definition: mwidget.h:633
const char * caption
Definition: mwidget.h:1118