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

Data Structures

struct  _NCS_EVENT_HANDLER
 
struct  _NCS_EVENT_CONNECT_INFO
 

Macros

#define ISCLASS(class_name, clssName)   ncsIsClass((const char*)(class_name), (mComponentClass*)(&Class(clssName)))
 the wrapper of ncsIsClass, test a one component class is special one. More...
 

Typedefs

typedef struct _NCS_EVENT_HANDLER NCS_EVENT_HANDLER
 
typedef struct _NCS_EVENT_CONNECT_INFO NCS_EVENT_CONNECT_INFO
 

Functions

MGNCS_EXPORT void * ncsSetComponentHandler (mComponent *comp, UINT message, void *handler)
 set the component handler More...
 
MGNCS_EXPORT void ncsSetComponentHandlers (mComponent *comp, NCS_EVENT_HANDLER *handlers, int count)
 set an array of event handlers More...
 
MGNCS_EXPORT void * ncsGetComponentHandler (mComponent *comp, UINT message)
 get an event callback More...
 
MGNCS_EXPORT BOOL ncsComponentConnectEvents (mComponent *comps, NCS_EVENT_CONNECT_INFO *connects, int counts)
 connect the events between parent and its children, used by ncsCreateMainWindowIndirectFromID More...
 
MGNCS_EXPORT BOOL ncsIsClass (const char *className, mComponentClass *clss)
 check a class name is a special class type or not More...
 
MGNCS_EXPORT BOOL ncsIsChildClass (const char *childClassName, const char *parentClassName)
 check a class name is derived class of a special class More...
 
MGNCS_EXPORT BOOL ncsRegisterComponent (mComponentClass *compCls, DWORD dwStyle, DWORD dwExStyle, int idCursor, int idBkColor)
 register a component class into MiniGUI, so that ncsCreateWindow and ncsCreateWindow can find a mComponentClass instance More...
 
MGNCS_EXPORT mComponentClassncsGetComponentClass (const char *className, BOOL check)
 Get a mComponentClass instance from MiniGUI. More...
 

Detailed Description

Macro Definition Documentation

#define ISCLASS (   class_name,
  clssName 
)    ncsIsClass((const char*)(class_name), (mComponentClass*)(&Class(clssName)))

the wrapper of ncsIsClass, test a one component class is special one.

Note
class_name is a string indicating the component class name, such as NCSCTRL_STATIC; the clssName is an identifier of a class, such as mStatic.
See also
ncsIsClass

Definition at line 471 of file mcomponent.h.

Typedef Documentation

A struct of connection map

Note
used for ncsComponentConnectEvents, in resmanager
See also
ncsComponentConnectEvents

A struct of event-handler mapping

Note
only used for param
See also
NCS_EVENT_HANDLER_NODE

Function Documentation

BOOL ncsComponentConnectEvents ( mComponent comps,
NCS_EVENT_CONNECT_INFO connects,
int  counts = -1 
)

connect the events between parent and its children, used by ncsCreateMainWindowIndirectFromID

Parameters
compsthe mComponent object pointer, it's the parent of the senders and listeners in NCS_EVENT_CONNECT_INFO
connectsthe connection information array
countsthe count of connects array, if it's -1, the array must end by {0, 0, -1, NULL}
See also
NCS_EVENT_CONNECT_INFO, ncsComponentConnectEvents
mComponentClass * ncsGetComponentClass ( const char *  className,
BOOL  check 
)

Get a mComponentClass instance from MiniGUI.

Note
the class_name must be registered into MiniGUI by calling ncsRegisterComponent
Parameters
classNamethe class name to find
checkcheck the class name with found mComponentClass instance, to ensure that we found the right class
Returns
the mComponentClass pointer if sucess, NULL otherwise
void * ncsGetComponentHandler ( mComponent comp,
UINT  message 
)

get an event callback

Parameters
comp
message- event code
Returns
void * the handler of message, or NULL if not set
BOOL ncsIsChildClass ( const char *  childClassName,
const char *  parentClassName 
)

check a class name is derived class of a special class

Parameters
childClassName- the class name to be checked, the component class name, not the typeName of mObject
parentClassName- the class name expected as child class's ancestor, the component class name, not the typeName of mObject
Returns
TRUE - check sucess, FALSE -failed
BOOL ncsIsClass ( const char *  class_name,
mComponentClass clss 
)

check a class name is a special class type or not

Parameters
class_namethe class name to check, this is the component class Name, not the typeName of mObject.
clssthe expected class type pointer
Returns
TRUE - check success, FALSE -failed
BOOL ncsRegisterComponent ( mComponentClass compCls,
DWORD  dwStyle,
DWORD  dwExStyle,
int  idCursor,
int  idBkColor 
)

register a component class into MiniGUI, so that ncsCreateWindow and ncsCreateWindow can find a mComponentClass instance

Parameters
compClsthe mComponentClass to be registered
dwStylethe default style
dwExStylethe default extend style
idCursorthe default cursor
idBkColorthe default background color
Returns
TRUE - success, FALSE - failed
See also
ncsGetComponentClass, ncsCreateWindow, ncsCreateWindowIndirect, ncsCreateMainWindow, ncsCreateMainWindowIndirect
void * ncsSetComponentHandler ( mComponent comp,
UINT  message,
void *  handler 
)

set the component handler

Parameters
compthe compont to set
messagethe event code
handlerthe event callback pointer
Returns
old event callback if it has been set
See also
ncsSetComponentHandlers
void ncsSetComponentHandlers ( mComponent comp,
NCS_EVENT_HANDLER handlers,
int  count 
)

set an array of event handlers

Parameters
comp- the component to set
handlers- the array of NCS_EVENT_HANDLER
count- the count of array handlers.
Note
if count == -1, handlers must end by {-1, NULL}; anywhere, ncsSetComponentHandlers would stop if it find an element of array handlers is equal {-1, NULL}, whether count is equal -1 or not
See also
ncsSetComponentHandler