 | | WideStudio/MWT Class Reference
| |
Class Name
WSCbase
Specification of methods
initialize method
- Form
- long initialize()
- Function
- Initializes the instance.
- Description
-
- Parameters
- None.
- Return value
- Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
- Notice
- Requires calling this initialize method once
before calling the others.
- Samples
-
WSCbase* create_proc(WSCbase* parent){
WSCbase* inst = new WSCdialog(parent,"newwin000");
inst->initialize();
inst->setProperty(WSNname,"newwin000");
inst->setProperty(WSNtitleString,"title1");
inst->setProperty(WSNvis,(WSCbool)1);
return inst;
}
getInitialized method
- Form
- WSCbool getInitialized()
- Function
- Returns the status of initializing.
- Description
- Acquires whether the instance is initialized.
- Parameters
- None.
- Return value
- Returns True if initialized; returns False if not.
- Notice
-
- Samples
-
void sample_proc(WSCbase* object){
if (object->getInitialized() != False){
//object is initialized by initialize()
}else{
//object is not initialized.
}
}
getInstanceName method
- Form
- char* getInstanceName()
- Function
- Returns the instance name.
- Description
-
- Parameters
- None.
- Return value
- Returns the instance name.
- Notice
- Do not delete the return value;
and it will become invalid by calling setInstanceName().
- Samples
-
void sample_proc(WSCbase* object){
char* iname = object->getInstanceName();
printf("instance name=%s\n",iname);
char* iname2 = object->getInstanceName();
object->setInstanceName("new-name"); //delete the pointer.
//value: iname2 becomes junc pointer by setInstanceName()...
printf("instance name=%s\n",iname2); //junc pointer!!
WSCstring iname3;
iname3 = object->getInstanceName();
object->setInstanceName("new-name");
printf("instance name=%s\n",(char*)iname3); //not junc pointer.
}
setInstanceName method
- Form
- void setInstanceName(char*)
- Function
- Specifies the instance name.
- Description
-
- Parameters
-
(in)char* pname | instance name |
- Return value
- None.
- Notice
-
- Samples
- Refer to getInstanceName().
getClassName method
- Form
- char* getClassName()
- Function
- Returns the class name of the instance.
- Description
-
- Parameters
- None.
- Return value
- Returns the class name.
- Notice
- Do not delete the return value.
- Samples
-
void sample_proc(WSCbase* object){
char* cname = object->getClassName();
printf("class name=%s\n",cname);
}
cast method
- Form
- void* cast(char* class_name)
- Function
- Supplies the function of down cast.
Usually C++ language does not allow casting
an abstract pointer to a pointer of a child class.
So the instance has all child class pointers,
cast() method seek for a specified class pointer
from among all the contained pointers of child classes.
- Description
-
- Parameters
-
(in)char* class_name | child class name |
- Return value
- Returns the pointer.
If the specified class does not relate, returns NULL.
- Notice
- Please use the returned pointer as follows.
- Samples
-
extern WSCbase* object;
// WSCvlabel* label = (WSCvlabel*)object; //C++ does not allow this.
WSCvlabel* label = (WSCvlabel*)object->cast("WSCvlabel");
if (label == NULL){
//if this "object" does not relate to WSCvlabel class,
//returns NULL.
}else{
//it is OK.
//this "object" is the child class of WSCvlabel.
//cast void* to WSCvlabel* ...
}
setProperty method
- Form
- WSCbool setProperty(char* pname,const WSCvariant &)
- Function
- Sets the value into the property.
- Description
- Seeks for the specified property,
then sets the value into it.
- Parameters
-
(in)char* pname | the property name |
(in)WSCvariant & value | the value |
- Return value
- Returns True if it succeeds, False if it fails.
- Notice
- Second parameter requires any type
which it can cast to WSCvariant.
- Samples
-
void sample_proc(WSCbase* object){
long val1 = 1;
object->setProperty(WSNlabelString,val1); //set long value.
char* val2 = "char* string..";
object->setProperty(WSNlabelString,val2); //set string value.
WSCstring val3 = "WSCstring..";
object->setProperty(WSNlabelString,val3); //set WSCstring value.
WSCvariant val4 = 1;
object->setProperty(WSNlabelString,val4); //set WSCvariant value.
}
getProperty method
- Form
- WSCvariant getProperty(char* pname)
- Function
- Returns the value of the specified property
- Description
- Seeks for the specified property,
then returns the value of it.
- Parameters
-
(in)char* pname | the property name |
- Return value
- Returns the value by WSCvariant type.
- Notice
-
- Samples
-
void sample_proc(WSCbase* object){
long val1 = object->getProperty(WSNlabelString); //get the value by long.
printf("val1=%d\n",val1);
//get value by string.
WSCstring val2 = object->getProperty(WSNlabelString); //get the value by WSCstring.
printf("val2=%s\n",(char*)val2);
//Error! val2 becomes junc pointer!!!
// char* val2 = object->getProperty(WSNlabelString);
}
setVisible method
- Form
- void setVisible(WSCbool fl)
- Function
- Specifies the status of visibility.
- Description
-
- Parameters
-
(in)WSCbool fl | visibility True = visible, False = invisible |
- Return value
- None.
- Notice
- This state is equal to the WSNvis property.
- Samples
-
void sample_proc(WSCbase* object){
if ( object->getVisible() == False){
object->setVisible(True);
}else{
object->setVisible(False);
}
}
getVisible method
- Form
- WSCbool getVisible()
- Function
- Returns the status of visibility.
- Description
- Returns the status of visibility including the parent instance.
- Parameters
- None.
- Return value
- Returns the current visibility.
- Notice
- The return value is not always equal to the WSNvis property
because it includes the status of the parent instance.
It returns False if the parent instance is invisible
and the instance is visible.
- Samples
- Refer to setVisible()
setSensitive method
- Form
- void setSensitive(WSCbool fl)
- Function
- Specifies the state of sensitivity.
- Description
-
- Parameters
-
(in)WSCbool fl | True = sensitive, False = insensitive |
- Return value
- None.
- Notice
- if the parent instance is insensitive
and the instance is sensitive, it becomes insensitive.
- Samples
-
void sample_proc(WSCbase* object){
if ( object->getSensitive() == False){
object->setSensitive(True);
}else{
object->setSensitive(False);
}
}
getVisible method
- Form
- WSCbool getVisible()
- Function
- Returns the sensitivity
- Description
- Returns the sensitivity including the parent instance.
- Parameters
- None.
- Return value
- Returns the current sensitivity.
- Notice
- The return value is not always equal with the WSNdet property
because it includes the status of the parent instance.
It returns False if the parent instance is insensitive
and the instance is sensitive.
- Samples
- Refer to setSensitive().
draw method
- Form
- long draw()
- Function
- Draws the instance.
- Description
-
- Parameters
- None.
- Return value
- Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
- Notice
- It does not draw if the instance is drawn once, so
if you want to draw it forcibly, execute the method:
setAbsoluteDraw(True).
- Samples
-
void sample_proc(WSCbase* object){
//draw only if needed.
object->draw();
//draw forcely.
object->setAbsoluteDraw(True);
object->draw();
//draw with created expose event.
object->redraw();
}
redraw method
- Form
- long redraw()
- Function
- Clears and draws the instance.
- Description
-
- Parameters
- None.
- Return value
- Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
- Samples
- Refer to draw().
- Notice
-
update method
- Form
- long update()
- Function
- If needed, clears and draws the instance.
- Description
- A change of properties causes the necessity of updating.
- Parameters
- None.
- Return value
- Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
- Samples
-
void sample_proc(WSCbase* object){
//execute updating the instance only when if it is needed.
object->update();
}
- Notice
-
getChildren method
- Form
- WSClistData & getChildren()
- Function
- Returns a list of child instances.
It functions as a method of the classes
which has the ability to manage child instances.
- Description
-
- Parameters
- None.
- Return value
- Returns the list of child instances.
- Notice
- Accessing of child instances is as follows.
The "parent" is a management class like the WSCform,WSCwindow
class which has child instances.
- Samples
-
WSClistData children = parent->getChildren();
int num = children.getNum();
for(int i=0; i < num; i++){
WSCbase* child = (WSCbase*)children[i];
//do someting to child instance...
}
execProcedure method
- Form
- void execProcedure(long trigger)
- Function
- Executes the event procedures by a specified trigger.
- Description
-
- Parameters
-
(in)long trigger | the trigger |
- Return value
- None.
- Notice
- This method does nothing if there are no event procedures.
- Samples
-
void sample_proc(WSCbase* object){
object->execProcedure(WSEV_ACTIVATE);
}
execProcedure method
- Form
- void execProcedure(char* pname)
- Function
- Executes the event procedures by a specified procedure name.
- Description
-
- Parameters
-
(in)char* pname | Event procedure name |
- Return value
- None.
- Notice
- This method does nothing if there are no event procedures.
- Samples
-
void sample_proc(WSCbase* object){
object->execProcedure("event procedure name");
}
setFocus method
- Form
- long setFocus(WSCbool fl = True)
- Function
- Changes the state of the keyboard focus.
- Description
-
- Parameters
-
(in)WSCbool fl | True = focused, False = lost focus |
- Return value
- Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
- Notice
- By changing the state,it executes the event method:
onFocusChange().
- Samples
-
void sample_proc(WSCbase* object){
//set focus.
object->setFocus();
//set focus.
object->setFocus(True);
//unset focus.
object->setFocus(False);
}
getFocus method
- Form
- WSCbool getFocus()
- Function
- Returns the state of the keyboard focus.
- Description
-
- Parameters
- None.
- Return value
- Returns True if it is focused; returns False if not.
- Notice
-
- Samples
-
void sample_proc(WSCbase* object){
WSCbool fl = object->getFocus();
if (fl == False){
//not focused..
}else{
//focused..
}
}
setSpecialFocus method
- Form
- long setSpecialFocus(WSCbool fl = True)
- Function
- Changes the state of the keyboard special focus.
- Description
-
- Parameters
-
(in)WSCbool fl | True = focused, False = lost focus |
- Return value
- Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
- Notice
- It executes the event method by changing the state:
onSpecialFocusChange().
- Samples
-
void sample_proc(WSCbase* object){
//set focus.
object->setSpecialFocus();
//set focus.
object->setSpecialFocus(True);
//unset focus.
object->setSpecialFocus(False);
}
getSpecialFocus method
- Form
- WSCbool getSpecialFocus()
- Function
- Returns the state of the keyboard special focus.
- Description
-
- Parameters
- None.
- Return value
- Returns True if it is focused; returns False if not.
- Notice
-
- Samples
-
void sample_proc(WSCbase* object){
WSCbool fl = object->getSpecialFocus();
if (fl == False){
//not focused..
}else{
//focused..
}
}
getAllChildren method
- Form
- long getAllChildren(WSClistData &list)
- Function
- Returns all children.
- Description
- getChildren() returns the children of the instance, but
getAllChildren() returns all of the children of the instance and its children,
recursively.
- Parameters
-
(out)WSClistData & list | the list which contains the return value. |
- Return value
- Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
- Notice
-
- Samples
-
void sample_proc(WSCbase* object){
WSClistData children;
object->getAllChildren(children);
int i;
long num = children.getNum();
for(i=0; i< num; i++){
WSCbase* child = (WSCbase*)children[i];
//access child instances..
}
}
getParentWindow method
- Form
- WSCbase* getParentWindow()
- Function
- Returns the parent application window of the instance.
- Description
- Follows the parents and finds the top parent instance.
Then it returns that instance.
- Parameters
- None.
- Return value
- Returns the application window.
- Notice
- Returns the instance
if the instance is the application window.
- Samples
-
void sample_proc(WSCbase* object){
WSCbase* parent_window = object->getParentWindow();
}
getParent method
- Form
- WSCbase* getParent()
- Function
- Returns the parent instance.
- Description
-
- Parameters
- None.
- Return value
- The parent instance.
- Notice
-
- Samples
-
void sample_proc(WSCbase* object){
WSCbase* parent = object->getParent();
}
onMouseIn method
- Form
- virtual void onMouseIn(WSCpoint* pt)
- Function
- It executes this method when the mouse pointer moves into the area of
the instance.
- Description
- Instead of the event procedure by the WSEV_MOUSE_IN trigger,
the WSEV_MOUSE_IN event can be handled
by overloading of this method.
- Parameters
-
(out)WSCpoint* pt | the coordinate of the mouse pointer |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onMouseIn(WSCpoint* pt){
short x = pt->x; //X
short y = pt->y; //Y
//This event method is called when the mouse pointer moves into this area.
//call the method of the parent class.
old_class::onMouseIn(pt);
}
onMouseOut method
- Form
- virtual void onMouseOut()
- Function
- It executes this method when the mouse pointer leaves the area of
the instance.
- Description
- Instead of the event procedure by the WSEV_MOUSE_OUT trigger,
the WSEV_MOUSE_OUT event can be handled
by overloading of this method.
- Parameters
- None.
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onMouseOut(){
//This event method is called when the mouse pointer moves out of this area.
//call the method of the parent class.
old_class::onMouseOut();
}
onMouseMove method
- Form
- virtual void onMouseMove(WSCpoint* pt)
- Function
- It executes this method when the mouse pointer moves in the area of
the instance.
- Description
- Instead of the event procedure by the WSEV_MOUSE_MOVE trigger,
the WSEV_MOUSE_MOVE event can be handled
by overloading of this method.
- Parameters
-
(out)WSCpoint* pt | the coordinate of the mouse pointer |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onMouseMove(WSCpoint* pt){
short x = pt->x; //X
short y = pt->y; //Y
//This event method is called when the mouse pointer moves over this area.
//call the method of the parent class.
old_class::onMouseMove(pt);
}
onMousePress method
- Form
- virtual void onMousePress(WSCpoint* pt)
- Function
- It executes this method when the mouse pointer is pressed in the area of
the instance.
- Description
- Instead of the event procedure by the WSEV_MOUSE_PRESS trigger,
the WSEV_MOUSE_PRESS event can be handled
by overloading of this method.
- Parameters
-
(out)WSCpoint* pt | the coordinate of the mouse pointer |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
#include <WSDmouse.h>
void new_class::onMousePress(WSCpoint* pt){
short x = pt->x; //X
short y = pt->y; //Y
//get pressed button.
long status = WSGIappMouse()->getMouseStatus();
if (status & WS_MOUSE_BTN1){
//Left button is pressed.
}
if (status & WS_MOUSE_BTN2){
//Middle button is pressed.
}
if (status & WS_MOUSE_BTN3){
//Right button is pressed.
}
//call the method of the parent class.
old_class::onMousePress(pt);
}
onMouseRelease method
- Form
- virtual void onMouseRelease(WSCpoint* pt)
- Function
- It executes this method when the mouse pointer is released in the area of
the instance.
- Description
- Instead of the event procedure
by the WSEV_MOUSE_RELEASE trigger,
the WSEV_MOUSE_RELEASE event can be handled
by overloading of this method.
- Parameters
-
(out)WSCpoint* pt | the coordinate of the mouse pointer |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
#include <WSDmouse.h>
void new_class::onMouseRelease(WSCpoint* pt){
short x = pt->x; //X
short y = pt->y; //Y
//do something for WSEV_MOUSE_RELEASE event.
//call the method of the parent class.
old_class::onMouseRelease(pt);
}
onExpose method
- Form
- virtual void onExpose(WSCrect* rect)
- Function
- It executes this method when the instance is exposed.
- Description
- Instead of the event procedure
by the WSEV_EXPOSE trigger,
the WSEV_EXPOSE event can be handled
by overloading of this method.
- Parameters
-
(out)WSCrect* rect | the coordinate of the exposed area |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onExpose(WSCrect* rect){
//do something for EXPOSE event.
//call the method of the parent class.
old_class::onExpose(rect);
}
onResize method
- Form
- virtual void onResize(WSCrect* rect)
- Function
- It executes this method when the instance is resized.
- Description
- Instead of the event procedure
by the WSEV_RESIZE trigger,
the WSEV_RESIZE event can be handled
by overloading of this method.
- Parameters
-
(out)WSCrect* rect | the coordinate, width, and height of the instance |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onResize(){
//do something for RESIZE event.
//call the method of the parent class.
old_class::onResize();
}
onVisibleChange method
- Form
- virtual void onVisibleChange(WSCbool vis)
- Function
- It executes this method
when the state of visibility is changed.
- Description
- Instead of the event procedure
by the WSEV_VISIBLE_CH trigger,
the WSEV_VISIBLE_CH event can be handled
by overloading of this method.
- Parameters
-
(out)WSCbool vis | the new state of the visibility |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onVisibleChange(WSCbool vis){
//do something for VISIBLE_CH event.
if (vis == False){
//not visible
}else{
//visible
}
//call the method of the parent class.
old_class::onVisibleChange();
}
onParentVisibleChange method
- Form
- virtual void onParentVisibleChange(WSCbool vis)
- Function
- It executes this method
when the state of the parent's visibility is changed.
- Description
- Instead of the event procedure
by the WSEV_PARENT_VISIBLE_CH trigger,
the WSEV_PARENT_VISIBLE_CH event can be handled
by overloading of this method.
- Parameters
-
(out)WSCbool vis | the new state of the parent's visibility |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onParentVisibleChange(WSCbool vis){
//do something for PARENT_VISIBLE_CH event.
if (vis == False){
//not visible
}else{
//visible
}
//call the method of the parent class.
old_class::onParentVisibleChange(vis);
}
onSensitiveChange method
- Form
- virtual void onSensitiveChange(WSCbool det)
- Function
- It executes this method
when the state of the sensitivity is changed.
- Description
- Instead of the event procedure
by the WSEV_SENSITIVE_CH trigger,
the WSEV_SENSITIVE_CH event can be handled
by overloading of this method.
- Parameters
-
(out)WSCbool det | the new state of the sensitivity |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onSensitiveChange(WSCbool vis){
//do something for SENSITIVE_CH event.
if (vis == False){
//not sensitive.
}else{
//sensitive.
}
//call the method of the parent class.
old_class::onSensitiveChange(vis);
}
onParentSensitiveChange method
- Form
- virtual void onParentSensitiveChange(WSCbool det)
- Function
- It executes this method
when the state of the parent's sensitivity is changed.
- Description
- Instead of the event procedure
by the WSEV_PARENT_SENSITIVE_CH trigger,
the WSEV_PARENT_SENSITIVE_CH event can be handled
by overloading of this method.
- Parameters
-
(out)WSCbool det | the state of the parent's sensitivity |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onParentSensitiveChange(WSCbool vis){
//do something for PARENT_SENSITIVE_CH event.
if (vis == False){
//not sensitive.
}else{
//sensitive.
}
//call the method of the parent class.
old_class::onParentSensitiveChange(vis);
}
onChildAdded method
- Form
- virtual void onChildAdded(WSCbase* child)
- Function
- It executes this method
when the child is added to the instance.
- Description
- the added child instance event can be handled
by overloading of this method.
- Parameters
-
(out)WSCbase* child | the added child instance |
- Return value
- None.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onChildAdded(WSCbase* child){
//This event method is called when a child instance is added.
//call the method of the parent class.
old_class::onChildAdded(child);
}
Description of setData
- Form
- virtual void setData(WSCvariant* data,long encoding = WS_EN_DEFAULT)
- Function
- Function to set data source in an instance that supports data source.
Data should be specified in variant type (WSCvariant) in property.
If the data is string type, encoding attribute can be specified.
If no encoding type is specified, WS_EN_DEFAULT is used.
- Description
-
- Parameters
-
(in)WSCvariant* data | Data to set in an instance |
(in)long encoding | Encoding type for string type data |
The following encoding can be specified. The default is WS_EN_DEFAULT
Value | Description |
WS_EN_DEFAULT | Use Current setting |
WS_EN_LOCALE | Use current LANG environment variable value |
WS_EN_NONE | Do not set encoding type |
WS_EN_ISO8859_1 | Use ISO8859(1) |
WS_EN_ISO8859_2 | Specify ISO8859(2) |
WS_EN_ISO8859_3 | Specify ISO8859(3) |
WS_EN_ISO8859_4 | Specify ISO8859(4) |
WS_EN_ISO8859_5 | Specify ISO8859(5) |
WS_EN_ISO8859_6 | Specify ISO8859(6) |
WS_EN_ISO8859_7 | Specify ISO8859(7) |
WS_EN_ISO8859_8 | Specify ISO8859(8) |
WS_EN_ISO8859_9 | Specify ISO8859(9) |
WS_EN_ISO8859_10 | Specify ISO8859(10) |
WS_EN_ISO8859_11 | Specify ISO8859(11) |
WS_EN_ISO8859_12 | Specify ISO8859(12) |
WS_EN_ISO8859_13 | Specify ISO8859(13) |
WS_EN_ISO8859_14 | Specify ISO8859(14) |
WS_EN_ISO8859_15 | Specify ISO8859(15) |
WS_EN_UTF8 | UTF8 |
WS_EN_KOI8R | KOI8R |
WS_EN_EUCJP | EUCJP |
WS_EN_SJIS | SJIS |
WS_EN_EUCKR | EUCKR |
WS_EN_EUCCN | EUCCN |
WS_EN_BIG5 | BIG5 |
- Return value
- None.
- Notice
-
- Samples
-
void sample_proc(WSCbase* object){
WSCvariant value;
value = ... // Set a value you want.
//The default encoding will be used
object->setData(value);
//Use given encoding type
object->setData(value,WS_EN_SJIS);
}
Description of setVariantData
- Form
- void setVariantData(char* vname,WSCvariant)
- Function
- Function to assign a name to a value for preserving in an instance.
The value can be preserved by naming uniquely into an instance internally.
Preserving values can be retreived by using getVariantData with
specified name. This function is useful for keeping session information
or sharing data among event procedures.
- Description
-
- Parameters
-
(in)char* vname | Value name |
(in)WSCvariant | Value |
- Return value
- None.
- Notice
- Data is kept in WSCvariant type, any type of data can be
specified. Note that realm of pointers other than char*
is not prepared.
- Samples
-
void sample_proc(WSCbase* object){
//Preserve long type value as data1
long val =1;
object->setVariantData("data1",val);
//Preserve char* type value as data2
char* str = "test";
object->setVariantData("data2",str);
}
void sample_proc2(WSCbase* object){
//Get a value named data1
long val = object->getVariantData("data1");
//Get a value named data2, in which WSCstring can be used.
WSCstring str;
str = object->getVariantData("data2");
}
Description of getVariantData
- Form
- WSCvariant &setVariantData(char* vname)
- Function
- Function to get a value preserved by setVariantData
- Description
-
- Parameters
-
(in)char* vname | Name to retrieve |
- Return value
- WSCvariant&
- Notice
- Retrieved data type come from WSCvariant type ans any type
can be casted to. Note that since realm of a pointer other than char*
is not allocated, please use WSCstring or cast to (char*) after getting
a data in WSCvariant type in using char* type data.
- Samples
- Please refer to setVariantData().
Description of onFocusChange
- Form
- void onFocusChange(WSCbool fl)
- Function
- This function is invoked when a focus on an instance is changed.
Focusing-related event processes can be done by overriding
this function in stead of using an event procedure triggered by
WSEV_FOCUS_CH in derived classes.
- Description
-
- Parameters
-
(in)WSCbool fl | New focus status |
- Return value
- None.
- Notice
- Use with overriding this.
- Samples
-
void new_class::onFocusChange(WSCbool fl){
//Write codes to be processed when focus is changed
if (fl == False){
//Lost focus
}else{
//Got focus
}
//inherit process to the derivation class
old_class::onFocusChange(fl);
}
Description of onSpecialFocusChange
- Form
- void onSpecialFocusChange(WSCbool fl)
- Function
- This function is invoked when Return Key-Special Focus is changed.
Return Key-Special Focus related event process can be done by
overriding this function in a derived class.
- Description
-
- Parameters
-
(in)WSCbool fl | 新たなフォーカスの状態 |
- Return value
- None.
- Notice
- Use with overriding this.
- Samples
-
void new_class::onSpecialFocusChange(WSCbool fl){
//Write codes to be processed when Return Key-Special Focus is changed.
if (fl == False){
//Lost focus.
}else{
//Got focus.
}
//Inherit process to the derivation class.
old_class::onSpecialFocusChange(fl);
}
Description of onSelectionChange
- Form
- void onSelectionChange(WSCbool fl)
- Function
- This function is invoked when selected data status is changed.
Selection-related event process can be done by overriding this
function in a derived class
Selection is data that is selected by mouse and can be pasted or
copied.
False means losing selection and True means acquiring selection.
- Description
-
- Parameters
-
(in)WSCbool fl | Selection status |
- Return value
- None.
- Notice
- Use with overriding this.
- Samples
-
void new_class::onSelectionChagen(WSCbool fl){
//Write a code to be processed when changing selection status.
if (fl == False){
//Lost selection
}else{
//Got selection
}
//Inherit process to the derivation class.
old_class::onSelectionChange(fl);
}
Description of setInternalObject
- Form
- void setInternalObject(WSCbool fl)
- Function
- Function to set internal instance attribute flag.
- Description
- If True is set to the internal instance attribute flag,
win file output or editing on Application Builder is disabled.
- Parameters
-
(in)WSCbool fl | Internal Instance Flag |
- Return value
- None.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
WSCbase* inst = new WSCdialog(object,"newwin000");
inst->initialize();
inst->setInternalObject(True);
inst->setProperty(WSNname,"newwin000");
inst->setProperty(WSNtitleString,"title1");
inst->setProperty(WSNvis,(WSCbool)1);
return inst;
}
Description of getInternalObject
- Form
- WSCbool getInternalObject()
- Function
- Function to get the internal instance attribute.
- Description
- Returns flag status of internal instance attribute flag.
- Parameters
- None.
- Return value
- Internal instance attribute
- Notice
-
- Samples
-
void sample_proc(WSCbase* object){
WSClistData children = object->getChildren();
long i;
long num = children.getNum();
for(i=0; i< num; i++){
WSCbase* child = (WSCbase*)children[i];
WSCbool fl = inst->getInternalObject();
if (fl != False){
//This is the Internal instance.
}else{
//This is an ordinal instance.
}
}
}
Description of setScaleOffsetPtr
- Form
- void setScaleOffsetPtr(double* ptr)
- Function
- Function to set a pointer of a variable that has display magnification ratio.
If magnification ratio is set, the instance appears in that ratio in drawing.
Note that ratio is not specified directory.
Please specify NULL if you want to remove pointer setting.
- Description
- Specifying the same pointer to more than one instance and set a value
the the pointer results in affecting more than one instance's ratio at
the same time.
- Parameters
-
(in)double* ptr | Pointer that has ratio |
- Return value
- None.
- Notice
- Specify NULL for removing pointer setting
- Samples
-
double scale;
void sample_proc(WSCbase* object){
//Specify an offset in initialization procedure etc.
object->setScaleOffsetPtr(&scale);
}
Description of setXOffsetPtr
- Form
- void setXOffset(short* ptr)
- Function
- Function to set a pointer to a variable that has offset of displaying location
(X coordinate) If offset for displaying location(X coordinate) is set,
an instance is drown on the coordinate with adding the offset.
Please specify NULL when removing the offset value.
- Description
- Specifying the same pointer to more than one instances and changing the
value results in changing more than one instance's displaying location
at the same time.
- Parameters
-
(in)short* ptr | Pointer to the variable that has offset value. |
- Return value
- None.
- Notice
- Specify NULL for removing pointer setting
- Samples
-
short offsetx;
void sample_proc(WSCbase* object){
//Set offset value in initialization procedure etc.
object->setXOffsetPtr(&offsetx);
}
Description of setYOffsetPtr
- Form
- void setYOffset(short* ptr)
- Function
- Function to set a pointer to a variable that has offset of displaying location
(Y coordinate) If offset for displaying location(Y coordinate) is set,
an instance is drown on the coordinate with adding the offset.
Please specify NULL when removing the offset value.
- Description
- Specifying the same pointer to more than one instances and changing the
value results in changing more than one instance's displaying location
at the same time.
- Parameters
-
(in)short* ptr | Pointer to the variable that has offset value. |
- Return value
- None.
- Notice
- Specify NULL for removing pointer setting
- Samples
-
short offsety;
void sample_proc(WSCbase* object){
//Set offset value in initialization procedure etc.
object->setXOffsetPtr(&offsety);
}
Description of getScaleOffsetPtr
- Form
- double* getScaleOffset()
- Function
- Function to get a pointer that points to a variable of displaying magnification
ratio.
NULL is returned when nothing is specified.
- Description
-
- Parameters
- None.
- Return value
- Pointer to variables that stores magnification
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Get an offset in initialization procedure etc.
double* ptr = object->getScaleOffsetPtr();
}
Description of getXOffsetPtr
- Form
- short* getXOffset()
- Function
- Function to get a pointer that points to a variable of offset of displaying location
(X coordinate)
NULL is returned when nothing is specified.
- Description
-
- Parameters
- None.
- Return value
- Pointer to a variable of offset of displaying location (X coordinate)
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Get an offset in initialization procedure etc.
short* ptr = object->getXOffsetPtr();
}
Description of getYOffsetPtr
- Form
- short* getYOffset()
- Function
- Function to get a pointer that points to a variable of offset of displaying location
(Y coordinate)
NULL is returned when nothing is specified.
- Description
-
- Parameters
- None.
- Return value
- Pointer to a variable of offset of displaying location (Y coordinate)
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Get an offset in initialization procedure etc.
short* ptr = object->getYOffsetPtr();
}
Description of isDefaultValue
- Form
- long isDefaultValue(char* pname,WSCbool* fl)
- Function
- Function to test whether property is a default value.
If specifying property exists, whether the value of the property
is the default or not is set to the second argument.
If the property does not exist, WS_ERR is returned.
- Description
- Return with fl indicating whether the property is default or not.
- Parameters
-
(in)char* pname | Property Name |
(out)WSCbool* fl | Pointer to get result |
- Return value
- Returns WS_NO_ERR for success, other for error.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Test whether WSNlabelString property is default or not.
WSCbool fl;
long ret = object->isDefaultValue(WSNlabelString,&fl);
}
Description of setDefaultValue
- Form
- long setDefaultValue(char* pname)
- Function
- Function to set the default value to the specified property.
This function set the default value defined by WideStudio to the property.
- Description
-
- Parameters
-
(in)char* pname | Property Name |
- Return value
- Returns WS_NO_ERR for success, other for error.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Set the default value to WSNlabelString property.
object->setDefaultValue(WSNlabelString);
}
Description of existProperty
- Form
- WSCbool existProperty(char* pname)
- Function
- Test whether specified property has the default value or not.
- Description
-
- Parameters
-
(in)char* pname | Property Name |
- Return value
- Returns True for exist, False for not exist.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Test WSNlabelString property whether this has the default value or not.
WSCbool exist = object->existProperty(WSNlabelString);
if (exist != False){
//Exists.
}else{
//Do not exist.
}
}
Description of getChildInstance
- Form
- WSCbase* getChildInstance(char* iname)
- Function
- Function to get a pointer to given child instance.
- Description
-
- Parameters
-
(in)char* iname | Child Instance Name |
- Return value
- Child instance.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Get the child instance of newvlab_001.
WSCbase* child = object->getChildInstance("newvlab_001");
if (child != NULL){
//Successfully acquired.
}
}
Description of getFocusMoveInstance
- Form
- WSCbase* getFocusMoveInstance(long direction)
- Function
- Function to get an instance in the specified focus direction.
An argument is one of WS_UP, WS_DOWN, WS_RIGHT, WS_LEFT, WS_RET and
means up, down, left, right, and focus direction when Enter key is invoked,
respectively.
- Description
-
- Parameters
-
(in)long direction | Direction |
Direction can be the following.
Value | Description |
WS_UP | Up direction |
WS_DOWN | Down direction |
WS_RIGHT | Left direction |
WS_LEFT | Right direction |
WS_RET | Direction decided in invoking return key |
- Return value
- Instance that a focus moves on.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Get an instance placed in the left direction that focus can move to.
WSCbase* inst = object->getFocusMoveInstance(WS_RIGHT);
if (inst != NULL){
//Successfully acquired.
}
}
Description of needUpdate
- Form
- void needUpdate()
- Function
- Function to redraw in exitting an event procedure by setting
an update flag.
Actual redrawing is done by update function or exeUpdate of
WSGIappObjectList.
- Description
-
- Parameters
- None.
- Return value
- None.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Make update() be executed in exiting the procedure by setting update flag.
object->needUpdate();
}
Description of isNeedUpdate
- Form
- WSCbool isNeedUpdate()
- Function
- Function to get update flag status.
The True return value means that property has been changed
or needUpdate has been invoked and the instance is to be redrawn.
- Description
- The update flag is set to True if property is changed or needUpdate()
is executed.
- Parameters
- None.
- Return value
- Returns True for being updated, False for not being updated.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Test whether update flag is true or not.
WSCbool* fl = object->isNeedUpdate();
if (fl == False){
//Update flag is false.
}else{
//Update flag is true.
}
}
Description of isParent
- Form
- WSCbool isParent(WSCbase* instance)
- Function
- Test whether the specified instance is own parent or not.
- Description
-
- Parameters
-
(in)WSCbase* instance | instance |
- Return value
- True if it is the parent instance, False if it is not the parent instance.
- Notice
- None.
- Samples
-
extern WSCmainWindow* newwin000;
void sample_proc(WSCbase* object){
//Test whether window, newwin000 is parent or not.
WSCbool fl = object->isParent(newwin000);
if (fl == False){
//This is the parent instance.
}else{
//This is not the parent instnace.
}
}
Description of existTrigger
- Form
- WSCbool existTrigger(long trigger)
- Function
- Function to test whether specified trigger can be handled by the instance or not.
- Description
-
- Parameters
-
- Return value
- True, if it can be handled. False, if it cannot be handled.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Test whether a trigger can be handled or not.
WSCbool fl = object->existTrigger(WSEV_ACTIVATE);
if (fl != False){
//Can be handled.
}
}
Description of getMouseAddr
- Form
- WSCbool getMouseAddr(short* x,short* y)
- Function
- Function to get coordinate of the mouse pointer in the instance's coordinate system.
- Description
-
- Parameters
-
(out)short* x | Pointer to save X coordinate |
(out)short* y | Pointer to save Y coordinate |
- Return value
- True, it it can be retrieved. False, if it cannot be retrieved.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
short px,py;
object->getMouseAddr(&x,&y);
}
Description of addProcedure
- Form
- long addProcedure(WSCprocedure* ep)
- Function
- Function to add an event procedure to an instance.
The event procedure added by this function can be invoked
by execProcedure function as well as raising the event.
- Description
-
- Parameters
-
(in)WSCprocedure* ep | Event procedure instance |
- Return value
- Returns WS_NO_ERR for success, other for error.
- Notice
- WSCprocedure instance will removed in removing the instance.
Please make sure not to addProcedure the same WSCprocedure instance to
more than one different instances.
- Samples
-
//Function for event procedure to newly add.
void procedure1(WSCbase*){
//Process
}
//Event procedure body
void sample_proc(WSCbase* object){
//Add procedure1 function with the name, procedure1,
//and WSEV_ACTIVATE trigger.
//When WSEV_ACTIVATE event occurs, procedure1 will be executed.
WSCprocedure* ep = new WSCprocedure("procedure1",WSEV_ACTIVATE);
ep->setFunction(procedure1,"procedure1");
object->addProcedure(ep);
}
Description of delProcedure
- Form
- long delProcedure(WSCprocedure* ep)
- Function
- Function to release the registered event procedure from the instance.
After executing this function, released event procedure is disabled.
- Description
- Release an event procedure registered by addProcedure()
- Parameters
-
(in)WSCprocedure* ep | Event procedure instance |
- Return value
- Returns WS_NO_ERR for success, other for error.
- Notice
- None.
- Samples
-
void sample_proc(WSCbase* object){
//Remove the registered event procedure
WSClistData procedures = object->getProcedures();
long i;
long num = procedures.getNum();
for(i=0; i<num; i++){
WSCprocedure* ep = (WSCprocedure*)procedures[i];
object->delProcedures(ep);
delete ep;
}
}
Description of getdev
- Form
- WSDdev* getdev()
- Function
- Function to get device class instance used in the instance.
Device class instances are used to handle events or draw instances.
If there is an instance that has not been drew after the creation,
the return value comes out NULL.
- Description
-
- Parameters
- None.
- Return value
- Device class instance.
- Notice
- If there is an instance that has not been drew after the creation,
the return value comes out NULL.
- Samples
- Please refer to WSDdev Class sample.
Description of getPropertyInheritChild
- Form
- WSCbase* getPropertyInheritChild()
- Function
- This function is used to merge a child instance property to
parent instance in creating a class window by derivation
from application window or complex derivation.
In a time that a new class window is created, only the properties
from derivation instance can be available but if a child instance
is created by overriding this method, both the derivation instance's
properties and the child instance's properties are become available.
- Description
- In derivation class, overriding this function to return a member
instance that is to merge its properties enables to add
its member instance's properties to the class body.
- Parameters
- None.
- Return value
- Member instance of derivation class
- Notice
-
- Samples
-
WSCbase* new_class::getPropertyInheritChild(){
//If you want to disclose member instance's properties as the
//class body properties, please override this function to get its instance.
return member1;
}
Document Release 3.90 For use with WideStudio/MWT Release 3.90, Summer 2005 WideStudio/MWT Home | Up to Copyright(C) WideStudio/MWT Development Team, 1999-2005 | | Last modified: June 25, 2005 | |