Wide Studio Object Reference

Wide Studio Home
Up to


Class Name

WSCpulldownMenu

Specification of methods



getItems method

Form
long getItems()
Function
Returns the number of the menu elements.
Description
Parameters
Nothing.
Return value
Returns the number of the menu elements.
Notice
Nothing.
Samples
  long num = newpull_000->getItems();
  long i;
  //make all the menu elements sensitive.
  for(i=0; i<num; i++){
    newpull_000->setItemSensitive(i,True);
  }



setItemSensitive method

Form
long setItemSensitive(short no,WSCbool flag)
Function
Sets the sensibility of the element by the specified position (top:0,1,2...).
Description
Makes the specified elemet sensitive if True, insensitive if False.
Parameters
(in)short no The position (top:0,1,2,...)
(in)WSCbool fl The sensibility
Return value
Returns WS_NO_ERR if it succeeds; returns WS_ERR if it fails.
Notice
Samples
Refer to getItems().



getItemSensitive method

Form
WSCbool* getItemSensitive()
Function
Returns the array of the states whether the elements are sensitive. (True: sensitive,False: insensitive).
Description
Parameters
Nothing.
Return value
Returns the array of the states whether the elements are sensitive.
Notice
Samples
  long num = newpull_000->getItems();
  //get the array of sensitive stats of the menu elements.
  WSCbool* statuslist = newpull_000->getItemSensitive();
  long i;
  for(i=0; i<num; i++){
    WSCbool status = statuslist[i];
    printf("item=%d status=%d\n",i,status);
  }



getValue method

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



setValueSensitive method

Form
long setValueSensitive(short value,WSCbool flag)
Function
Sets the sensibility of the elemnt of the menu by the specified value.
Description
Seeks the element which has the specified value, and makes it sensitive if the flag is True, or makes it not,if False.
Parameters
(in)short value The value of the element
(in)WSCbool fl The sensibility
Return value
Returns WS_NO_ERR if it succeeds; returns WS_ERR if it fails.
Notice
Samples
  //For example,make the menu elemnt which has value: 100 not sensitive.
  newpull_000->getValueSensitive(100,False);



onActivate method

Form
void onActivate()
Function
It executes this method when the menu 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
Nothing.
Return value
Nothing.
Notice
If needed, overload this method on the sub classes.
Samples
void new_class::onActivate(){
  //do something when the menu is selected.

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



addItem method

Form
long addItem(char* lb,char* op,char* shortc,long id)
Function
Add a menu element to menu.
Description
Parameters
(in)char* lb Label text of new element
(in)char* op Procedure name to execute
(in)char* shortc Short cut key
(in)long Menu id
Return value
Returns WS_NO_ERR if it succeeds; returns WS_ERR if it fails.
Notice
Samples
  //Lable: "new element(A)",procedure name:"proc1",
  //short cut key:A, menu id:100.
  newpull_000->addItem("new element(A)","proc1","A",100);



beginCascade menu

Form
long beginCascacde(char* lb)
Function
Declare adding a new sub menu starts.
Description
Add a sub menu elements to the menu.
Parameters
(in)char* lb Label text for a sub menu
Return value
Returns WS_NO_ERR if it succeeds; returns WS_ERR if it fails.
Notice
endCascade() method must be called after adding sub menu elements with beginCascade() and addItem()
Samples
  //add sub menu...
  newpull_000->beginCascade("sub menu");
  newpull_000->addItem("sub menu element1(A)","proc1","A",101);
  newpull_000->addItem("sub menu element2(B)","proc2","B",102);
  newpull_000->endCascade();



endCascade method

Form
long endCascacde()
Function
Declare adding the sub menu done.
Description
Parameters
Nothing
Return value
Returns WS_NO_ERR if it succeeds; returns WS_ERR if it fails.
Notice
It must be called after calling beginCascade().
Samples
Refer to beginCascade().


Document Release 3.0

For Use with Wide Studio Release 3.0, Summer 2002


Wide Stuido Home | Up to

Copyright(C) T. Hirabayashi, 1999-2002 Last modified: July 15, 2002