|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--waba.ui.Control
|
+--extra.ui.List
This is a standard palm drop down list. It normally displays a down arrow followed by the currently selected item. When it is tapped it will drop down a list of all the options. When one of these is tapped, the list will fold back up with the new option displayed. A PRESSED event is also propogated down the hierachy. The selected string get be obtained with getSelected() and it's index with getSelectedIndex(). Items can be added to the list with the add() method.
| Constructor Summary | |
List()
Construct a new empty list of default size |
|
List(String[] options)
Construct a new list with the given options |
|
List(Vector options)
Construct a new list with the given options |
|
| Method Summary | |
void |
add(String name)
Add a new option to the end of the list |
boolean |
calcSizes()
|
void |
drawList(Graphics g)
|
int |
getPreferredHeight(FontMetrics fm)
|
int |
getPreferredWidth(FontMetrics fm)
|
String |
getSelected()
Gets the text of the currently selected item |
int |
getSelectedIndex()
Get the index of the currently selected option |
void |
onEvent(Event event)
Process pen and key events to this component |
void |
onPaint(Graphics g)
Called to draw the control. |
void |
setSelectedIndex(int i)
Sets the currently selected index |
| Methods inherited from class waba.ui.Control |
addTimer, contains, createGraphics, getFontMetrics, getNext, getParent, getRect, postEvent, removeTimer, repaint, setRect |
| Methods inherited from class java.lang.Object |
equals, hashCode, toString |
| Constructor Detail |
public List()
public List(String[] options)
options - an array of the choices availablepublic List(Vector options)
options - a vector of the choices available| Method Detail |
public void add(String name)
name - the option to addpublic String getSelected()
public int getSelectedIndex()
public void setSelectedIndex(int i)
i - the index of the item to selectpublic int getPreferredWidth(FontMetrics fm)
getPreferredWidth in interface PreferredSizepublic int getPreferredHeight(FontMetrics fm)
getPreferredHeight in interface PreferredSizepublic boolean calcSizes()
public void onPaint(Graphics g)
ControlonPaint in class Controlwaba.ui.Controlg - the graphics object for drawingGraphicspublic void drawList(Graphics g)
public void onEvent(Event event)
onEvent in class Controlevent - the event to process
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||