public class ButtonMenu extends ScrollContainer implements PressListener
pagePositionDisposition
Control.TranslucentShape
Modifier and Type | Field and Description |
---|---|
int |
borderColor3DG |
int |
borderGap
The gap between the text or image and the button borders, in percentage of the font's height.
|
byte |
borderType |
int |
borderWidth3DG |
int |
bottomColor3DG |
int |
buttonHorizGap
The gap between two horizontal buttons, in percentage of the font's height.
|
int |
buttonVertGap
The gap between two vertical buttons, in percentage of the font's height.
|
int |
cornerRadius3DG |
int |
imageSize
The size of the image, in percentage of the font's height.
|
static int |
MULTIPLE_HORIZONTAL
Used in the disposition member of the constructor.
|
static int |
MULTIPLE_VERTICAL
Used in the disposition member of the constructor.
|
static int |
NO_PAGEPOSITION
Used in the pagePositionDisposition.
|
protected PagePosition |
pagepos
The control that keeps track of the current position.
|
static int |
PAGEPOSITION_AT_BOTTOM
Used in the pagePositionDisposition.
|
static int |
PAGEPOSITION_AT_TOP
Used in the pagePositionDisposition.
|
int |
pagePositionDisposition
If disposition is a MULTIPLE_HORIZONTAL, set how the PagePosition will replace the ScrollPosition control.
|
int |
pressedColor |
static int |
SINGLE_COLUMN
Used in the disposition member of the constructor.
|
static int |
SINGLE_ROW
Used in the disposition member of the constructor.
|
int |
textGap
The gap between the image and the text, in percentage of the font's height.
|
int |
textPosition
Where to place the text (supports only LEFT, TOP, RIGHT, BOTTOM, CENTER - no adjustments!).
|
int |
topColor3DG |
autoScroll, bag, bag0, disabledFlick, flick, hsIgnoreAutoScroll, lastH, lastV, sbH, sbV, shrink2size
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, lastScreenWidth, lastW, lastX, lastY, 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 |
---|
ButtonMenu(Image[] images,
int disposition)
Constructs an ButtonMenu with the giving images and no names.
|
ButtonMenu(Image[] images,
java.lang.String[] names,
int disposition)
Constructs an ButtonMenu with the giving images ant names.
|
ButtonMenu(java.lang.String[] names,
int disposition)
Constructs an ButtonMenu with the giving names and no images.
|
Modifier and Type | Method and Description |
---|---|
void |
controlPressed(ControlEvent e)
A PRESSED event was dispatched.
|
protected Button |
createButton(java.lang.String name,
Image img,
int textPosition,
int tg) |
Button |
getButton(int idx)
Returns the button at the given index.
|
int |
getPreferredHeight()
Returns the preferred height as if all images were in a single row.
|
int |
getPreferredHeight(int rows)
Returns the preferred height for the given number of rows.
|
int |
getPreferredWidth()
Returns the preferred width as if all images were in a single row.
|
int |
getPreferredWidth(int cols)
Returns the preferred width for the given number of columns.
|
int |
getSelectedIndex() |
void |
initUI()
Called to initialize the User Interface of this container.
|
void |
onFontChanged()
Creates and resizes all Button and images.
|
void |
replaceWith(Image[] images,
java.lang.String[] names)
Changes all the buttons to the given parameters.
|
void |
reposition()
Reposition this control, calling again setRect with the original parameters.
|
add, addScrollEventHandler, bagSetRect, canScrollContent, canShowScrollBars, disableFlick, enableFlick, flickEnded, flickStarted, getBagChildren, getBagInitialHeight, getBagInitialWidth, getClientRect, getFlick, getRealClientRect, getScrollDistance, getScrollPosition, moveFocusToNextControl, onBoundsChanged, onColorsChanged, onEvent, onPaint, remove, removeAll, removeScrollEventHandler, resize, resize, scrollContent, scrollPage, scrollToControl, scrollToOrigin, scrollToPage, setBorderStyle, setHandlersVisibility, setHandlersVisibility, setHValue, setScrollBars, setVValue, updateListenerTriggered, wasScrolled
add, add, add, add, broadcastEvent, clear, fillBackground, findChild, findNearestChild, findNextFocusControl, getBorderRadius, getBorderStyle, getChildren, getChildrenCount, getClientRect, getFirstChild, getFocusableControls, getInsets, incLastX, incLastY, isPressed, moveFocusToNextEditable, onAddAgain, onRemove, onSwapFinished, paintChildren, resizeHeight, resizeWidth, 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, isTopMost, isVisible, isVisibleAndInside, onWindowPaintFinished, post, postEvent, postPressedEvent, releaseScreenShot, removeEnabledStateListener, removeFocusListener, removeGridListener, removeHandler, removeHighlightListener, removeKeyListener, removeListContainerListener, removeMouseListener, removeMultiTouchListener, removePenListener, removePressListener, removePushNotificationListener, removeTimer, removeTimerListener, removeWindowListener, repaint, repaintNow, 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 PagePosition pagepos
public int textGap
public int buttonVertGap
public int buttonHorizGap
public int imageSize
public int borderGap
public static final int PAGEPOSITION_AT_BOTTOM
public static final int PAGEPOSITION_AT_TOP
public static final int NO_PAGEPOSITION
public int pagePositionDisposition
PAGEPOSITION_AT_BOTTOM
,
PAGEPOSITION_AT_TOP
,
NO_PAGEPOSITION
public int textPosition
public byte borderType
Button.setBorder(byte)
public int cornerRadius3DG
Button.cornerRadius3DG
public int borderWidth3DG
Button.borderWidth3DG
public int borderColor3DG
Button.borderColor3DG
public int topColor3DG
Button.topColor3DG
public int bottomColor3DG
Button.bottomColor3DG
public int pressedColor
Button.setPressedColor(int)
public static final int SINGLE_COLUMN
public static final int SINGLE_ROW
public static final int MULTIPLE_HORIZONTAL
public static final int MULTIPLE_VERTICAL
public ButtonMenu(Image[] images, int disposition)
SINGLE_COLUMN
,
SINGLE_ROW
,
MULTIPLE_HORIZONTAL
,
MULTIPLE_VERTICAL
public ButtonMenu(java.lang.String[] names, int disposition)
SINGLE_COLUMN
,
SINGLE_ROW
,
MULTIPLE_HORIZONTAL
,
MULTIPLE_VERTICAL
public ButtonMenu(Image[] images, java.lang.String[] names, int disposition)
SINGLE_COLUMN
,
SINGLE_ROW
,
MULTIPLE_HORIZONTAL
,
MULTIPLE_VERTICAL
public void replaceWith(Image[] images, java.lang.String[] names)
public Button getButton(int idx)
public void onFontChanged()
onFontChanged
in class ScrollContainer
protected Button createButton(java.lang.String name, Image img, int textPosition, int tg)
public void initUI()
Container
public void reposition()
Control
reposition
in class ScrollContainer
public int getPreferredWidth()
getPreferredWidth
in class ScrollContainer
public int getPreferredWidth(int cols)
public int getPreferredHeight()
getPreferredHeight
in class ScrollContainer
public int getPreferredHeight(int rows)
add(ib2,LEFT+10,CENTER,FILL-10,ib2.getPreferredHeight(4));
public int getSelectedIndex()
public void controlPressed(ControlEvent e)
PressListener
controlPressed
in interface PressListener
ControlEvent