Modifier and Type | Method and Description |
---|---|
TMenuItem |
addDefaultItem(int id)
Convenience function to add one of the default menu items.
|
TMenuItem |
addDefaultItem(int id,
boolean enabled)
Convenience function to add one of the default menu items.
|
TMenuItem |
addItem(int id,
java.lang.String label)
Convenience function to add a menu item.
|
TMenuItem |
addItem(int id,
java.lang.String label,
TKeypress key)
Convenience function to add a custom menu item.
|
void |
addSeparator()
Convenience function to add a menu separator.
|
TSubMenu |
addSubMenu(java.lang.String title)
Convenience function to add a sub-menu.
|
void |
dispatch()
Override dispatch() to do nothing.
|
void |
draw()
Draw the menu title.
|
TWidget |
getActiveChild()
Returns my active widget.
|
void |
onKeypress(TKeypressEvent keypress)
Handle keystrokes.
|
getChecked, getId, getKey, getMnemonic, onMouseUp, setCheckable, setChecked, setKey
activate, activate, activate, activateAll, addButton, addCalendar, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, close, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getApplication, getAttrXY, getChildren, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getHeight, getLayoutManager, getParent, getScreen, getTheme, getWidth, getWindow, getX, getY, handleEvent, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEnabled, isVisible, messageBox, messageBox, mouseWouldHit, onCommand, onIdle, onMenu, onMouseDoubleClick, onMouseDown, onMouseMotion, onResize, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setDimensions, setEnabled, setHeight, setLayoutManager, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY
public void onKeypress(TKeypressEvent keypress)
onKeypress
in class TMenuItem
keypress
- keystroke eventpublic void dispatch()
public TWidget getActiveChild()
getActiveChild
in class TWidget
public TMenuItem addItem(int id, java.lang.String label, TKeypress key)
id
- menu item ID. Must be greater than 1024.label
- menu item labelkey
- global keyboard acceleratorpublic TMenuItem addItem(int id, java.lang.String label)
id
- menu item ID. Must be greater than 1024.label
- menu item labelpublic TMenuItem addDefaultItem(int id)
id
- menu item ID. Must be between 0 (inclusive) and 1023
(inclusive).public TMenuItem addDefaultItem(int id, boolean enabled)
id
- menu item ID. Must be between 0 (inclusive) and 1023
(inclusive).enabled
- default state for enabledpublic void addSeparator()
public TSubMenu addSubMenu(java.lang.String title)
title
- menu title. Title must contain a keyboard shortcut,
denoted by prefixing a letter with "&", e.g. "&File"Copyright © 2019 Kevin Lamonte. Licensed MIT.