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 menu elements.
Description
Parameters
  None.
Return value
  Returns the number of menu elements.
Notice
  None.
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 sensitivity of the element by the specified position (top:0,1,2...).
Description
  Makes the specified element sensitive if True, insensitive if False.
Parameters

  (in)short 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
  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
    None.
  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
    None.
  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 sensitivity of the menu element 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 element value
    (in)WSCbool fl | The sensitivity

  Return value
    Returns WS_NO_ERR if it succeeds; returns WS_ERR if it fails.
  Notice
  Samples

          //For example, make a menu element 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
    None.
  Return value
    None.
  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 the 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 beginCascade(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
    None.
  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.70
  For use with Wide Studio Release 3.70, Spring 2004

  Wide Studio Home | Up to

  Copyright(C) WideStudio Development Team, 1999-2004 |  | Last modified: May 25, 2004