public class ControlBox extends Window
Control.TranslucentShape
Modifier and Type | Field and Description |
---|---|
int[] |
buttonKeys
If you set the buttonCaptions array in the construction, you can also set this
public field to an int array of the keys that maps to each of the buttons.
|
protected Control |
cb |
protected Label |
msg |
protected int |
prefH |
protected int |
prefW |
int |
yPosition
Defines the y position on screen where this window opens.
|
_controlEvent, _dragEvent, _focus, _keyEvent, _mouseEvent, _multiEvent, _penEvent, androidBorderThickness, beepIfOut, blocking, borderStyle, cancelPenUp, canDrag, dragThreshold, fadeOtherWindows, fadeValue, firstFocus, flickEnabled, focusOnPenUp, footerColor, footerH, gradientTitleEndColor, gradientTitleStartColor, headerColor, highlighted, highResPrepared, HORIZONTAL_GRADIENT, ignoreEventOfType, keyHook, lastShiftY, lastSwappedContainer, mainSwapContainer, menubar, multiTouching, needsPaint, NO_BORDER, ORIENTATION_INVERTED, ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, popped, RECT_BORDER, repaintOnSwap, robot, ROUND_BORDER, rTitle, sameBackgroundColor, shiftH, shiftY, SIP_BOTTOM, SIP_HIDE, SIP_SHOW, SIP_TOP, TAB_BORDER, TAB_ONLY_BORDER, tempTitle, title, titleAlign, titleColor, titleFont, titleGap, topMost, VERTICAL_GRADIENT, zStack
alwaysEraseBackground, BACKGROUND_CYLINDRIC_SHADED, BACKGROUND_SHADED, BACKGROUND_SHADED_INV, BACKGROUND_SOLID, backgroundStyle, BORDER_LOWERED, BORDER_NONE, BORDER_RAISED, BORDER_ROUNDED, BORDER_SIMPLE, BORDER_TOP, borderColor, borderRadius, children, controlFound, finishedStart, ignoreOnAddAgain, ignoreOnRemove, insets, lastH, lastScreenWidth, lastW, numChildren, started, tabOrder, tail, TRANSITION_TIME
AFTER, alphaValue, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, BRIGHTER_BACKGROUND, callListenersOnAllTargets, CENTER, CENTER_OF, clearValueInt, clearValueStr, DARKER_BACKGROUND, DP, effect, enableUpdateScreen, esce, eventsEnabled, FILL, fillColor, FIT, floating, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, FONTSIZE, foreColor, height, ignoreInsets, isHighlighting, isTablet, KEEP, keepDisabled, keepEnabled, LEFT, next, nextTabControl, npParts, offscreen, offscreen0, onEventFirst, parent, PARENTSIZE, PARENTSIZEMAX, PARENTSIZEMIN, PREFERRED, prev, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, SCREENSIZE, SCREENSIZEMAX, SCREENSIZEMIN, setFont, setH, setRel, setW, setX, SETX_NOT_SET, setY, tempW, textShadowColor, TOP, translucentShape, transparentBackground, uiAdjustmentsBasedOnFontHeightIsSupported, uiAndroid, UICONST, uiFlat, uiHolo, uiMaterial, uiVista, visible, width, WILL_RESIZE, x, y
Constructor and Description |
---|
ControlBox(java.lang.String title,
java.lang.String text,
Control cb)
Constructs a ControlBox with the given parameters, and an Ok and a Cancel buttons.
|
ControlBox(java.lang.String title,
java.lang.String text,
Control cb,
int prefW,
int prefH,
java.lang.String[] buttonCaptions)
Constructs a ControlBox with the given parameters.
|
ControlBox(java.lang.String title,
java.lang.String text,
Control cb,
int prefW,
int prefH,
java.lang.String[] buttonCaptions,
int buttonRows)
Constructs a ControlBox with the given parameters.
|
ControlBox(java.lang.String title,
java.lang.String text,
Control cb,
java.lang.String[] buttonCaptions)
Constructs a ControlBox with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
Control |
getControl()
returns the control associated
|
int |
getPressedButtonIndex()
Returns the pressed button index, starting from 0
|
void |
onEvent(Event e)
handle scroll buttons and normal buttons
|
protected void |
onPopup()
Placeholder called imediatly before the popup began.
|
protected void |
postUnpop()
Placeholder called after the unpop is done and after the repaint of the other window.
|
_doPaint, _postEvent, destroyZStack, drawHighlight, getBorderStyle, getClientRect, getClientRect, getDefaultDragThreshold, getFocus, getHighlighted, getPopupCount, getPreferredHeight, getPreferredWidth, getTitleFont, getTopMost, handleFocusChangeKeys, isScreenShifted, isSipShown, isSipShown4D, isTopMost, isVisible, loadBehind, makeUnmovable, onClickedOutside, onRobotKey, onUnpop, paintTitle, paintWindowBackground, popup, popupMenuBar, popupNonBlocking, postPopup, postPressedEvent, pumpEvents, removeFocus, repaintActiveWindows, resize, resizeHeight, resizeWidth, screenResized, setBorderStyle, setDeviceTitle, setFocus, setGrabPenEvents, setHighlighted, setMenuBar, setOrientation, setSIP, setTitle, setTitleFont, shiftScreen, swap, swapFocus, unpop, validate
add, add, add, add, add, broadcastEvent, clear, fillBackground, findChild, findNearestChild, findNextFocusControl, getBorderRadius, getChildren, getChildrenCount, getFirstChild, getFocusableControls, getInsets, incLastX, incLastY, initUI, isPressed, moveFocusToNextControl, moveFocusToNextEditable, onAddAgain, onColorsChanged, onPaint, onRemove, onSwapFinished, paintChildren, remove, removeAll, setBorderRadius, setEnabled, setFocusTraversable, setHighlighting, setInsets, setPressColor, setPressed, swapToTopmostWindow
_onEvent, addEnabledStateListener, addFocusListener, addFontChangeHandler, addGridListener, addHandler, addHighlightListener, addKeyListener, addListContainerListener, addMouseListener, addMultiTouchListener, addPenListener, addPressListener, addPushNotificationListener, addSizeChangeHandler, addTimer, addTimer, addTimerListener, addValueChangeHandler, addWindowListener, bringToFront, changeHighlighted, contains, drawTranslucentBackground, getAbsoluteRect, getBackColor, getDoEffect, getEffectH, getEffectW, getEffectX, getEffectY, getEventListeners, getFont, getForeColor, getGap, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPressedEvent, getPrev, getRect, getSize, getTextShadowColor, getWidth, getX, getX2, getY, getY2, hadParentScrolled, handleGeographicalFocusChangeKeys, hasFocus, internalSetEnabled, intXYWH, isActionEvent, isChildOf, isDisplayed, isEnabled, isFloating, isInsideOrNear, isObscured, isVisibleAndInside, onBoundsChanged, onFontChanged, onWindowPaintFinished, post, postEvent, releaseScreenShot, removeEnabledStateListener, removeFocusListener, removeGridListener, removeHandler, removeHighlightListener, removeKeyListener, removeListContainerListener, removeMouseListener, removeMultiTouchListener, removePenListener, removePressListener, removePushNotificationListener, removeTimer, removeTimerListener, removeWindowListener, repaint, repaintNow, reposition, reposition, repositionChildren, requestFocus, resetSetPositions, resetStyle, safeRepaintNow, safeUpdateScreen, sendToBack, setBackColor, setBackForeColors, setDoEffect, setFloating, setFocusLess, setFont, setForeColor, setNinePatch, setNinePatch, setRect, setRect, setRect, setRect, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboard
protected Label msg
protected Control cb
protected int prefW
protected int prefH
public int yPosition
Control.CENTER
,
Control.TOP
,
Control.BOTTOM
public int[] buttonKeys
buttonKeys = new int[]{SpecialKeys.ENTER,SpecialKeys.ESCAPE};Note that if you use the default Ok/Cancel buttons, this mapping is already done.
public ControlBox(java.lang.String title, java.lang.String text, Control cb)
title
- The window's title.text
- The text that will be displayed in a Label above the control.cb
- The control that will be used to get input from the user.public ControlBox(java.lang.String title, java.lang.String text, Control cb, java.lang.String[] buttonCaptions)
title
- The window's title.text
- The text that will be displayed in a Label above the control.cb
- The control that will be used to get input from the user.buttonCaptions
- The button captions that will be used in the PushButtonGroup.public ControlBox(java.lang.String title, java.lang.String text, Control cb, int prefW, int prefH, java.lang.String[] buttonCaptions)
title
- The window's title.text
- The text that will be displayed in a Label above the control.cb
- The control that will be used to get input from the user.buttonCaptions
- The button captions that will be used in the PushButtonGroup, or null to hide them.prefW
- The preferred width for the control. You can also use FILL or PREFERREEDprefH
- The preferred height for the control.public ControlBox(java.lang.String title, java.lang.String text, Control cb, int prefW, int prefH, java.lang.String[] buttonCaptions, int buttonRows)
title
- The window's title.text
- The text that will be displayed in a Label above the control.cb
- The control that will be used to get input from the user.buttonCaptions
- The button captions that will be used in the PushButtonGroup, or null to hide them.prefW
- The preferred width for the control. You can also use FILL or PREFERREEDprefH
- The preferred height for the control.buttonRows
- The number of rows for the buttons.protected void onPopup()
Window
public void onEvent(Event e)
public int getPressedButtonIndex()
public Control getControl()