public class ColorList extends ListBox
add(foreCombo = new ComboBox(new ColorList()), CENTER, BOTTOM);Consider using ColorChooserBox instead.
totalcross.ui#ColorChooserBox
Modifier and Type | Class and Description |
---|---|
static class |
ColorList.Item
Item added to the ListBox, containing the color as String and as int.
|
ListBox.CustomDrawingItem, ListBox.IconItem
Control.TranslucentShape
autoResizeIcon, back0, back1, btnX, btnX0, customCursorColor, dataCol, DEFAULT_ITEM_HEIGHT_FACTOR, drawBorder, EXTRA_HEIGHT_FACTOR, extraHorizScrollButtonHeight, flick, iconGap, iconSize, ihFactor, ihtBackColors, ihtForeColors, itemCount, itemHeightFactor, items, offset, paddingBottom, paddingLeft, paddingRight, paddingTop, sbar, selectedIndex, simpleBorder, tempSelectedIndex, useFullWidthOnSelection, visibleItems, visibleLines, xOffset
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, 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 |
---|
ColorList() |
Modifier and Type | Method and Description |
---|---|
protected void |
drawCursor(Graphics g,
int sel,
boolean on)
This method is used to draw the cursor around the desired item
|
protected void |
drawItem(Graphics g,
int index,
int dx,
int dy)
You can extend ListBox and overide this method to draw the items
|
protected void |
drawSelectedItem(Graphics g,
int index,
int dx,
int dy,
int w)
You can extend ListBox and overide this method to draw the items
|
protected int |
getItemWidth(int index)
Returns the width of the given item index with the current fontmetrics.
|
int |
getPreferredWidth()
Returns the preferred width, ie, the size of the largest item plus the size
of the scrollbar.
|
int |
getSelectedColor()
Returns the selected color or black if no one is selected.
|
java.lang.Object |
getSelectedItem()
Returns the selected Item object, or a black Item representing the black color if none was selected.
|
void |
setColors(int[] newColors)
Sets the colors that will be displayed.
|
add, add, add, add, addWrapping, canScrollContent, clear, drawItems, drawSelectedItem, enableHorizontalScroll, endSelection, find, flickEnded, flickStarted, getCursorColor, getEffectH, getEffectW, getEffectX, getEffectY, getFlick, getFocusableControls, getItemAt, getItemHeight, getItems, getItemsArray, getPreferredHeight, getScrollPosition, getSelectedIndex, getText, handleGeographicalFocusChangeKeys, handleSelection, hasIconItemLeft, hasIconItemRight, hideScrollBarIfNotNeeded, indexOf, insert, leftReached, onBoundsChanged, onColorsChanged, onEvent, onPaint, qsort, qsort, remove, remove, remove, removeAll, scrollContent, selectLast, selectLast, setCursorColor, setEnabled, setItemAt, setSelectedIndex, setSelectedIndex, setSelectedItem, setSelectedItemStartingWith, setSimpleBorder, setTextAreaClip, size, wasScrolled
add, add, add, add, broadcastEvent, fillBackground, findChild, findNearestChild, findNextFocusControl, getBorderRadius, getBorderStyle, getChildren, getChildrenCount, getClientRect, getClientRect, getFirstChild, getInsets, incLastX, incLastY, initUI, isPressed, moveFocusToNextControl, moveFocusToNextEditable, onAddAgain, onRemove, onSwapFinished, paintChildren, resize, resizeHeight, resizeWidth, setBorderRadius, setBorderStyle, 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, getEventListeners, getFont, getForeColor, getGap, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPressedEvent, getPrev, getRect, getSize, getTextShadowColor, getWidth, getX, getX2, getY, getY2, hadParentScrolled, 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, setFloating, setFocusLess, setFont, setForeColor, setNinePatch, setNinePatch, setRect, setRect, setRect, setRect, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboard
public void setColors(int[] newColors)
protected void drawItem(Graphics g, int index, int dx, int dy)
ListBox
protected void drawSelectedItem(Graphics g, int index, int dx, int dy, int w)
ListBox
drawSelectedItem
in class ListBox
protected void drawCursor(Graphics g, int sel, boolean on)
ListBox
drawCursor
in class ListBox
public int getPreferredWidth()
ListBox
getPreferredWidth
in class ListBox
protected int getItemWidth(int index)
ListBox
getItemWidth
in class ListBox
public java.lang.Object getSelectedItem()
getSelectedItem
in class ListBox
public int getSelectedColor()