|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.ui.ControlBase
ewe.ui.Control
ewe.ui.ChoiceControl
This is a BaseClass for mChoice and Menu controls.
| Field Summary | |
Color |
blockColor
If this is null then the Foreground color will be used. |
protected boolean |
blockSelected
|
boolean |
calculateWidth
|
protected static Rect |
clipBuffer
|
Control |
container
|
protected static Rect |
dimRect
|
int |
displayRows
|
boolean |
dontAutoScroll
|
boolean |
dropDownButton
|
protected static MenuItem |
dummyItem
|
protected int |
firstItem
|
static int |
INDENT_ITEM_FLAG
|
boolean |
indentDropItems
|
protected static Rect |
innerRect
|
protected boolean |
isAList
|
protected boolean |
isSingleLine
|
int |
itemHeight
If you set this to a value >= 0 then this will be taken to be the fixed item height. |
Vector |
items
|
protected static Rect |
newClip
|
boolean |
notifyDataChangeOnSelect
This tells the control to generate a DataChangeEvent when the selection has changed. |
boolean |
noWrapAround
This applies to Menus. |
int |
selectedIndex
|
boolean |
shortenItems
|
int |
spacing
|
boolean |
useMenuItems
|
int |
xOffset
|
protected int |
xShift
|
| Fields inherited from class ewe.ui.Control |
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y |
| Fields inherited from class ewe.ui.ControlBase |
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput |
| Fields inherited from interface ewe.ui.UIConstants |
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN |
| Fields inherited from interface ewe.ui.CellConstants |
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST |
| Fields inherited from interface ewe.ui.ControlConstants |
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown |
| Fields inherited from interface ewe.fx.ImageRefresher |
KEEP_VISIBLE |
| Constructor Summary | |
ChoiceControl()
|
|
| Method Summary | |
MenuItem |
addItem(Object what)
Insert an item in the control. |
MenuItem[] |
addItems(String[] what)
This add items but does not update the screen. |
void |
addSection(Object[] items,
boolean separator)
Add a section to the list/menu. |
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control. |
boolean |
centerSelected()
|
void |
changeItem(int index,
Object newText)
Changes the text associated with an item. |
void |
changeModifiers(int toSet,
int toClear)
|
boolean |
checkOnlyOne(Object[] items,
Object toCheck,
boolean onlyIfInArray)
|
boolean |
deleteItem(int index)
Delete an item from the control. |
void |
doActionKey(int key)
|
void |
doPaint(Graphics gr,
Rect area)
|
protected void |
doPaintData(Graphics gr)
Repaint the "data" part of the Control. |
MenuItem |
findItem(String name,
boolean searchChildMenus)
|
protected int |
findKeyed(int start,
int key)
|
Color |
getBlockColor()
|
protected Rect |
getDataRect(Rect dest)
Get the rectangle, relative to the Control, of the area considered to be the "data" part of the control. |
int |
getDisplayRows()
|
protected String |
getDisplayString()
|
int |
getInt()
|
MenuItem |
getItemAt(int where)
|
protected int |
getItemHeight()
This is used to calculate the height of the line used for each item. |
protected Object |
getItemToAdd(Object forWhat)
|
int |
getMenuHeight()
|
protected int |
getMenuWidth()
|
int |
getMenuWidth(boolean subMenus,
boolean topLevel)
|
int |
getScreenRows()
|
Object |
getSelectedItem()
|
String |
getText()
|
int |
indexOf(Object what)
Find the index of this object. |
MenuItem |
insertItemAt(Object what,
int index)
Insert an item in the control. |
boolean |
isSelected(int idx)
|
boolean |
itemIsVisible(int row,
boolean isFullyVisible)
|
int |
itemsSize()
|
void |
make(boolean reMake)
This is used to "make" the control before being displayed. |
void |
makeItemVisible(int row)
This makes the item visible and updates the screen as well. |
boolean |
makeVisible(int row)
This places the item in the visible range but does not update the screen. |
void |
modifyItems(String[] items,
int switchOn,
int switchOff,
boolean searchChildMenus)
|
void |
notifySelection(int index,
int type)
|
protected void |
paintBox(Graphics g)
|
void |
paintItem(Graphics g,
int index)
|
void |
paintItem(Graphics graphics,
int index,
boolean checksOnly)
|
void |
refresh(IImage image,
int options)
The default version of this method simpy repaints the control - however for controls which may display multiple images a better refresh scheme would be needed. |
boolean |
removeAll()
Removes all items from the control. |
void |
repaintItem(int index)
|
void |
select(int which)
|
void |
select(int which,
boolean select)
|
void |
selectItem(int index,
boolean selected)
|
void |
selectItem(String label)
|
void |
selectItems(int first,
int last,
boolean selected)
|
void |
selectNext()
|
void |
selectOrUnselect(int item)
|
void |
selectPrev()
|
void |
setData(Object data)
Sets the data for the ChoiceControl. |
void |
setInt(int value)
|
void |
setText(String text)
|
boolean |
trySelectItem(String label)
|
void |
updateItems()
This updates the control to new choices added and then refreshes it on screen. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Field Detail |
protected boolean blockSelected
protected boolean isAList
protected boolean isSingleLine
public boolean useMenuItems
public boolean dropDownButton
public boolean calculateWidth
public boolean indentDropItems
public boolean shortenItems
public Vector items
public int spacing
public int xOffset
public int selectedIndex
public boolean dontAutoScroll
public Control container
public boolean noWrapAround
public static final int INDENT_ITEM_FLAG
public int itemHeight
public Color blockColor
public int displayRows
protected int firstItem
protected int xShift
protected static MenuItem dummyItem
protected static Rect clipBuffer
protected static Rect newClip
protected static Rect dimRect
protected static Rect innerRect
public boolean notifyDataChangeOnSelect
| Constructor Detail |
public ChoiceControl()
| Method Detail |
protected Rect getDataRect(Rect dest)
Control
getDataRect in class Controldest - The destination rectangle.
public Color getBlockColor()
public void modifyItems(String[] items,
int switchOn,
int switchOff,
boolean searchChildMenus)
public int itemsSize()
public int indexOf(Object what)
public MenuItem insertItemAt(Object what,
int index)
public Object getSelectedItem()
protected Object getItemToAdd(Object forWhat)
public MenuItem addItem(Object what)
public void setData(Object data)
public MenuItem[] addItems(String[] what)
public boolean deleteItem(int index)
public boolean removeAll()
public boolean trySelectItem(String label)
public void selectNext()
public void selectPrev()
public void notifySelection(int index,
int type)
public void doActionKey(int key)
doActionKey in class Control
public void select(int which,
boolean select)
public void select(int which)
public void setText(String text)
setText in class Controlpublic String getText()
getText in class Controlpublic void selectItem(String label)
public void selectItems(int first,
int last,
boolean selected)
public void selectItem(int index,
boolean selected)
public void changeItem(int index,
Object newText)
public int getDisplayRows()
public int getScreenRows()
protected void calculateSizes()
Control
calculateSizes in class Controlprotected int getMenuWidth()
public int getMenuWidth(boolean subMenus,
boolean topLevel)
public int getMenuHeight()
protected int getItemHeight()
After calculating the height it is stored in itemHeight so the next time it is called it will not calculate it again, but it will return the value of itemHeight instead.
To avoid any calculations at all, you can explicitly set itemHeight to a value >= 0.
public MenuItem getItemAt(int where)
public MenuItem findItem(String name,
boolean searchChildMenus)
public boolean checkOnlyOne(Object[] items,
Object toCheck,
boolean onlyIfInArray)
public void selectOrUnselect(int item)
public boolean isSelected(int idx)
protected void paintBox(Graphics g)
protected String getDisplayString()
public void repaintItem(int index)
public void paintItem(Graphics g,
int index)
public void paintItem(Graphics graphics,
int index,
boolean checksOnly)
protected void doPaintData(Graphics gr)
Control
doPaintData in class Controlgr - The Graphics object to paint to.
public void refresh(IImage image,
int options)
Control
refresh in interface ImageRefresherrefresh in class Controlimage - the image to refresh.options -
public void doPaint(Graphics gr,
Rect area)
doPaint in class Controlpublic void makeItemVisible(int row)
public boolean makeVisible(int row)
public boolean itemIsVisible(int row,
boolean isFullyVisible)
public boolean centerSelected()
public void changeModifiers(int toSet,
int toClear)
public void setInt(int value)
setInt in interface Intablepublic int getInt()
getInt in interface Intablepublic void make(boolean reMake)
Control
make in class ControlreMake - if this is true then you should do a full re-make.
public void addSection(Object[] items,
boolean separator)
items - the items to add.separator - set this to true if you want a separator before this section.
public void updateItems()
protected int findKeyed(int start,
int key)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||