Foundation Class
mObject
mObjectIntroduction of mObject
mObjectmObject is the foundation class of all mGNCS, it:
Encapsulates mGNCS inheritance and virtual function realization
Defines the most fundamental class member structure
At the same time, a group of operation functions are defined to control the behavior of class
The class is foundation class and cannot be used directly
Direct child class:
mComponent
Operation Function of mObject
mObjectIn mGNCS, many operations about class have mObject pointer as the parameter, and these are
Type judgment operation:
ncsInstanceOf, equivalent to instance of operator of java, case of judging if a pointer is the appointed class
For the convenience of operation, macro is provided
Example
In addition, to judge if a pointer is mObject object, ncsIsValidObj can be used:
Corresponding macro is
Type conversion operation:
ncsSafeCast, safe type conversion, similar todynamic_castoperator of C++
Corresponding macro is
Example
Other functions:
newObject,deleteOBject,TYPENAMEmacro.
To create an object, newObject will be used, because it will call constructor function of the object.
To delete an object, deleteObject will be used, because it will call destructor function of the object
mComponent
mComponentIntroduction of mComponent
mComponentmComponent provides the most fundamental realization of component. Component is the most fundamental element of mGNCS program.
The class is foundation class and cannot be used directly
Inherited from:
mObjectDirect child class
mWidgetmInvsbComp
Method of mComponent
mComponentsetProperty
Set property of the component
Return:
TRUE– setting successful;FALSE–setting failedParams
int id - ID of property
DWORDvalue – property value
getProperty
Get property of the component
Return: property value or
DWORD(-1)Params
int id – property ID
setId
Set Id of the component
Return: return old Id
Params
int id - new id
getId
Get component Id
Return: component Id
getReleated
Get components related to the component, such as parent component, child component and brother component
Return:
NULLor corresponding component object pointerParams:
int releated: relation type: one of
NCS_COMP_NEXT,NCS_COMP_PREV,NCS_COMP_PARENTandNCS_COMP_CHILDRENsetReleated:
Set associated component
Return: associated component pointer after setting, if the setting is not successful,
NULLis returnedParams
mComponent*comp – set component pointerint related – same as
getReletaed
getChild
Get child component appointed by id
Return :
NULLor corresponding component pointerParams:
int id – id of the component to get
Operation Function of mComponent
mComponentComponent supports some universal operations
Event installation and unloading function
Register related functions
mWidget
mWidgetIntroduction of mWidget
mWidgetmWidget is the foundation class of all the controls
Inherited from
mComponentDirect child class
mStaticmButtonmPanelmScrollWidgetmProgressBarmPropSheetmSlidermSpinbox
Style of mWidget
mWidgetStyle ID
Property Name of miniStudio
Explanation
NCSS_NOTIFY
Notify
Decide if the control generates Notification event
Property of mWidget
mWidgetProperty name
Property name of miniStudio
Type
RW
Explanation
NCSP_WIDGET_RDR
Renderer
const char*
W
Set current renderer of the control
NCSP_WIDGET_TEXT
Text
const char*
W
Set text content of the current control
NCSP_WIDGET_BKIMAGE
BkImage
PBITMAP
RW
Set or get current background image
NCSP_WIDGET_BKIMAGE_FILE
-
const char*
Set current background image, and automatically load from the file name
Method of mWidget
mWidgetNone
Event of mWidget
mWidgetMSG_NCCREATEDescription: the first message of the window when the window non client area is created. Now the window is still not built, and the functions with the window sentence handle as the parameter cannot be called
Callback: void (*
NCS_CB_ONNCCREATE)(mWidget*);Returned value: none
Parameter
mWidget* event generator object pointerMSG_CREATEDescription: generated when the window is created.
Callback: typedef
BOOL(*)NCS_CB_ONCREATE(mWidget *,DWORDdwAddData)Returned value:
TRUE– continue creating;FALSE– exit creatingParameter
mWidget*DWORDdwAddDataadditional dataNotification message
All the events generated from the notification message use the callback
void (*
NCS_CB_NOTIFY)(mWidget*, intnc_code);Returned value: none
Parameter
mWidget* event generator object pointerint
nc_code: event notification code, used to distinguish different events
*Note: Callback of all the notification events is NCS_CB_NOTIFY*
Operation Function of mWidget
mWidgetFunctions that create controls
Direct associated operation of object pointer and window sentence handle
Example of mWidget
mWidgetmWidget cannot be used directly
<< Renderer and Resources Management | Table of Contents | Static Box and Derived Control Classes >>
Last updated