public class MultiButton extends Control
MultiButton b = new MultiButton(new String[]{"+","-"}); b.setBackColor(Color.CYAN); add(b,LEFT+50,TOP+50,200,FONTSIZE+150);
Control.TranslucentShape
Modifier and Type | Field and Description |
---|---|
int |
divColor
The color used to divide the texts.
|
boolean |
is3dText
Defines if the text will have a 3d style.
|
boolean |
isSticky
Set to true to behave like a Radio, false like a Button
|
int |
selColor
The selection color.
|
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 |
---|
MultiButton(java.lang.String[] captions)
Constructs a MultiButton with the given captions.
|
Modifier and Type | Method and Description |
---|---|
int |
getEffectH() |
int |
getEffectW() |
int |
getEffectX() |
int |
getEffectY() |
int |
getPreferredHeight()
Returns the preferred height of this control.
|
int |
getPreferredWidth()
Returns the preferred width of this control.
|
int |
getSelectedIndex()
Returns the selected index
|
boolean |
isEnabled(int idx)
Returns if a caption is enabled or not
|
void |
onBoundsChanged(boolean colorsChanged)
Called after a setRect.
|
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)
Called to process key, pen, control and other posted events.
|
void |
onPaint(Graphics g)
Called to draw the control.
|
void |
setEnabled(int idx,
boolean enabled)
Enables or disables a caption
|
void |
setSelectedIndex(int sel)
Sets the selected index, or -1 to unset it.
|
_onEvent, addEnabledStateListener, addFocusListener, addFontChangeHandler, addGridListener, addHandler, addHighlightListener, addKeyListener, addListContainerListener, addMouseListener, addMultiTouchListener, addPenListener, addPressListener, addPushNotificationListener, addSizeChangeHandler, addTimer, addTimer, addTimerListener, addValueChangeHandler, addWindowListener, bringToFront, changeHighlighted, clear, contains, drawTranslucentBackground, getAbsoluteRect, getBackColor, getDoEffect, 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, onFontChanged, onWindowPaintFinished, post, postEvent, postPressedEvent, 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, setEnabled, setFloating, setFocusLess, setFont, setForeColor, setNinePatch, setNinePatch, setRect, setRect, setRect, setRect, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboard
public int divColor
public int selColor
public boolean is3dText
public boolean isSticky
public MultiButton(java.lang.String[] captions)
public void onColorsChanged(boolean colorsChanged)
Control
onColorsChanged
in class Control
public void onBoundsChanged(boolean colorsChanged)
Control
onBoundsChanged
in class Control
colorsChanged
- If the bounds were changed due to a screen change (rotation, collapse)public void setSelectedIndex(int sel)
public void setEnabled(int idx, boolean enabled)
public boolean isEnabled(int idx)
public int getSelectedIndex()
public void onPaint(Graphics g)
Control
public int getEffectW()
getEffectW
in class Control
public int getEffectH()
getEffectH
in class Control
public int getEffectX()
getEffectX
in class Control
public int getEffectY()
getEffectY
in class Control
public void onEvent(Event e)
Control
public int getPreferredHeight()
Control
getPreferredHeight
in class Control
public int getPreferredWidth()
Control
getPreferredWidth
in class Control