waba.ui
Class InputDialog
java.lang.Object
|
+--waba.ui.Control
|
+--waba.ui.Container
|
+--waba.ui.Window
|
+--waba.ui.InputDialog
- public class InputDialog
- extends Window
This class pops up a Window with a Label, an Edit and some buttons. Good
to input some text from the user.
Here is an example (taken from examples/apps/GuiBuilder):
// on some event...
if (renameDialog == null)
renameDialog = new InputDialog("Project Rename","Enter the new name:","");
renameDialog.setValue(projectName);
popupBlockingModal(renameDialog);
// when window closes...
if (renameDialog.getPressedButtonIndex() == 0) // ok?
{
projectName = renameDialog.getValue();
}
| Fields inherited from class waba.ui.Window |
_controlEvent,
_focus,
_keyEvent,
_penEvent,
beepIfOut,
blockingCount,
borderStyle,
canDrag,
eraseBackgroundNow,
flicker,
HIDE_STATE,
highlighted,
highResPrepared,
imgCovered,
lastSwappedContainer,
mainSwapContainer,
menubar,
needsPaint,
NO_BORDER,
RECT_BORDER,
ROUND_BORDER,
TAB_BORDER,
TAB_ONLY_BORDER,
title,
titleFont,
topMost,
VK_BOTTOM,
VK_HIDE,
VK_SHOW,
VK_TOP,
zStack |
| Fields inherited from class waba.ui.Container |
BORDER_LOWERED,
BORDER_NONE,
BORDER_RAISED,
BORDER_SIMPLE,
children,
lastH,
lastW,
lastX,
lastY,
parentWindow,
started,
tabOrder,
tail |
| Fields inherited from class waba.ui.Control |
AFTER,
appId,
appObj,
asContainer,
asWindow,
backColor,
backDis,
BEFORE,
BOTTOM,
CENTER,
clearValueInt,
clearValueStr,
enabled,
FILL,
FIT,
fm,
fmH,
focusLess,
focusTraversable,
font,
foreColor,
foreDis,
height,
highlightRectsCount,
isHighlighting,
LEFT,
parent,
PREFERRED,
RANGE,
RIGHT,
SAME,
TOP,
uiCE,
uiFlat,
uiPalm,
uiVista,
visible,
width,
x,
x2,
y,
y2 |
|
Constructor Summary |
InputDialog(java.lang.String title,
java.lang.String text,
java.lang.String defaultValue)
Creates a new InputDialog with the given window Title,
the given label Text, the given Default value for the Edit,
and two buttons "Ok" and "Cancel".
|
InputDialog(java.lang.String title,
java.lang.String text,
java.lang.String defaultValue,
java.lang.String[] buttonCaptions)
Creates a new InputDialog with the given window Title,
the given label Text, the given Default value for the Edit
and with the given buttons.
|
|
Method Summary |
Edit |
getEdit()
Returns the Edit so you can set its properties. |
int |
getPressedButtonIndex()
Returns the pressed button index, starting from 0 |
java.lang.String |
getValue()
Returns the value entered |
protected void |
onColorsChanged(boolean colorsChanged)
Called after a setEnabled, setForeColor and setBackColor and when a control has
been added to a Container. |
void |
onEvent(Event e)
handle scroll buttons and normal buttons |
protected void |
postPopup()
Placeholder called after the popup is done and after the repaint of this window. the default implementation does nothing. |
protected void |
postUnpop()
Placeholder called after the unpop is done and after the repaint of the other window. the default implementation does nothing. |
void |
setValue(java.lang.String value)
Sets the default value on the Edit field |
| Methods inherited from class waba.ui.Window |
_doPaint,
_doPaint,
_postEvent,
_postSoundEvent,
damageRect,
destroyZStack,
dontSaveBehind,
drawHighlight,
getClientRect,
getClientRect,
getFocus,
getHighlighted,
getOffScreen,
getPreferredHeight,
getPreferredWidth,
getTopMost,
handleFocusChangeKeys,
isTopMost,
isVisible,
loadBehind,
makeUnmovable,
onClickedOutside,
onPopup,
onUnpop,
paintTitle,
popupBlockingModal,
popupMenuBar,
popupModal,
postPressedEvent,
pumpEvents,
saveBehind,
setBorderStyle,
setDoubleBuffer,
setFocus,
setHighlighted,
setMenuBar,
setStatePosition,
setTitle,
setTitleFont,
swap,
swapFocus,
unpop,
updateScreen,
validate |
| Methods inherited from class waba.ui.Container |
add,
add,
add,
broadcastEvent,
clear,
findChild,
getChildren,
onAdd,
onPaint,
onRemove,
onStart,
paintChildren,
remove,
setEnabled,
setHighlighting,
swapToTopmostWindow |
| Methods inherited from class waba.ui.Control |
addTimer,
changeHighlighted,
contains,
createGraphics,
getAbsoluteRect,
getBackColor,
getFont,
getFontMetrics,
getForeColor,
getNext,
getParent,
getParentWindow,
getPos,
getRect,
getSize,
isDisplayed,
isEnabled,
onBoundsChanged,
onFontChanged,
onWindowPaintFinished,
postEvent,
removeTimer,
repaint,
repaintNow,
requestFocus,
setBackColor,
setBackForeColors,
setFocusLess,
setFont,
setForeColor,
setRect,
setRect,
setRect,
setVisible,
translateFromOrigin,
uiStyleChanged |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
InputDialog
public InputDialog(java.lang.String title,
java.lang.String text,
java.lang.String defaultValue)
- Creates a new InputDialog with the given window Title,
the given label Text, the given Default value for the Edit,
and two buttons "Ok" and "Cancel".
The text used in a Label must be one line only!
InputDialog
public InputDialog(java.lang.String title,
java.lang.String text,
java.lang.String defaultValue,
java.lang.String[] buttonCaptions)
- Creates a new InputDialog with the given window Title,
the given label Text, the given Default value for the Edit
and with the given buttons.
The text used in a Label must be one line only!
onColorsChanged
protected void onColorsChanged(boolean colorsChanged)
- Description copied from class: Control
- Called after a setEnabled, setForeColor and setBackColor and when a control has
been added to a Container. If colorsChanged
is true, it was called from setForeColor/setBackColor/Container.add; otherwise, it was
called from setEnabled
- Overrides:
- onColorsChanged in class Container
postPopup
protected void postPopup()
- Description copied from class: Window
- Placeholder called after the popup is done and after the repaint of this window. the default implementation does nothing.
- Overrides:
- postPopup in class Window
postUnpop
protected void postUnpop()
- Description copied from class: Window
- Placeholder called after the unpop is done and after the repaint of the other window. the default implementation does nothing.
- Overrides:
- postUnpop in class Window
onEvent
public void onEvent(Event e)
- handle scroll buttons and normal buttons
- Overrides:
- onEvent in class Control
- Tags copied from class: Control
- Parameters:
event - the event to process- See Also:
Event,
KeyEvent,
PenEvent
getPressedButtonIndex
public int getPressedButtonIndex()
- Returns the pressed button index, starting from 0
getValue
public java.lang.String getValue()
- Returns the value entered
setValue
public void setValue(java.lang.String value)
- Sets the default value on the Edit field
getEdit
public Edit getEdit()
- Returns the Edit so you can set its properties.