mGNCS API Reference  v1.5.0
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 
mComponent
the component member define
NCSP_WIDGET_RDR
@ NCSP_WIDGET_RDR
Set the renderer class name.
Definition: mwidget.h:397
NCSN_WIDGET_DISABLED
@ NCSN_WIDGET_DISABLED
send by a widget is disabled
Definition: mwidget.h:472
_NCS_RDR_ELEMENT::value
DWORD value
Definition: mwidget.h:883
mWidgetClass
the VTable of mWidget, drived from mComponentClass
ncsGetDlgCode
static DWORD ncsGetDlgCode(HWND hwnd)
Get the dialog code of a NCS window.
Definition: mwidget.h:1288
mObject
the Object struct
_NCS_MNWND_TEMPLATE
Definition: mwidget.h:1167
NCSRS_DISABLE
@ NCSRS_DISABLE
disable state
Definition: mwidget.h:122
_NCS_RDR_INFO::ctl_rdr
const char * ctl_rdr
Definition: mwidget.h:899
ncsDestroyWindow
MGNCS_EXPORT void ncsDestroyWindow(mWidget *self, DWORD endCode)
delete the widget window created by ncs.
ncsCreateMainWindow
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
NCSP_WIDGET_BKIMAGE_FILE
@ NCSP_WIDGET_BKIMAGE_FILE
Set the widget's back image from file.
Definition: mwidget.h:401
NCSRS_SIGNIFICANT
@ NCSRS_SIGNIFICANT
significant state
Definition: mwidget.h:119
NCS_CREATE_NOTIFY_INFO
struct _NCS_CREATE_NOTIFY_INFO NCS_CREATE_NOTIFY_INFO
_NCS_WND_TEMPLATE::style
DWORD style
Definition: mwidget.h:1110
NCSP_WIDGET_BKIMAGE_MODE
@ NCSP_WIDGET_BKIMAGE_MODE
Set the widget's back image mode.
Definition: mwidget.h:400
ncsCreateMainWindowIndirect
MGNCS_EXPORT mWidget * ncsCreateMainWindowIndirect(const NCS_MNWND_TEMPLATE *tmpl, HWND hHost)
create a main window from a template
_NCS_WND_TEMPLATE::class_name
const char * class_name
Definition: mwidget.h:1098
NCS_MNWND_TEMPLATE
struct _NCS_MNWND_TEMPLATE NCS_MNWND_TEMPLATE
ncsGetChildObj
static mWidget * ncsGetChildObj(HWND hwnd, int id)
Get the child object pointer of window.
Definition: mwidget.h:1260
NCSRF_FRAME
@ NCSRF_FRAME
indicate that draw a box or other shape with a frame
Definition: mwidget.h:159
NCS_CB_ONNCCREATE
void(* NCS_CB_ONNCCREATE)(mWidget *)
the Callback of Event MSG_NCCREATE, which is the first message of a control
Definition: mwidget.h:524
_NCS_EVENT_HANDLER
Definition: mcomponent.h:378
NCSR_ARROW_DOWN
@ NCSR_ARROW_DOWN
indiate a down arrow
Definition: mwidget.h:182
NCSN_WIDGET_DBCLICKED
@ NCSN_WIDGET_DBCLICKED
send by a widget is double cliced by left button
Definition: mwidget.h:470
ncsGetMainWndClass
MGNCS_EXPORT mWidgetClass * ncsGetMainWndClass(const char *className)
Get a Main window Class by className.
_NCS_MAIN_CREATE_INFO
Definition: mwidget.h:1025
NCSRS_SELECTED
@ NCSRS_SELECTED
a box or item is selected
Definition: mwidget.h:120
_NCS_WND_TEMPLATE::caption
const char * caption
Definition: mwidget.h:1118
_NCS_RDR_INFO
Definition: mwidget.h:891
mWidget_captureHotPiece
void mWidget_captureHotPiece(mWidget *self, mObject *hotpice)
_NCS_PROP_ENTRY::value
DWORD value
Definition: mwidget.h:865
NCSRF_FILL
@ NCSRF_FILL
indicate that fill a box or other shape
Definition: mwidget.h:158
ncsRDRArrow
ncsRDRArrow
the arrow define of renderer
Definition: mwidget.h:178
NCS_RDR_ELEMENT
struct _NCS_RDR_ELEMENT NCS_RDR_ELEMENT
NCSRS_HIGHLIGHT
@ NCSRS_HIGHLIGHT
higlight state
Definition: mwidget.h:118
_NCS_WND_TEMPLATE::props
NCS_PROP_ENTRY * props
Definition: mwidget.h:1126
NCSP_WIDGET_TEXT
@ NCSP_WIDGET_TEXT
Set the widget 's text, same as SetWindowText.
Definition: mwidget.h:398
NCS_MAIN_CREATE_INFO
struct _NCS_MAIN_CREATE_INFO NCS_MAIN_CREATE_INFO
ncsObjFromHandle
static mWidget * ncsObjFromHandle(HWND hwnd)
Get a Object from window handle.
Definition: mwidget.h:1244
NCSRF_INNERFRAME
@ NCSRF_INNERFRAME
indicate that draw a inner frame box or shape
Definition: mwidget.h:157
_NCS_WND_TEMPLATE::x
int x
Definition: mwidget.h:1106
NCSP_WIDGET_BKIMAGE
@ NCSP_WIDGET_BKIMAGE
Set the widget's back image.
Definition: mwidget.h:399
mWidget
define the mWidget members, inherit from mComponent
NCSRS_HALFSELECTED
@ NCSRS_HALFSELECTED
half selected state
Definition: mwidget.h:121
ncsNotifyParentEx
MGNCS_EXPORT void ncsNotifyParentEx(mWidget *self, int code, DWORD addData)
raise a notification event
NCS_PROP_ENTRY
struct _NCS_PROP_ENTRY NCS_PROP_ENTRY
NCSN_WIDGET_ENABLED
@ NCSN_WIDGET_ENABLED
send by a widget is enabled
Definition: mwidget.h:471
_NCS_WND_TEMPLATE::ex_style
DWORD ex_style
Definition: mwidget.h:1114
_NCS_CREATE_NOTIFY_INFO
Definition: mwidget.h:916
ncsGetProperty
MGNCS_EXPORT DWORD ncsGetProperty(HWND hWnd, int id)
get control's property
_NCS_PROP_ENTRY::id
int id
Definition: mwidget.h:861
g_stmWidgetCls
MGNCS_EXPORT mWidgetClass g_stmWidgetCls
the instance of mWigetClass
_NCS_MAIN_CREATE_INFO::className
const char * className
Definition: mwidget.h:1035
_NCS_RDR_ELEMENT
Definition: mwidget.h:875
NCSR_ARROW_LEFT
@ NCSR_ARROW_LEFT
indiate a left arrow
Definition: mwidget.h:179
NCSN_WIDGET_CLICKED
@ NCSN_WIDGET_CLICKED
send by a widget is cliced by left button
Definition: mwidget.h:469
mWidgetProp
mWidgetProp
the properties id of mWidget
Definition: mwidget.h:396
_NCS_RDR_ELEMENT::id
int id
Definition: mwidget.h:879
ncsSetFont
MGNCS_EXPORT BOOL ncsSetFont(HWND hWnd, const char *fontName)
set control's font
_NCS_WND_TEMPLATE::id
intptr_t id
Definition: mwidget.h:1102
_NCS_RDR_INFO::glb_rdr
const char * glb_rdr
Definition: mwidget.h:895
ncsGetParentObj
static mWidget * ncsGetParentObj(HWND hwnd)
Get the parent object pointer of window.
Definition: mwidget.h:1274
mWidgetNotify
mWidgetNotify
the notification code of mWidget
Definition: mwidget.h:468
mWidgetRenderer
Widget class's Renderer interface.
ncsRendererState
ncsRendererState
define the renderer state of widget
Definition: mwidget.h:116
ncsRendererFlag
ncsRendererFlag
the flag defines of renderer
Definition: mwidget.h:156
NCSRS_NORMAL
@ NCSRS_NORMAL
normal state
Definition: mwidget.h:117
ncsCreateWindowIndirect
MGNCS_EXPORT mWidget * ncsCreateWindowIndirect(const NCS_WND_TEMPLATE *tmpl, HWND hParent)
create a mComponent by NCS_WND_TEMPLATE,
NCSR_ARROW_RIGHT
@ NCSR_ARROW_RIGHT
indiate a right arrow
Definition: mwidget.h:180
ncsCreateWindow
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_WND_TEMPLATE
Definition: mwidget.h:1092
_NCS_MAIN_CREATE_INFO::create_info
NCS_CREATE_INFO * create_info
Definition: mwidget.h:1039
NCSR_ARROW_UP
@ NCSR_ARROW_UP
indiate a up arrow
Definition: mwidget.h:181
_NCS_RDR_INFO::elements
NCS_RDR_ELEMENT * elements
Definition: mwidget.h:903
_NCS_PROP_ENTRY
Definition: mwidget.h:857
NCS_RDR_INFO
struct _NCS_RDR_INFO NCS_RDR_INFO
ncsSetProperty
MGNCS_EXPORT BOOL ncsSetProperty(HWND hWnd, int id, DWORD value)
set control's property
_c
#define _c(ths)
the marco get the class of a object
Definition: mobject.h:72