public class TMenuItem extends TWidget
Modifier and Type | Method and Description |
---|---|
void |
dispatch()
Dispatch event(s) due to selection or click.
|
void |
draw()
Draw a menu item with label.
|
boolean |
getChecked()
Get checkable flag.
|
int |
getId()
Get the menu item ID.
|
TKeypress |
getKey()
Get a global accelerator key for this menu item.
|
MnemonicString |
getMnemonic()
Get the mnemonic string for this menu item.
|
void |
onKeypress(TKeypressEvent keypress)
Handle keystrokes.
|
void |
onMouseUp(TMouseEvent mouse)
Handle mouse button releases.
|
void |
setCheckable(boolean checkable)
Set checkable flag.
|
void |
setChecked(boolean checked)
Set checked flag.
|
void |
setKey(TKeypress key)
Set a global accelerator key for this menu item.
|
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, getActiveChild, 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 onMouseUp(TMouseEvent mouse)
public void onKeypress(TKeypressEvent keypress)
onKeypress
in class TWidget
keypress
- keystroke eventpublic final int getId()
public final void setCheckable(boolean checkable)
checkable
- if true, this menu item can be checked/uncheckedpublic final boolean getChecked()
public final void setChecked(boolean checked)
checked
- if true, and if this menu item is checkable, then
getChecked() will return truepublic final MnemonicString getMnemonic()
public final TKeypress getKey()
public final void setKey(TKeypress key)
key
- global keyboard acceleratorpublic void dispatch()
Copyright © 2019 Kevin Lamonte. Licensed MIT.