mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
Data Structures | Typedefs | Functions
Global Control function

Data Structures

struct  _NCS_PROP_ENTRY
 
struct  _NCS_RDR_ELEMENT
 
struct  _NCS_RDR_INFO
 
struct  _NCS_CREATE_NOTIFY_INFO
 
struct  _NCS_MAIN_CREATE_INFO
 
struct  _NCS_WND_TEMPLATE
 
struct  _NCS_MNWND_TEMPLATE
 

Typedefs

typedef struct _NCS_PROP_ENTRY NCS_PROP_ENTRY
 
typedef struct _NCS_RDR_ELEMENT NCS_RDR_ELEMENT
 
typedef struct _NCS_RDR_INFO NCS_RDR_INFO
 
typedef struct _NCS_CREATE_NOTIFY_INFO NCS_CREATE_NOTIFY_INFO
 
typedef struct _NCS_MAIN_CREATE_INFO NCS_MAIN_CREATE_INFO
 
typedef struct _NCS_MNWND_TEMPLATE NCS_MNWND_TEMPLATE
 

Functions

MGNCS_EXPORT BOOL ncsSetFont (HWND hWnd, const char *fontName)
 set control's font More...
 
MGNCS_EXPORT BOOL ncsSetProperty (HWND hWnd, int id, DWORD value)
 set control's property More...
 
MGNCS_EXPORT DWORD ncsGetProperty (HWND hWnd, int id)
 get control's property More...
 
MGNCS_EXPORT mWidgetncsCreateWindow (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 More...
 
MGNCS_EXPORT mWidgetncsCreateMainWindow (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 More...
 
MGNCS_EXPORT mWidgetncsCreateWindowIndirect (const NCS_WND_TEMPLATE *tmpl, HWND hParent)
 create a mComponent by NCS_WND_TEMPLATE, More...
 
MGNCS_EXPORT mWidgetncsCreateMainWindowIndirect (const NCS_MNWND_TEMPLATE *tmpl, HWND hHost)
 create a main window from a template More...
 
MGNCS_EXPORT mWidgetClassncsGetMainWndClass (const char *className)
 Get a Main window Class by className. More...
 
MGNCS_EXPORT void ncsNotifyParentEx (mWidget *self, int code, DWORD addData)
 raise a notification event More...
 
static mWidgetncsObjFromHandle (HWND hwnd)
 Get a Object from window handle. More...
 
static mWidgetncsGetChildObj (HWND hwnd, int id)
 Get the child object pointer of window. More...
 
static mWidgetncsGetParentObj (HWND hwnd)
 Get the parent object pointer of window. More...
 
static DWORD ncsGetDlgCode (HWND hwnd)
 Get the dialog code of a NCS window. More...
 
MGNCS_EXPORT void ncsDestroyWindow (mWidget *self, DWORD endCode)
 delete the widget window created by ncs. More...
 

Detailed Description

Typedef Documentation

A struct include the creating info for creating window

Note
This struct is used by ncsCreateWindow, donot use it directly. If you want to create a NCS widget by MiniGUI API CreateWindow, pass the NCS_CREATE_INFO* as Additional data

A struct wrap the NCS_CREATE_INFO

Note
only allowed using in ncsCreateMainWindow Don't use it directly
See also
NCS_CREATE_INFO, ncsCreateMainWindow , ncsCreateMainWindowIndirect

A struct include all the creating info for ncsCreateMainWindowIndirect,

Note
same as ncsCreateMainWindow 's params
See also
NCS_WND_TEMPLATE, ncsCreateMainWindow

A property entry

Note
this struct is used when calling ncsCreateXXX functions
See also
NCS_CREATE_INFO NCS_WND_TEMPLATE NCS_MNWND_TEMPLATE

A renderer element struct

Note
This struct is used by NCS_RDR_INFO when create a NCS widget
See also
NCS_RDR_INFO
typedef struct _NCS_RDR_INFO NCS_RDR_INFO

A struct used to include all the renderer info when create a widget

See also
NCS_CREATE_INFO, NCS_MAIN_CREATE_INFO, NCS_WND_TEMPLATE, NCS_MNWND_TEMPLATE

Function Documentation

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

Parameters
classNamethe class name of widget. the class name must be register by ncsRegisterComponent. And must be NCSCTRL_MAINWND or its dirved class.
captionthe caption of the main window
stylethe style of main window
exStylethe extend style of main window
idthe id of main window
xthe x position of main window
ythe y position of main window
wthe width of main window
hthe height of main window
hostthe handle of host window, can be NULL
hIconthe icon of main window
hMenuthe menu bar handle
propsthe properties array pointer, end by {-1, 0} if it's not NULL
rdrInfothe renderer info pointer
handlersthe handlers of event array pointer, end by {-1, NULL}, if it's not NULL
addDatathe additional data send to callback NCS_CB_ONCREATE and NCS_CB_ONINITDLG
Returns
mWidget* - a mWidget pointer, must be a mMainWnd instance
See also
ncsCreateWindow,ncsCreateWindowIndirect, nscCreateMainWindowIndirect, NCS_PROP_ENTRY, NCS_RDR_INFO, NCS_EVENT_HANDLER, NCS_CB_ONCREATE, mWidget, mInvisibleComponent , mMainWnd
mWidget * ncsCreateMainWindowIndirect ( const NCS_MNWND_TEMPLATE tmpl,
HWND  hHost 
)

create a main window from a template

Parameters
tmpl- the template of main window
hHost- the host window handler of the main window
Returns
mWidget * - the Instance of mMainWnd or NULL
See also
ncsCreateMainWindow, NCS_MNWND_TEMPLATE
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

Parameters
classNamethe class name of widget. the class name must be register by ncsRegisterComponent. Any drived from mComponent and registered component is validate
captionthe caption of the widget, ignored if class_name is a mInvsbComp
stylethe style of widget, ignored if class_name is a mInvsbComp
exStylethe extend style of widget, ignored if class_name is a mInvsbComp
idthe id of component
xthe x position of widget, ignored if class_name is a mInvsbComp
ythe y position of widget, ignored if class_name is a mInvsbComp
wthe width of widget ,ignored if class_name is a mInvsbComp
hthe height of widget , ignored if class_name is a mInvsbComp
parentthe handle of parent, if class_name is a mInvsbComp, the parent must releated a mWidget object
propsthe properties array pointer, end by {-1, 0} if it's not NULL
rdrInfothe renderer info pointer
handlersthe handlers of event array pointer, end by {-1, NULL}, if it's not NULL
addDatathe additional data send to callback NCS_CB_ONCREATE
Returns
mWidget* - a mWidget pointer, if class_name is a mInvsbComp, it's a mInvisibleComponent* pointer
See also
ncsCreateMainWindow, nscCreateWindowIndirect, NCS_PROP_ENTRY, NCS_RDR_INFO, NCS_EVENT_HANDLER, NCS_CB_ONCREATE, mWidget, mInvisibleComponent
mWidget * ncsCreateWindowIndirect ( const NCS_WND_TEMPLATE tmpl,
HWND  hParent 
)

create a mComponent by NCS_WND_TEMPLATE,

Parameters
tmplthe template pointer
hParentthe parent handle, if NCS_WND_TEMPLATE.class_name is a mInvsbComp, hParent must releated a mWidget object
Returns
mWidget* - then pointer of object or NULL if failed
See also
ncsCreateWindow, NCS_WND_TEMPLATE
void ncsDestroyWindow ( mWidget self,
DWORD  endCode 
)

delete the widget window created by ncs.

Referenced by ncsGetDlgCode().

static inline mWidget * ncsGetChildObj ( HWND  hwnd,
int  id 
)
inlinestatic

Get the child object pointer of window.

Parameters
hwnd- the handle of window, which can be a normal MiniGUI window or a NCS window
id- the child id. The child must be a NCS window
Returns
mWidget * the instance releated id, or NULL

Definition at line 1248 of file mwidget.h.

References _c, and ncsObjFromHandle().

static inline DWORD ncsGetDlgCode ( HWND  hwnd)
inlinestatic

Get the dialog code of a NCS window.

Parameters
hwnd- the handle of NCS window
Returns
DWORD - the dialog code or 0

Definition at line 1276 of file mwidget.h.

References _c, ncsDestroyWindow(), and ncsObjFromHandle().

mWidgetClass * ncsGetMainWndClass ( const char *  className)

Get a Main window Class by className.

Note
this function is used to develop a drived class of mMainWnd
Parameters
className- the class name of main window , if className == NULL or invalidate name, the function return mMainWnd's class
Returns
mWidgetClass* - the mMainWndClass pointer or its drived class pointer
static inline mWidget * ncsGetParentObj ( HWND  hwnd)
inlinestatic

Get the parent object pointer of window.

Parameters
hwnd- the handle of child window, which can be a normal MiniGUI window or a NCS window
Returns
mWidget * the instance of parent of hwnd

Definition at line 1262 of file mwidget.h.

References ncsObjFromHandle().

void * ncsGetProperty ( HWND  hWnd,
int  id 
)

get control's property

Parameters
hWnd- the handle of control
id- the property id
Returns
the value of property
See also
ncsSetProperty
void ncsNotifyParentEx ( mWidget self,
int  code,
DWORD  addData 
)

raise a notification event

Note
this function is used to develop a drived class of mWidget
Parameters
self- the mWidget object who want to raise a event
code- the notification event code
addData- the additional data.
static inline mWidget * ncsObjFromHandle ( HWND  hwnd)
inlinestatic

Get a Object from window handle.

Parameters
hwnd- the handle of window
Returns
mWidget * the instance releated this handle, or NULL

Definition at line 1232 of file mwidget.h.

Referenced by ncsGetChildObj(), ncsGetDlgCode(), and ncsGetParentObj().

BOOL ncsSetFont ( HWND  hWnd,
const char *  fontName 
)

set control's font

Parameters
hWnd- the handle of control
fontName- the name of a logical font
Returns
suceess or not
BOOL ncsSetProperty ( HWND  hWnd,
int  id,
DWORD  value 
)

set control's property

Parameters
hWnd- the handle of control
id- the property id of control
value- the value of property
Returns
suceess or not
See also
ncsGetProperty