Wide Studio Object Reference

Wide Studio Home
Up to


Class Name

WSCoption

Specification of methods



setSelectValue method

Form
long setSelectValue(long value,WSCbool flag)
Function
Sets the sensitivity of an element of the menu by the specified value.
Description
Seeks an element which has a specified value, and makes it sensitive if the flag is True, or makes it not if False.
Parameters
(in)long value the value of the element.
(in)WSCbool fl the sensitivity
Return value
Returns WS_NO_ERR if it succeeds; returns WS_ERR if it fails.
Notice
Samples
  //make the value 100 not sensitive if the option menu has value 100...
  newopti_000->setSelectValue(100,False);



setItemSensitive method

Form
long setItemSensitive(long no,WSCbool flag)
Function
Sets the sensitivity of the element of the menu by the specified position.
Description
Makes it sensitive if the flag is True, or makes it not, if False.
Parameters
(in)long no the position (top: 0,1,2,...)
(in)WSCbool fl the sensitivity
Return value
Returns WS_NO_ERR if it succeeds; returns WS_ERR if it fails.
Notice
Samples
  //make the first menu item not sensitive.
  newopti_000->setItemSensitive(0,False);



getValue method

Form
long getValue()
Function
Returns the value of the selected element.
Description
Parameters
None.
Return value
Returns the value of the selected element.
Notice
Samples
  //get the selected menu value..
  long val = newopti_000->getValue();



getItems method

Form
long getItems()
Function
Returns the number of the available menus.
Description
Parameters
None.
Return value
Returns the number of the available menus.
Notice
Samples
  //get the array of the sensitivity indicators of a menu.
  WSCbool* statuslist = newopti_000->getSelectStatus();
  long num = newopti_000->getItems();
  long i;
  for(i=0; i<num; i++){
    WSCbool status = statuslist[i];
    printf("menu%d status=%d\n",i,status);
  }



getSelectStatus method

Form
WSCbool* getSelectStatus()
Function
Returns the array of the states whether the elements are sensitive. (True: sensitive, False: insensitive).
Description
Parameters
None.
Return value
Returns the array of the states whether the elements are sensitive.
Notice
Samples
Refer to getItems().



onActivate method

Form
void onActivate()
Function
Executes this method when a menu item is selected.
Description
Instead of the event procedure by the WSEV_ACTIVATE trigger, the WSEV_ACTIVATE 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::onActivate(){
  //do something when the value is selected.

  //call the method of the parent class.
  old_class::onActivate();
}



onValueChange method

Form
void onValueChanged()
Function
It executes this method when the selected value is changed.
Description
Instead of the event procedure by the WSEV_VALUE_CH trigger, the WSEV_VALUE_CH event can be handled by overloading with this method.
Parameters
None.
Return value
None.
Notice
If needed, overload this method on the sub classes.
Samples
void new_class::onValueChange(){
  //do something when the value is changed.

  //call the method of the parent class.
  old_class::onValueChange();
}


Document Release 3.20

For use with Wide Studio Release 3.20, Spring 2003


Wide Studio Home | Up to

Copyright(C) T. Hirabayashi, 1999-2003 Last modified: February 3, 2003