TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
PopupMenu Class Reference

Inherits SimObject.

## Public Member Functions
void | attachToMenuBar (pos, title)
void | checkItem (pos, checked)
void | checkRadioItem (firstPos, lastPos, checkPos)
void | enableItem (pos, enabled)
Integer | insertItem (pos, [title]?, [accelerator]?)
Integer | insertSubMenu (pos, title, subMenu)
Boolean | isItemChecked (pos)
void | removeFromMenuBar ()
void | removeItem (pos)
void | showPopup ([x, y]?)
Public Member Functions inherited from SimObject
Integer | clone ([copyDynamicFields=false]?)
void | delete ()
Integer | getId ()
void | setName (newName)
String | getName ()
String | getClassNamespace ()
String | getSuperClassNamespace ()
void | setClassNamespace (nameSpace)
void | setSuperClassNamespace ()
Boolean | isMethod (string methodName)
String | call (methodName, [args]*)
void | dumpClassHierarchy ()
void | dump ()
Boolean | isMemberOfClass (string classname)
String | getClassName ()
String | getFieldValue (fieldName)
Boolean | setFieldValue (fieldName, value)
Integer | getDynamicFieldCount ()
String | getDynamicField (index)
Integer | getFieldCount ()
String | getField (int index)
void | setProgenitorFile (file)
String | getProgenitorFile ()
Integer | getType ()
String | getFieldType (fieldName)
void | setInternalName (string InternalName)
String | getInternalName ()
Boolean | isChildOfGroup (groupID)
Integer | getGroup ()
Boolean | startTimer (callbackFunction, float timePeriod, [repeat]?)
void | stopTimer ()
Boolean | isTimerActive ()
Integer | schedule (time, command, [arg]*)
Boolean | save (fileName, [selectedOnly]?)
void | addFieldFilter (fieldName)
void | removeFieldFilter (fieldName)

## Member Function Documentation

void attachToMenuBar | ( | pos | ,
|  | title |
| ) |  |

Attaches given menu item to menu bar

Parameters

  pos | The position of the desired menu item
  title | The menu item title

Returns
  No return value

void checkItem | ( | pos | ,
|  | checked |
| ) |  |

Sets the given item's \ status

Parameters

  pos | The item's position

Returns
  No return value

void checkRadioItem | ( | firstPos | ,
|  | lastPos | ,
|  | checkPos |
| ) |  |

Checks the specified menu item and makes it a radio item

Parameters

  firstPos | The position of the first item in the group
  lastPos | The position of the last item in the group
  checkPos | The position of the item to check

Returns
  No return value.

void enableItem | ( | pos | ,
|  | enabled |
| ) |  |

Enables the item at the given position

Parameters

  pos | The item's position
  enabled | A boolean value to set its current status

Returns
  No return value

Integer insertItem | ( | pos | ,
|  | [title] ? | ,
|  | [accelerator] ? |
| ) |  |

Insert a new menu item

Parameters

  pos | The position of the item
  title | The title of the item to add (optional)
  accelerator | A keyboard accelerator for the menu item

Returns
  Returns the id of the new menu item as a nonnegative integer (-1 on fail)

Integer insertSubMenu | ( | pos | ,
|  | title | ,
|  | subMenu |
| ) |  |

Inserts a menu item into the current object

Parameters

  pos | The position of the menu item
  The | desired title of the sub menu
  subMenu | The submenu you are inserting.

Returns
  Returns the ID of the inserted item or -1 on failure

Boolean isItemChecked | ( | pos |  | ) |

Checks (no pun intended) the \ flag of the given menu item

Parameters

  pos | The position of the desired item

Returns
  Returns true if checked, false otherwise

void removeFromMenuBar | ( |  | ) |

Removes current item from menu bar

Returns
  No return value

void removeItem | ( | pos |  | ) |

Removes the menu item at the given position

Parameters

  pos | The position of the desired menu item to obliterate

Returns
  No return value

void showPopup | ( | [x, y] ? |  | ) |

Show the menu (optional: specify position)

Parameters

  x,y | Coodinates to display menu (upper left corner)

Returns
  No return value.