|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
totalcross.lang.Objecttotalcross.ui.gfx.GfxSurface
totalcross.ui.Control
totalcross.ui.Container
totalcross.ui.ComboBox
totalcross.ui.ComboBoxEditable
public class ComboBoxEditable
The ComboBoxEditable is a control usually used as an Edit that holds old typed values. When the user types a word, it is automatically selected in the ComboBox. Here's a sample of how to use it:
totalcross.lang.String[] items = {"Ana","Barbara","Raul","Marcelo","Eduardo","Denise","Michelle","Guilherme","Vera","Dulce","Leonardo","Andre","Gustavo","Anne","Renato","Zelia","Helio"};
ComboBoxEditable cbe = new ComboBoxEditable(items);
cbe.qsort();
add(cbe, LEFT,BOTTOM-100);
| Field Summary | |
|---|---|
Edit |
edit
The edit used in this ComboBox. |
| Fields inherited from class totalcross.ui.ComboBox |
|---|
fullHeight, fullWidth, pop |
| Fields inherited from class totalcross.ui.Container |
|---|
alwaysEraseBackground, BORDER_LOWERED, BORDER_NONE, BORDER_RAISED, BORDER_SIMPLE, children, controlFound, finishedStart, ignoreOnAddAgain, ignoreOnRemove, insets, lastH, lastScreenWidth, lastW, lastX, lastY, nextTransitionEffect, started, tabOrder, tail, TRANSITION_CLOSE, TRANSITION_NONE, TRANSITION_OPEN, transitionEffect |
| Fields inherited from class totalcross.ui.Control |
|---|
AFTER, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, CENTER, CENTER_OF, clearValueInt, clearValueStr, enabled, enableUpdateScreen, FILL, FIT, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, foreColor, height, isHighlighting, KEEP, LEFT, onEventFirst, parent, PREFERRED, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, setFont, setH, setRel, setW, setX, setY, TOP, transparentBackground, uiCE, uiFlat, uiPalm, uiVista, visible, width, WILL_RESIZE, x, y |
| Constructor Summary | |
|---|---|
ComboBoxEditable()
|
|
ComboBoxEditable(ComboBoxDropDown userPopList)
|
|
ComboBoxEditable(ListBox userListBox)
|
|
ComboBoxEditable(Object[] items)
|
|
| Method Summary | |
|---|---|
void |
actionkeyPressed(KeyEvent e)
An ACTION_KEY_PRESS event was dispatched. |
void |
controlPressed(ControlEvent e)
A PRESSED event was dispatched. |
protected void |
drawSelectedItem(Graphics g)
|
void |
getFocusableControls(Vector v)
Get a list of child controls of this container which are focus candidates |
Control |
handleGeographicalFocusChangeKeys(KeyEvent ke)
Used by the main event loop to give the currently focused control an opportunity to act directly on the KeyEvent. |
void |
keyPressed(KeyEvent e)
A KEY_PRESS event was dispatched. |
protected void |
onBoundsChanged(boolean screenChanged)
Called after a setRect. |
protected 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. |
protected void |
onFontChanged()
Passes the font to the pop list |
void |
popup()
Pops up the ComboBoxDropDown |
void |
setAutoAdd(boolean on,
boolean keepSorted)
Set to true to add automatically new names that were typed in the edit. |
void |
specialkeyPressed(KeyEvent ke)
A SPECIAL_KEY_PRESS event was dispatched. |
void |
unpop()
Closes the open ListBox. |
| Methods inherited from class totalcross.ui.ComboBox |
|---|
add, add, add, add, clear, enableHorizontalScroll, getItemAt, getItems, getListBox, getPreferredHeight, getPreferredWidth, getSelectedIndex, getSelectedItem, indexOf, insert, onPaint, qsort, qsort, remove, remove, remove, removeAll, selectLast, setBackForeItemColors, setCursorColor, setItemAt, setSelectedIndex, setSelectedItem, setSelectedItemStartingWith, size, updatePopRect |
| Methods inherited from class totalcross.ui.Container |
|---|
add, add, add, add, broadcastEvent, findChild, findNearestChild, findNextFocusControl, getBorderStyle, getChildren, getClientRect, getClientRect, getInsets, incLastX, incLastY, initUI, onAddAgain, onRemove, paintChildren, resize, resizeHeight, resizeWidth, setBorderStyle, setEnabled, setHighlighting, setInsets, swapToTopmostWindow |
| Methods inherited from class totalcross.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Edit edit
| Constructor Detail |
|---|
public ComboBoxEditable()
public ComboBoxEditable(Object[] items)
public ComboBoxEditable(ListBox userListBox)
public ComboBoxEditable(ComboBoxDropDown userPopList)
| Method Detail |
|---|
public void setAutoAdd(boolean on,
boolean keepSorted)
on - Flag indicating if autoAdd must be setkeepSorted - If the list must be sorted after a new item is added by the autoAdd.protected void onFontChanged()
ComboBox
onFontChanged in class ComboBoxprotected void onColorsChanged(boolean colorsChanged)
Control
onColorsChanged in class ComboBoxprotected void onBoundsChanged(boolean screenChanged)
Control
onBoundsChanged in class ComboBoxscreenChanged - If the bounds were changed due to a screen change (rotation, collapse)public void onEvent(Event e)
Control
onEvent in class ComboBoxe - the event to processEvent,
KeyEvent,
PenEventpublic void popup()
ComboBox
popup in class ComboBoxpublic void unpop()
unpop in class ComboBoxprotected void drawSelectedItem(Graphics g)
drawSelectedItem in class ComboBoxpublic void controlPressed(ControlEvent e)
PressListener
controlPressed in interface PressListenerControlEventpublic void actionkeyPressed(KeyEvent e)
KeyListener
actionkeyPressed in interface KeyListenerKeyEventpublic void keyPressed(KeyEvent e)
KeyListener
keyPressed in interface KeyListenerKeyEventpublic void specialkeyPressed(KeyEvent ke)
KeyListener
specialkeyPressed in interface KeyListenerKeyEventpublic void getFocusableControls(Vector v)
Container
getFocusableControls in class ComboBoxv - A vector into which to add the focus candidates.public Control handleGeographicalFocusChangeKeys(KeyEvent ke)
Control
handleGeographicalFocusChangeKeys in class ComboBoxke - The KeyEvent to be processed
Settings.geographicalFocus
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||