mGNCS API Reference
v1.2.0
A new control set and a new framework for MiniGUI apps
|
Data Structures | |
struct | mWidgetRenderer |
Widget class's Renderer interface. More... | |
struct | mWidget |
define the mWidget members, inherit from mComponent More... | |
struct | mWidgetClass |
the VTable of mWidget, drived from mComponentClass More... | |
Macros | |
#define | NCSCTRL_WIDGET NCSCLASSNAME("widget") |
the name of widget control More... | |
#define | NCSR_CONTINUE_MSG FALSE |
return value, pass the message to the default window process More... | |
#define | NCSR_STOP_MSG TRUE |
return value, return directly, don't pass the message to default window process More... | |
#define | NCS_NOTIFY_CODE(code) (0xFFFF0000 | (code)) |
#define | NCS_MAP_NOTIFY(code, handler) { NCS_NOTIFY_CODE(code), (void*)(handler) } |
Typedefs | |
typedef struct _NCS_WND_TEMPLATE | NCS_WND_TEMPLATE |
typedef void(* | NCS_CB_ONNCCREATE) (mWidget *) |
the Callback of Event MSG_NCCREATE, which is the first message of a control More... | |
typedef BOOL(* | NCS_CB_ONCREATE) (mWidget *, DWORD dwAddData) |
the callback of event MSG_CREATE More... | |
typedef BOOL(* | NCS_CB_ONINITDLG) (mWidget *, HWND hFocus, DWORD dwAddData) |
the callback of event MSG_INITDIALOG, only valid in mDialogBox, when a dialog is created More... | |
typedef BOOL(* | NCS_CB_ONVOID) (mWidget *, UINT message) |
the callback of events MSG_ACTIVE MSG_FONTCHANGED MSG_KEYLONGPRESS MSG_KEYALWAYSPRESS MSG_DESTROY More... | |
typedef void(* | NCS_CB_ONSZCHGING) (mWidget *, const PRECT prcExpect, PRECT prcResult) |
the callback of event MSG_SIZECHANGING, when a widget's bound is changing. If you want change the widget bounds, set the prcResult, by default, copy prcExpect to prcResult More... | |
typedef BOOL(* | NCS_CB_ONSZCHGED) (mWidget *, PRECT prcClient) |
the callback of event MSG_SIZECHANGED More... | |
typedef void(* | NCS_CB_ONCSZCHGED) (mWidget *, int clientWidth, int clientHeight) |
the callbace of event MSG_CSIZECHANGED More... | |
typedef BOOL(* | NCS_CB_ONFONTCHGING) (mWidget *, PLOGFONT logFont) |
the callback of event MSG_FONTCHANGING More... | |
typedef BOOL(* | NCS_CB_ONERASEBKGND) (mWidget *, HDC hdc, const PRECT clip) |
the callback of event MSG_ERASEBKGND More... | |
typedef void(* | NCS_CB_ONPAINT) (mWidget *, HDC hdc, const PCLIPRGN clipRgn) |
the callback of event MSG_PAINT More... | |
typedef BOOL(* | NCS_CB_ONCLOSE) (mWidget *) |
the callback of event MSG_CLOSE More... | |
typedef 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 More... | |
typedef 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 MSG_RBUTTONUP MSG_RBUTTONDBCLK More... | |
typedef 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_NCRBUTTONDOWN MSG_NCRBUTTONUP MSG_NCRBUTTONDBCLK More... | |
typedef int(* | NCS_CB_ONHITTEST) (mWidget *, UINT message, int x, int y) |
the callback of events MSG_HITTEST MSG_NCHITTEST More... | |
typedef void(* | NCS_CB_ONSCROLL) (mWidget *, UINT message, int code, int pos) |
the callback of events MSG_HSCROLL , MSG_VSCROLL More... | |
typedef BOOL(* | NCS_CB_ONCMD) (mWidget *, int id, int nc, HWND hCtrl) |
the callback of event MSG_COMMAND More... | |
typedef void(* | NCS_CB_WIDGET_ONTIMER) (mWidget *, int id, DWORD count) |
the callback of event MSG_TIMER More... | |
typedef int(* | NCS_CB_ONMSG) (mWidget *, UINT message, WPARAM wParam, LPARAM lParam) |
the callback of a common message event More... | |
typedef void(* | NCS_CB_NOTIFY) (mWidget *, int id, int ncCode, DWORD addData) |
the callback of all notification event More... | |
Enumerations |
Functions | |
void | mWidget_captureHotPiece (mWidget *self, mObject *hotpice) |
Variables | |
MGNCS_EXPORT mWidgetClass | g_stmWidgetCls |
the instance of mWigetClass More... | |
#define NCS_MAP_NOTIFY | ( | code, | |
handler | |||
) | { NCS_NOTIFY_CODE(code), (void*)(handler) } |
#define NCS_NOTIFY_CODE | ( | code | ) | (0xFFFF0000 | (code)) |
#define NCSCTRL_WIDGET NCSCLASSNAME("widget") |
#define NCSR_CONTINUE_MSG FALSE |
return value, pass the message to the default window process
#define NCSR_STOP_MSG TRUE |
return value, return directly, don't pass the message to default window process
void(* NCS_CB_NOTIFY)(mWidget *, int id, int ncCode, DWORD param) |
BOOL(* NCS_CB_ONCLOSE)(mWidget *) |
BOOL(* NCS_CB_ONCMD)(mWidget *, int id, int nc, HWND hCtrl) |
BOOL(* NCS_CB_ONCREATE)(mWidget *, DWORD dwAddData) |
the callback of event MSG_CREATE
mWidget | * the event sender's pointer |
dwAddData | the additional data when create this window, passed by ncscreatewindow, ncscreatewindowindirect, ncscreatemainwindow ncscreatemainwindowindirect |
void(* NCS_CB_ONCSZCHGED)(mWidget *, int clientWidth, int clientHeight) |
BOOL(* NCS_CB_ONERASEBKGND)(mWidget *, HDC hdc, const PRECT clip) |
the callback of event MSG_ERASEBKGND
mWidget | * the sender pointer |
hdc | the DC of background, hdc may be 0, so you shoud check it, and call GetClientDC or GetDC when hdc == 0 |
clip | the area should to be erased. clip may be equal NULL, so, call GetWindowRect, or GetClientRect when clip == NULL |
BOOL(* NCS_CB_ONFONTCHGING)(mWidget *, PLOGFONT logFont) |
the callback of event MSG_FONTCHANGING
This event is called when SetWindowFont is called
mWidget | * then sender pointer |
logFont | the logic font would be set to sender |
int(* NCS_CB_ONHITTEST)(mWidget *, UINT message, int x, int y) |
BOOL(* NCS_CB_ONINITDLG)(mWidget *, HWND hFocus, DWORD dwAddData) |
the callback of event MSG_INITDIALOG, only valid in mDialogBox, when a dialog is created
mWidget | * the sender pointer of event |
hFocus | the focus window when dialog is created |
dwAddData | the additional data passed by ncscreatewindow, ncscreatewindowindirect, ncscreatemainwindow ncscreatemainwindowindirect |
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
mWidget | * the sender pointer |
message | event code, distinguish the events |
code | the scancode (MSG_KEYDOWN MSG_KEYUP MSG_SYSKEYDOWN MSG_SYSKEYUP) or ascii code (MSG_CHAR MSG_SYSCHAR) |
keyStatus | The shift key status when this message occurred |
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 MSG_RBUTTONUP MSG_RBUTTONDBCLK
mWidget | * sender pointer |
message | the event code |
x | the x-coordinate of mouse |
y | the y-coordinate of mouse |
keyStatus | The shift key status when this message occurred. |
int(* NCS_CB_ONMSG)(mWidget *, UINT message, WPARAM wParam, LPARAM lParam) |
the callback of a common message event
mWidget | * sender pointer |
message | the event code |
wParam | the wParam of message event |
lParam | the lParam of message event |
typedef void(* NCS_CB_ONNCCREATE)(mWidget *) |
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_NCRBUTTONDOWN MSG_NCRBUTTONUP MSG_NCRBUTTONDBCLK
mWidget | * the sender pointer |
message | the event code |
x | the x-coordinate of mouse |
y | the y-coordinate of mouse |
hitCode | the hit code |
void(* NCS_CB_ONPAINT)(mWidget *, HDC hdc, const PCLIPRGN clip_rgn) |
void(* NCS_CB_ONSCROLL)(mWidget *, UINT message, int code, int pos) |
BOOL(* NCS_CB_ONSZCHGED)(mWidget *, PRECT prcClient) |
the callback of event MSG_SIZECHANGED
This callback is called after a widget's bound changed if you want change the client size of the sender, reset the prcClient
mWidget | * the sender pointer |
prcClient | IN & OUT param, the client bound of the sender |
void(* NCS_CB_ONSZCHGING)(mWidget *, const PRECT prcExpect, PRECT prcResult) |
the callback of event MSG_SIZECHANGING, when a widget's bound is changing. If you want change the widget bounds, set the prcResult, by default, copy prcExpect to prcResult
mWidget | * the sender pointer |
prcExpect | the excepted bound, IN param |
prcResult | the resulted bound, OUT param, |
BOOL(* NCS_CB_ONVOID)(mWidget *, UINT message) |
the callback of events MSG_ACTIVE MSG_FONTCHANGED MSG_KEYLONGPRESS MSG_KEYALWAYSPRESS MSG_DESTROY
mWidget | * the pointer of sender |
message | the event code, indicate the event |
void(* NCS_CB_WIDGET_ONTIMER)(mWidget *, int id, DWORD count) |
enum mWidgetNotify |
the notification code of mWidget
enum mWidgetProp |
the properties id of mWidget
enum ncsRDRArrow |
enum ncsRendererFlag |
enum ncsRendererState |
g_stmWidgetCls |
the instance of mWigetClass