ewe.ui
Class MenuChoice

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.ChoiceControl
              extended byewe.ui.mChoice
                  extended byewe.ui.MenuChoice
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, ImageRefresher, Intable, PopupController, TimerProc, UIConstants

public class MenuChoice
extends mChoice

A MenuChoice is a type of mChoice which uses a full Menu for the drop down slection which can have submenus. This is in contrast to an mChoice which cannot have submenus in its drop-down selector.


Field Summary
 
Fields inherited from class ewe.ui.mChoice
alwaysDrop, dontAllowKeyChangeChoice, dontSearchForKeys, dropButtonBorder, dropButtonOnly, dropMenuRows, dropX, menu, MENU_FULL_WIDTH, MENU_SHOW_TITLE_ALWAYS, MENU_SHOW_TITLE_IF_EXPANDED, MENU_WINDOW_WIDTH_ON_PDA, menuFont, menuFrame, menuOptions, mustAlwaysDrop, useScrollBarSize
 
Fields inherited from class ewe.ui.ChoiceControl
blockColor, blockSelected, calculateWidth, clipBuffer, container, dimRect, displayRows, dontAutoScroll, dropDownButton, dummyItem, firstItem, INDENT_ITEM_FLAG, indentDropItems, innerRect, isAList, isSingleLine, itemHeight, items, newClip, notifyDataChangeOnSelect, noWrapAround, selectedIndex, shortenItems, spacing, useMenuItems, xOffset, 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.PopupController
CLOSE_FOR_NEW_POPUP, FLAG_NEW_POPUP_IS_MENU
 
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
MenuChoice()
           
 
Method Summary
protected  String getDisplayString()
           
 Object getSelectedItem()
          Find the MenuItem that is currently selected.
 String getText()
          Return the current text.
 void onEvent(Event ev)
           
 void selectItem(String txt)
          This method will select a particular item only if it is a valid choice.
 void setSelectedItem(MenuItem m)
           
 void setText(String txt)
          This sets the text for the MenuChoice, regardless of if it is a valid choice.
 
Methods inherited from class ewe.ui.mChoice
calculateSizes, closePopup, createMenu, doAction, doActionKey, doDropMenu, doPaint, getDisplayRows, getDropMenuRect, getMenuFontMetrics, getNewMenu, gotFocus, lostFocus, noMenu, notifyAction, onKeyEvent, penPressed, penReleased, set, willShowFrame
 
Methods inherited from class ewe.ui.ChoiceControl
addItem, addItems, addSection, centerSelected, changeItem, changeModifiers, checkOnlyOne, deleteItem, doPaintData, findItem, findKeyed, getBlockColor, getDataRect, getInt, getItemAt, getItemHeight, getItemToAdd, getMenuHeight, getMenuWidth, getMenuWidth, getScreenRows, indexOf, insertItemAt, isSelected, itemIsVisible, itemsSize, make, makeItemVisible, makeVisible, modifyItems, notifySelection, paintBox, paintItem, paintItem, refresh, removeAll, repaintItem, select, select, selectItem, selectItems, selectNext, selectOrUnselect, selectPrev, setData, setInt, trySelectItem, updateItems
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, doBackground, doBorder, doHotKey, doMenu, dontAcceptDrop, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getNextKeyFocus, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penHeld, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, removeListener, removeTimer, repaint, repaintDataNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, resizeTo, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFocus, takeFromClipboard, takePromptControl, testDim, ticked, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 

Constructor Detail

MenuChoice

public MenuChoice()
Method Detail

getText

public String getText()
Return the current text. This will be an empty String if nothing is selected.

Overrides:
getText in class ChoiceControl

setText

public void setText(String txt)
This sets the text for the MenuChoice, regardless of if it is a valid choice. Use selectItem() to select an item only if it is a valid choice.

Overrides:
setText in class ChoiceControl

selectItem

public void selectItem(String txt)
This method will select a particular item only if it is a valid choice.

Overrides:
selectItem in class ChoiceControl

getSelectedItem

public Object getSelectedItem()
Find the MenuItem that is currently selected. Unlike the ChoiceControl.getSelectedItem() this does not use the selectedIndex field and always returns a MenuItem object.

Overrides:
getSelectedItem in class ChoiceControl

setSelectedItem

public void setSelectedItem(MenuItem m)

getDisplayString

protected String getDisplayString()
Overrides:
getDisplayString in class ChoiceControl

onEvent

public void onEvent(Event ev)
Specified by:
onEvent in interface EventListener
Overrides:
onEvent in class mChoice