public class TopMenu extends Window
| Modifier and Type | Class and Description |
|---|---|
static interface |
TopMenu.AnimationListener |
static class |
TopMenu.Item |
Control.TranslucentShape| Modifier and Type | Field and Description |
|---|---|
boolean |
autoClose
Set to false to disable the close when pressing in a button of the menu.
|
Image |
backImage
An optional image to be used as background
|
int |
backImageAlpha
The alpha value to be applied to the background image
|
boolean |
drawSeparators |
Container |
header |
double |
itemHeightFactor |
protected Control[] |
items |
static int |
percCap
The percentage of the area used for the icon and the caption
|
static int |
percIcon
The percentage of the area used for the icon and the caption
|
int |
percWidth
The percentage of the screen that this TopMenu will take: LEFT/RIGHT will
take 50% of the screen's width, other directions will take 80% of the
screen's width.
|
Insets |
scInsets
Insets used to place the ScrollContainer.
|
protected int |
selected |
int |
separatorColor |
boolean |
showElevation |
int |
totalTime
Defines the animation delay
|
int |
widthInPixels
The width in pixels instead of percentage of screen's width.
|
_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, zStackalwaysEraseBackground, 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_TIMEAFTER, 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 |
|---|
TopMenu(Control[] items,
int animDir) |
TopMenu(Control[] items,
int animDir,
byte borderStyle) |
| Modifier and Type | Method and Description |
|---|---|
int |
getSelectedIndex() |
void |
initUI()
Called to initialize the User Interface of this container.
|
boolean |
isFadeOnPopAndUnpop()
Returns if this control fades in/out on pop/unpop
|
protected boolean |
onClickedOutside(PenEvent event)
called when the user clicks outside the bounds of this window.
|
void |
onEvent(Event e)
Called to process key, pen, control and other posted events.
|
void |
onPopup()
Placeholder called imediatly before the popup began.
|
void |
popup()
Pops up this window, blocking the execution until the window closes.
|
protected void |
postPopup()
Placeholder called after the popup is done and after the repaint of this window.
|
void |
postUnpop()
Placeholder called after the unpop is done and after the repaint of the other window.
|
void |
screenResized()
Called when the screen is resized, probably caused by a rotation.
|
void |
setFadeOnPopAndUnpop(boolean fadeOnPopAndUnpop)
sets if this control fades in/out on pop/unpop
|
protected void |
setRect(boolean screenResized) |
void |
unpop()
Unpops the current TopMenu
|
void |
unpop(TopMenu.AnimationListener alist)
Unpops the current TopMenu with the given animation listener.
|
_doPaint, _postEvent, destroyZStack, drawHighlight, getBorderStyle, getClientRect, getClientRect, getDefaultDragThreshold, getFocus, getHighlighted, getPopupCount, getPreferredHeight, getPreferredWidth, getTitleFont, getTopMost, handleFocusChangeKeys, isScreenShifted, isSipShown, isSipShown4D, isTopMost, isVisible, loadBehind, makeUnmovable, onRobotKey, onUnpop, paintTitle, paintWindowBackground, popupMenuBar, popupNonBlocking, postPressedEvent, pumpEvents, removeFocus, repaintActiveWindows, resize, resizeHeight, resizeWidth, setBorderStyle, setDeviceTitle, setFocus, setGrabPenEvents, setHighlighted, setMenuBar, setOrientation, setSIP, setTitle, setTitleFont, shiftScreen, swap, swapFocus, validateadd, add, add, add, add, broadcastEvent, clear, fillBackground, findChild, findNearestChild, findNextFocusControl, getBorderRadius, getChildren, getChildrenCount, getFirstChild, getFocusableControls, getInsets, incLastX, incLastY, 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, willOpenKeyboardpublic static int percIcon
public static int percCap
protected Control[] items
protected int selected
public boolean autoClose
public int totalTime
public int percWidth
popup().public int widthInPixels
public Image backImage
public int backImageAlpha
public Insets scInsets
public boolean drawSeparators
public int separatorColor
public boolean showElevation
public double itemHeightFactor
public Container header
public TopMenu(Control[] items, int animDir, byte borderStyle)
animDir - LEFT, RIGHT, TOP, BOTTOM, CENTERpublic TopMenu(Control[] items, int animDir)
animDir - LEFT, RIGHT, TOP, BOTTOM, CENTERpublic void popup()
Windowprotected void setRect(boolean screenResized)
public void initUI()
Containerpublic void onEvent(Event e)
Controlpublic void screenResized()
WindowscreenResized in class Windowprotected boolean onClickedOutside(PenEvent event)
WindowbeepIfOut
is true, then a beep is played and nothing more happens.onClickedOutside in class Windowpublic void unpop(TopMenu.AnimationListener alist)
alist - public void postUnpop()
Windowpublic void onPopup()
Windowprotected void postPopup()
Windowpublic int getSelectedIndex()
public boolean isFadeOnPopAndUnpop()
public void setFadeOnPopAndUnpop(boolean fadeOnPopAndUnpop)