TorqueScript Reference
Public Member Functions | List of all members
PopupMenu Class Reference

#include <popupMenu_ScriptBinding.h>

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
void assignFieldsFrom (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)
 
Boolean setEditFieldValue (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] *)
 
void startListening (SimObject)
 
void stopListening (SimObject)
 
void addListener (SimObject)
 
void removeListener (SimObject)
 
void removeAllListeners ()
 
void postEvent (String eventName, String data)
 
Boolean save (fileName, [selectedOnly]?)
 
void addFieldFilter (fieldName)
 
void removeFieldFilter (fieldName)
 

Member Function Documentation

◆ attachToMenuBar()

void attachToMenuBar ( pos  ,
title   
)

Attaches given menu item to menu bar

Parameters
posThe position of the desired menu item
titleThe menu item title
Returns
No return value

◆ checkItem()

void checkItem ( pos  ,
checked   
)

Sets the given item's \checked\ status

Parameters
posThe item's position
Returns
No return value

◆ checkRadioItem()

void checkRadioItem ( firstPos  ,
lastPos  ,
checkPos   
)

Checks the specified menu item and makes it a radio item

Parameters
firstPosThe position of the first item in the group
lastPosThe position of the last item in the group
checkPosThe position of the item to check
Returns
No return value.

◆ enableItem()

void enableItem ( pos  ,
enabled   
)

Enables the item at the given position

Parameters
posThe item's position
enabledA boolean value to set its current status
Returns
No return value

◆ insertItem()

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

Insert a new menu item

Parameters
posThe position of the item
titleThe title of the item to add (optional)
acceleratorA keyboard accelerator for the menu item
Returns
Returns the id of the new menu item as a nonnegative integer (-1 on fail)

◆ insertSubMenu()

Integer insertSubMenu ( pos  ,
title  ,
subMenu   
)

Inserts a menu item into the current object

Parameters
posThe position of the menu item
Thedesired title of the sub menu
subMenuThe submenu you are inserting.
Returns
Returns the ID of the inserted item or -1 on failure

◆ isItemChecked()

Boolean isItemChecked ( pos  )

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

Parameters
posThe position of the desired item
Returns
Returns true if checked, false otherwise

◆ removeFromMenuBar()

void removeFromMenuBar ( )

Removes current item from menu bar

Returns
No return value

◆ removeItem()

void removeItem ( pos  )

Removes the menu item at the given position

Parameters
posThe position of the desired menu item to obliterate
Returns
No return value

◆ showPopup()

void showPopup ( [x, y] ?  )

Show the menu (optional: specify position)

Parameters
x,yCoodinates to display menu (upper left corner)
Returns
No return value.