public class TMessageBox extends TWindow
box = messageBox(title, caption,
TMessageBox.Type.OK | TMessageBox.Type.CANCEL);
if (box.getResult() == TMessageBox.OK) {
... the user pressed OK, do stuff ...
}
Modifier and Type | Class and Description |
---|---|
static class |
TMessageBox.Result
Message boxes have these possible results.
|
static class |
TMessageBox.Type
Message boxes have these supported types.
|
ABSOLUTEXY, CENTERED, HIDEONCLOSE, inKeyboardResize, inWindowMove, inWindowResize, MODAL, mouse, NOCLOSEBOX, NOZOOMBOX, OVERRIDEMENU, RESIZABLE, statusBar
Modifier | Constructor and Description |
---|---|
|
TMessageBox(TApplication application,
java.lang.String title,
java.lang.String caption)
Public constructor.
|
|
TMessageBox(TApplication application,
java.lang.String title,
java.lang.String caption,
TMessageBox.Type type)
Public constructor.
|
protected |
TMessageBox(TApplication application,
java.lang.String title,
java.lang.String caption,
TMessageBox.Type type,
boolean yield)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
TMessageBox.Result |
getResult()
Get the result.
|
boolean |
isCancel()
See if the user clicked CANCEL.
|
boolean |
isNo()
See if the user clicked NO.
|
boolean |
isOk()
See if the user clicked OK.
|
boolean |
isYes()
See if the user clicked YES.
|
void |
onKeypress(TKeypressEvent keypress)
Handle keystrokes.
|
activate, addShortcutKeypress, center, clearShortcutKeypresses, close, draw, getApplication, getBackground, getBorder, getBorderControls, getScreen, getStatusBar, getTitle, getZ, hasCloseBox, hasHiddenMouse, hasOverriddenMenu, hasZoomBox, hide, inMovements, isHidden, isModal, isShortcutKeypress, isShown, maximize, mouseOnClose, mouseOnMaximize, mouseOnResize, newStatusBar, onClose, onCommand, onFocus, onHide, onMenu, onMouseDown, onMouseMotion, onMouseUp, onPreClose, onResize, onShow, onUnfocus, removeShortcutKeypress, restore, setHiddenMouse, setMaximumWindowHeight, setMaximumWindowWidth, setMinimumWindowHeight, setMinimumWindowWidth, setTitle, setZ, show, stopMovements, toString
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, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getAttrXY, getChildren, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getHeight, getLayoutManager, getParent, getTheme, getWidth, getWindow, getX, getY, handleEvent, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEnabled, isVisible, messageBox, messageBox, mouseWouldHit, onIdle, onMouseDoubleClick, 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, vLineXY
public TMessageBox(TApplication application, java.lang.String title, java.lang.String caption)
application
- TApplication that manages this windowtitle
- window title, will be centered along the top bordercaption
- message to display. Use embedded newlines to get a
multi-line box.public TMessageBox(TApplication application, java.lang.String title, java.lang.String caption, TMessageBox.Type type)
application
- TApplication that manages this windowtitle
- window title, will be centered along the top bordercaption
- message to display. Use embedded newlines to get a
multi-line box.type
- one of the Type constants. Default is Type.OK.protected TMessageBox(TApplication application, java.lang.String title, java.lang.String caption, TMessageBox.Type type, boolean yield)
application
- TApplication that manages this windowtitle
- window title, will be centered along the top bordercaption
- message to display. Use embedded newlines to get a
multi-line box.type
- one of the Type constants. Default is Type.OK.yield
- if true, yield this Thread. Subclasses need to set this
to false and yield at their end of their constructor intead.public void onKeypress(TKeypressEvent keypress)
onKeypress
in class TWindow
keypress
- keystroke eventpublic final TMessageBox.Result getResult()
public final boolean isYes()
public final boolean isNo()
public final boolean isOk()
public final boolean isCancel()
Copyright © 2019 Kevin Lamonte. Licensed MIT.