public class TButton extends TWidget
TAction.DO()
Constructor and Description |
---|
TButton(TWidget parent,
java.lang.String text,
int x,
int y,
TAction action)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispatch()
Act as though the button was pressed.
|
void |
draw()
Draw a button with a shadow.
|
MnemonicString |
getMnemonic()
Get the mnemonic string for this button.
|
void |
onKeypress(TKeypressEvent keypress)
Handle keystrokes.
|
void |
onMouseDown(TMouseEvent mouse)
Handle mouse button presses.
|
void |
onMouseMotion(TMouseEvent mouse)
Handle mouse movements.
|
void |
onMouseUp(TMouseEvent mouse)
Handle mouse button releases.
|
void |
setHeight(int height)
Override TWidget's height: we can only set height at construction
time.
|
void |
setShadowColor(CellAttributes color)
Set the background color used for the button "shadow".
|
void |
setWidth(int width)
Override TWidget's width: we can only set width at construction time.
|
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, onResize, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setDimensions, setEnabled, setLayoutManager, setParent, setupForTWindow, setVisible, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY
public void onMouseDown(TMouseEvent mouse)
onMouseDown
in class TWidget
mouse
- mouse button eventpublic void onMouseUp(TMouseEvent mouse)
public void onMouseMotion(TMouseEvent mouse)
onMouseMotion
in class TWidget
mouse
- mouse motion eventpublic void onKeypress(TKeypressEvent keypress)
onKeypress
in class TWidget
keypress
- keystroke eventpublic void setWidth(int width)
public void setHeight(int height)
public MnemonicString getMnemonic()
public void dispatch()
public void setShadowColor(CellAttributes color)
color
- the new background color, or null for no shadowCopyright © 2019 Kevin Lamonte. Licensed MIT.