Wide Studio Object Reference

Wide Studio Home
Up to


Class Name

WSCtreeList

Methods

  • void setLabelHeight(WSCshort h)   :WSClist
  • void delAll()   :WSClist
  • WSCbase* getLabel(long pos)   :WSClist
  • long getNum()   :WSClist
  • WSCstring getItem(long pos)   :WSClist
  • void addItem(char* item,long pos =-1)   :WSClist
  • void replaceItem(char* item,long pos)   :WSClist
  • void delPos(long pos)   :WSClist
  • long getSelectedPos()   :WSClist
  • long setSelectPos()   :WSClist
  • char* getSelectedItem()   :WSClist
  • void setTopPos(long pos)   :WSClist
  • void setBottomPos(long pos)   :WSClist
  • void updateList()   :WSClist
  • void setLabelClass(char*)   :WSClist
  • WSCbool getSelectItemChanged()   :WSClist
  • void setSelectItemChanged(WSCbool)   :WSClist
  • WSClistData* getLabels()   :WSClist
  • void getSelectedLabels(WSClistData&)   :WSClist
  • long setItemVisible(long pos,WSCbool fl)   :WSClist
  • void setEnableActivate(WSCbool)   :WSClist
  • WSCbool getEnableActivate()   :WSClist
  • void setAbsoluteChangeSelectFlag(WSCbool)   :WSClist
  • WSCbool getAbsoluteChangeSelectFlag()   :WSClist
  • long setItemValue(long pos,long kind,long val)   :WSClist
  • void getSortPos()   :WSClist
  • long getVisibleWidth()   :WSCscrForm
  • long getVisibleHeight()   :WSCscrForm
  • WSCbase* getScrFrame()   :WSCscrForm
  • long initialize()   :WSCbase
  • WSCbool getInitialized()   :WSCbase
  • char* getInstanceName()   :WSCbase
  • char* getClassName()   :WSCbase
  • void* cast(char*)   :WSCbase
  • void setInstanceName(char*)   :WSCbase
  • WSCbool setProperty(char*,const WSCvariant &)   :WSCbase
  • WSCvariant getProperty(char*)   :WSCbase
  • void setVisible(WSCbool)   :WSCbase
  • WSCbool getVisible()   :WSCbase
  • void setSensitive(WSCbool)   :WSCbase
  • WSCbool getSensitive()   :WSCbase
  • long draw()   :WSCbase
  • long redraw()   :WSCbase
  • long update()   :WSCbase
  • WSClistData & getChildren()   :WSCbase
  • long getAllChildren(WSClistData &)   :WSCbase
  • void execProcedure(long trigger)   :WSCbase
  • void execProcedure(char* procedure_name)   :WSCbase
  • long setFocus(WSCbool fl = True)   :WSCbase
  • WSCbool getFocus()   :WSCbase
  • virutal void onMouseIn(WSCpoint*)   :WSCbase
  • virutal void onMouseOut()   :WSCbase
  • virutal void onMouseMove(WSCpoint*)   :WSCbase
  • virutal void onMousePress(WSCpoint*)   :WSCbase
  • virutal void onMouseRelease(WSCpoint*)   :WSCbase
  • virutal void onExpose(WSCrect*)   :WSCbase
  • virutal void onResize(WSCrect*)   :WSCbase
  • virutal void onVisibleChange(WSCbool)   :WSCbase
  • virutal void onParentVisibleChange(WSCbool)   :WSCbase
  • virutal void onSensitiveChange(WSCbool)   :WSCbase
  • virutal void onParentSensitiveChange(WSCbool)   :WSCbase
  • virutal void onChildAdded(WSCbase*)   :WSCbase


Specification of methods



setLabelHeight method

Form
void setLabelHeight(WSCushort* height)
Function
Specify the item height.
Description
Parameters
(in)WSCushort height the item height
Return value
Nothing.
Notice
Call updateList() method to redraw after this.



delAll method

Form
void delAll()
Function
Deletes all the items.
Description
Parameters
Nothing.
Return value
Nothing.
Notice
Call updateList() method to redraw after setting the item.



getLabel method

Form
WSCbase* getLabel(long pos)
Function
Returns the internal instance which displays the item string in the list.
Description
You can arrange a display state of items by the instance.
Parameters
(in)long pos the poition of the item(Top= 0,,N-1)
Return value
Returns the internal instance.
Notice
The valid value of position is between top:0 and bottom:N-1 (If the number of items is N). If -1 is specified,it means the bottom item.



getNum method

Form
void getNum()
Function
Returns the number of items.
Description
Parameters
Nothing.
Return value
Nothing.
Notice
Nothing.



getItem method

Form
WSCstring getItem(long pos)
Function
Returns the string of the specified position.
Description
Parameters
(in)long pos the position (top:0,..,N-1 or -1:bottom)
Return value
Returns the string as WSCstring instance.
Notice
Do not receive the return value by a char* pointer, because it becomes a junc pointer by internal freeing. It requires to receive it by the WSCstring variable.



addItem method

Form
void addItem(char* item,long pos = -1)
Function
Inserts the item into the specified position.
Description
Parameters
(in)char* the string
(in)long pos the position(top:0,..,N-1 or -1:bottom)
Return value
Nothing.
Notice
If the specified position is -1 or none, It means bottom. Please call updateList() method to redraw after setting the item.



replaceItem method

Form
void replaceItem(char* item,long pos)
Function
Replaces the item of the specified position.
Description
You can pass the position between top:0 and bottom: N-1, (N: the number of items). it means the bottom: N-1 item that the position is -1.
Parameters
(in)char* the string
(in)long pos the position(top:0,..,N-1 or -1:bottom)
Return value
Nothing.
Notice
Please call updateList() method to redraw after replacing the item.



delPos method

Form
void delPos(long pos);
Function
Deletes the item of the specified position.
Description
You can specify the position between top:0 and bottom: N-1, (N: the number of items). it means the bottom: N-1 item that the position is -1.
Parameters
(in)long pos the position(top:0,..,N-1 or -1:bottom)
Return value
Nothing.
Notice
Please call updateList() method to redraw after deleting the item.



getSelectedPos method

Form
long getSelectedPos();
Function
Returns the position of the selected item.
Description
Returns the position of the item which is selected by the mouse pointer.
Parameters
Nothing.
Return value
Returns the position between top:0 and bottom:N-1.
Notice



setSelectPos method

Form
void setSelectPos(long pos);
Function
Makes the item of the specified position selected.
Description
You can specify the position between top:0 and bottom: N-1, (N: the number of items). it means the bottom: N-1 item that the position is -1.
Parameters
(in)long pos the position(top:0,..,N-1 or -1:bottom)
Return value
Nothing.
Notice



getSelectedItem method

Form
char* getSelectedItem();
Function
Returns the string of the selected item.
Description
Parameters
Nothing.
Return value
Returns the string.
Notice
Do not delete the return value. if Sevelal items are selected,returns the last selected one. So,if you want all,use getSelectedLabels() method.



setTopPos method

Form
void setTopPos(long pos);
Function
Scrolls the list to display the item of the specfied position most aloft.
Description
Parameters
(in)long pos the position(top:0,..,N-1 or -1:bottom)
Return value
Nothing.
Notice



setBottomPos method

Form
void setBottomPos(long pos);
Function
Scrolls the list to display the item of the specfied position most beneath.
Description
Parameters
(in)long pos the position(top:0,..,N-1 or -1:bottom)
Return value
Nothing.
Notice



updateList method

Form
void updateList();
Function
Updates the list which is changed by the methods.
Description
Parameters
Nothing.
Return value
Nothing.
Notice
Nothing.



setLabelClass method

Form
void setLabelClass(char* class_name);
Function
Registers the class which is used to display the items.
Function
Description
The items are shown by the internal instance of the specified class. The default class is WSCvlabel.
Parameters
(in)char* class_name the class name
Return value
Nothing.
Notice
Specify the class which has the property: WSNlabelString. The list class uses WSNlabelString to set the string of the items.



getSelectItemChanged method

Form
WSCbool getSelectItemChanged()
Function
Returns the state whether the selection of the items has changed.
Description
If the selection of the items has changed as some items become selected afresh by clicking of the mouse, the return value is True.
Parameters
Nothing.
Return value
Returns True if changed; returns False if not changed.
Notice
You need to call the method:setSlectedItemChanged(False) to clear the flag before getting a new change of the selection. then you call getSelectItemChanged() to get the change.



setSelectItemChanged method

Form
void setSelectItemChanged(WSCbool fl);
Function
Sets the value into the flag which indicates whether the selection of the items has changed.
Description
Parameters
(in)WSCbool fl True / False
Return value
Nothing.
Notice
This method is used to set the value only. Before getting the status of change by the method: getSelectItemChanged(), you need to reset the flag. Because, if the flag is True, keeps it for ever.



getLabels method

Form
WSClistData* getLabels();
Function
Returns a list of the internal instances which display the items.
Description
Parameters
Return value
Returns the list of the instances.
Notice
Do not delete the return value. You can access the instances in the same way as the method:getChildren(). Cast the elements of the array [void*] into WSCbase*.



getSelectedLabels method

Form
void getSelectedLabels(WSClistData& list);
Function
Returns the internal instances which dislpay the selected items with the specified list.
Description
Parameters
(out)WSClistData list the list which contains the return value
Return value
Nothing.
Notice
You can access the instances by casting the elements of the array [void*] into WSCbase*.



setItemVisible method

Form
long setItemVisible(long pos,WSCbool fl);
Function
Sets the visiblity of the item of the specified position.
Description
You can specify the position between top:0 and bottom: N-1, (N: the number of items). it means the bottom: N-1 item that the position is -1.
Parameters
(in)long pos the position(top:0,..,N-1 or -1:bottom)
(in)WSCbool fl True:visible,False:invisible
Return value
Returns WS_NO_ERR if it succeeds; returns the other if it fails.
Notice
Use this method when you want to make it unvisible without deleting.



setItemValue method

Form
long setItemValue(long pos,long kind,long bal);
Function
Sets the specified value into the specified attributes of the specified item.
Description
There are folloing attributes
WS_OPEN The open and close status of the item on the tree mode. 0:close,1:open
WS_ABSOLUTE_OPEN The open and close status of the item on the tree mode. 0:close,1:open
WS_INDENT_LEVEL The indent level of the item on the tree mode. 0: most left(parent),1,2,...

Notice: WS_ABSOLUTE_OPEN effects the all parent items which relates the specified item For example,if the parent and target item is close and you specifie the open status, they becomes the open status.
Parameters
(in)long pos the position(top:0,..,N-1 or -1:bottom)
(in)long kind the attribute
(in)long val the value
Return value
Returns WS_NO_ERR if it succeeds; returns the other if it fails.
Notice



getSortPos() method

Form
long getSortPos();
Function
Returns the number of the sort button on the detail mode.
Description
The number of the sort button is the most left one:0,1,...
Return value
Returns the number of the sort button.
Notice



getVisibleWidth method

Form
long getVisibleWidth()
Function
Returns the real width of the area.
Description
Parameters
Nothing.
Return value
Returns the real width exclude the scroll bars.
Notice
Refer the property WSNworkWidth or WSNwidth, if you want the virtual width of area or the width of the instance.



getVisibleHeight method

Form
long getVisibleHeight()
Function
Returns the real height of the area.
Description
Parameters
Nothing.
Return value
Returns the real height exclude the scroll bars.
Notice
Refer the property WSNworkHeight or WSNheight, if you want the virtual height of area or the height of the instance.



getScrForm method

Form
WSCbase* getScrForm()
Function
Returns the internal instance of the class: WSCscrFrame which provides the scrolled area.
Description
Parameters
Nothing.
Return value
Returns the internal instance of the scrolled area.
Notice
Do not delete the return value.



initialize method

Form
long initialize()
Function
Initializes the instance.
Description
Parameters
Nothing.
Return value
Returns WS_NO_ERR if it succeeds; returns the other if it fails.
Notice
It requires calling this initilize method once, before calling the others.



getInitialized method

Form
WSCbool getInitialized()
Function
Returns the status of initializing.
Description
Acquires whether the instance is initialized.
Parameters
Nothing.
Return value
Returns True if initialized; returns False if not.
Notice



getInstanceName method

Form
char* getInstanceName()
Function
Returns the instance name.
Description
Parameters
Nothing.
Return value
Returns the instance name.
Notice
Do not delete the return value, and it will become invalid by calling setInstanceName().



setInstanceName method

Form
void setInstanceName(char*)
Function
Specifies the instance name.
Description
Parameters
(in)char* pname instance name
Return value
Nothing.
Notice



getClassName method

Form
char* getClassName()
Function
Returns the class name of the instance.
Description
Parameters
Nothing.
Return value
Returns the class name.
Notice
Do not delete the return value.



cast method

Form
void* cast(char* class_name)
Function
Supplies the function of down cast. Usually C++ language does not allow to cast a abstract pointer to a pointer of child class. So the instance has all child class pointer, cast() method seek for a specified class pointer from contained all the pointer of child classes.
Description
Parameters
(in)char* class_name child class name
Return value
Returns the pointer. If specified class does not relate, returns NULL.
Notice
Please use the returned pointer as follows.
  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, and 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 types which it can cast to WSCvariant.



getProperty method

Form
WSCvariant getProperty(char* pname)
Function
Returns the value of the specified property
Description
Seeks for the specified property, and returns the value of it.
Parameters
(in)char* pname the property name
Return value
Returns the value by WSCvariant type.
Notice



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
Nothing.
Notice
This state is equal with the WSNvis property.



getVisible method

Form
WSCbool getVisible()
Function
Returns the status of visibility.
Description
Returns the status of visibility includes the parent instance.
Parameters
Nothing.
Return value
Returns the current visibility.
Notice
The return value is not always equal with 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.



setSensitive method

Form
void setSensitive(WSCbool fl)
Function
Specifies the state of sensibility.
Description
Parameters
(in)WSCbool fl True=sensitive,False=insensitive
Return value
Nothing.
Notice
if the parent instance is insensitive and the instance is sensitive,it becomes insensitive.



getVisible method

Form
WSCbool getVisible()
Function
Returns the sensibility
Description
Returns the sensibility includes the parent instance.
Parameters
Nothing.
Return value
Returns the current sensibility.
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.



draw method

Form
long draw()
Function
Draws the instance.
Description
Parameters
Nothing
Return value
Returns WS_NO_ERR if it succeeds; returns the other if it fails.
Notice
It do not draw if the instance is drawed once, so if you want to draw it forcibly,execute the method: setAbsoluteDraw(True).



redraw method

Form
long redraw()
Function
Clears and draws the instance.
Description
Parameters
Nothing.
Return value
Returns WS_NO_ERR if it succeeds; returns the other if it fails.
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
Nothing.
Return value
Returns WS_NO_ERR if it succeeds; returns the other if it fails.
Notice



getChildren method

Form
WSClistData & getChildren()
Function
Returns the list of child instances. It functions this method of the classes which have a management ability of child instances.
Description
Parameters
Nothing.
Return value
Returns the list of child instances.
Notice
The accessing of child instances is as follows. The "parent" is a management class like the WSCform,WSCwindow class which has child instances.
  WSClistData chidlren = 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 specified trigger.
Description
Parameters
(in)long trigger the trigger
Return value
Nothing.
Notice
This method does nothing,if there are no event procedures.



execProcedure method

Form
void execProcedure(char* pname)
Function
Executes the event procedures by specified procedure name.
Description
Parameters
(in)char* pname Event procedure name
Return value
Nothing.
Notice
This method does nothing,if there are no event procedures.



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 the other if it fails.
Notice
By changing of the state,it executes the event method: onFocusChange().



getFocus method

Form
WSCbool getFocus()
Function
Returns the state of the keyboard focus.
Description
Parameters
Nothing.
Return value
Returns True if it is focused; returns False if not.
Notice



getAllChildren method

Form
long getAllChildren(WSClistData &list)
Function
Returns all of the 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 the other if it fails.
Notice



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,returns it.
Parameters
Nothing.
Return value
Returns the application window.
Notice
Returns the instance, if the instance is the application window.



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
Nothing.
Notice
If needed, overload this method on the sub classes.



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
Nothing.
Return value
Nothing.
Notice
If needed, overload this method on the sub classes.



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
Nothing.
Notice
If needed, overload this method on the sub classes.



onMousePress method

Form
virtual void onMousePress(WSCpoint* pt)
Function
It executes this method when the mouse pointer 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
Nothing.
Notice
If needed, overload this method on the sub classes.



onMouseRelease method

Form
virtual void onMouseRelease(WSCpoint* pt)
Function
It executes this method when the mouse pointer 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
Nothing.
Notice
If needed, overload this method on the sub classes.



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
Nothing.
Notice
If needed, overload this method on the sub classes.



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, height of the instace
Return value
Nothing.
Notice
If needed, overload this method on the sub classes.



onVisibleChange method

Form
virtual void onVisibleChange(WSCbool vis)
Function
It executes this method when the state of the 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
Nothing.
Notice
If needed, overload this method on the sub classes.



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
Nothing.
Notice
If needed, overload this method on the sub classes.



onSensitiveChange method

Form
virtual void onSensitiveChange(WSCbool det)
Function
It executes this method when the state of the sensibility 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 sensibility
Return value
Nothing.
Notice
If needed, overload this method on the sub classes.



onParentSensitiveChange method

Form
virtual void onParentSensitiveChange(WSCbool det)
Function
It executes this method when the state of the parent's sensibility 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 sensibility
Return value
Nothing.
Notice
If needed, overload this method on the sub classes.



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
Nothing.
Notice
If needed, overload this method on the sub classes.


Document Release 1.0

For Use with Wide Studio Release 1.0, Summer 2000


Wide Stuido Home | Up to

Copyright(C) T. Hirabayashi, 2000 Last modified: July 01, 2000