|
||||||||||
| 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.EditControl
ewe.ui.mInput
An mInput is a single line input.
Call getText() and setText() to get/set the text data.
Set isPassword true to indicate that '*' characters should be displayed instead of the input text.
Change the columns value to increase the preferred width of the input. This value is measured in characters.
| Field Summary | |
protected static ImageBuffer |
blockBuffer
|
int |
clicksToFireAction
You can have the mInput fire an action event when the user single clicks the mInput by setting this value to 1, or double clicks by setting the value to 2. |
protected boolean |
cursorOn
|
protected int |
cursorPos
|
static int |
DATA_CHANGED_BY_ENTER
This is a flag used with a generated DataChangeEvent to indicate that the data was changed by the enter key being pressed. |
boolean |
dataChangeOnEachKey
If this is true then a DataChange will be fired on each key. |
protected int |
endSel
|
protected boolean |
hasCursor
|
static String |
hidden
This String will be used to display characters when the isPassword option is used. |
static int |
inputEdge
This is the default edge to use on mInputs. |
boolean |
isPassword
Set this true so that only '*' characters are displayed. |
protected static ImageBuffer |
itemBuffer
|
protected int |
leftMost
|
int |
maxLength
This is the maximum number of allowed characters, a value of -1 (the default) puts no limit on the number of characters. |
int |
minXScroll
A percent figure. |
protected int |
numDisplayed
|
char |
passwordCharacter
This is the password character to use for the input. |
int |
spacing
|
protected int |
startSel
|
boolean |
wantReturn
If this is true then the mInput will fire an action event when enter is pressed, but will not automatically pass focus to the next control as it would usually do. |
| Fields inherited from class ewe.ui.EditControl |
blinkId, CASE_LOWER, CASE_NORMAL, CASE_NUMBERS, CASE_SENTENCE, CASE_UPPER, colors, conditionalChar, conditionalCharIndex, doingLocalInput, doingNativeInput, FLAG_INPUT_ON_FOCUS, FLAG_KEEP_FOCUS_AFTER_INPUT, FLAG_PASSIVE, FLAG_USE_NATIVE, inFocus, inputFlags, inputMethod, justGotFocus, oldText, pageColor, startNativeOnPaint, textCase, validator |
| 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 | |
mInput()
|
|
mInput(String txt)
|
|
| Method Summary | |
boolean |
acceptsData(Object data,
DragContext how)
This should indicate whether this control will accept the data either via a drag and drop or via a paste operation. |
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control. |
void |
cursorToEnd()
|
boolean |
deleteSelection()
|
protected void |
doDragAt(Point p)
|
void |
doPaint(Graphics g,
Rect area)
|
protected void |
doPaintData(Graphics gr)
Repaint the "data" part of the Control. |
protected boolean |
doShowMenu(Point p)
Used to show the menu associated with the Control. |
void |
dragged(DragContext dc)
This is called during the drag operation. |
int |
findPressedChar(Point where)
|
protected boolean |
fix()
|
protected boolean |
getCharRect(int which,
Rect dest)
|
int |
getCursorPosition()
|
protected Rect |
getDataRect(Rect dest)
Get the rectangle, relative to the Control, of the area considered to be the "data" part of the control. |
String |
getDisplay(String s)
This gets the String to represent on screen the data String provided. |
char |
getPasswordCharacter()
If isPassword is false, this returns 0, otherwise it will return the password character to use for display. |
Object |
getSelection()
|
Range |
getSelectionRange()
Use this to get the selection range. |
void |
gotFocus(int how)
|
boolean |
hasSelection()
|
void |
lostFocus(int how)
|
protected void |
moveCursorPos(int where,
boolean takeSelection)
|
protected void |
newCursorPos(int where)
|
protected void |
newCursorPos(int where,
boolean takeSelection)
|
void |
newText(String what,
int newCursorPos)
|
void |
newText(String what,
int newCursorPos,
boolean repaintAll)
|
boolean |
noSelection()
|
void |
onEvent(Event ev)
|
void |
onKeyEvent(KeyEvent ev)
|
boolean |
paintConditionalChar(Graphics gr,
boolean underlined)
|
void |
paintCursor(Graphics gr)
|
boolean |
paintLastChar(Graphics g)
|
boolean |
paintLastChar(Graphics g,
boolean eraseIt)
|
void |
penDoubleClicked(Point where)
Called if the Pen or Mouse button is double clicked on the Control. |
void |
penPressed(Point where)
Called when the Pen or Mouse button is pressed on the control. |
void |
penReleased(Point where)
Called when the Pen or Mouse button is released on the control. |
protected void |
popupMenuClosed(Menu m)
This gets closed after the popup menu for the Control has closed. |
boolean |
replaceSelection(Object with)
|
void |
resizeTo(int width,
int height)
This will change the width and height values. |
void |
selectAll()
|
protected void |
setNativeInputFlags(TextInputParameters tip)
|
void |
setText(String txt)
|
void |
startDragging(DragContext dc)
This is called to indicate the start of a pen/mouse drag operation. |
protected void |
startLocalInput(boolean selectAll)
|
void |
stopActiveInput()
|
protected void |
stopAllInput()
|
void |
ticked(int id,
int elapsed)
|
void |
update()
|
void |
updateText(boolean generateEvent)
|
protected void |
updateText(boolean generateEvent,
boolean fromEnter)
|
boolean |
validateText(String what)
This is used to validate any new text. |
| Methods inherited from class ewe.ui.EditControl |
checkInputMethod, checkSipCoverage, dataBeingRemoved, dataTransferCancelled, fixCase, getBestPassiveFlags, getColors, hasChanged, keepConditionalChar, onControlEvent, setConditionalChar, startActiveInput, startNativeInput, takeData, updateData |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Field Detail |
public int spacing
public int minXScroll
public boolean isPassword
public int clicksToFireAction
public int maxLength
public boolean wantReturn
public boolean dataChangeOnEachKey
public static int inputEdge
public static final int DATA_CHANGED_BY_ENTER
protected int leftMost
protected int numDisplayed
protected int startSel
protected int endSel
protected int cursorPos
protected boolean cursorOn
protected boolean hasCursor
public char passwordCharacter
public static String hidden
protected static ImageBuffer itemBuffer
protected static ImageBuffer blockBuffer
| Constructor Detail |
public mInput()
public mInput(String txt)
| Method Detail |
protected boolean doShowMenu(Point p)
Control
doShowMenu in class Controlp - The point where the pen was pressed.
protected void popupMenuClosed(Menu m)
Control
popupMenuClosed in class Controlpublic void setText(String txt)
setText in class Controlprotected void calculateSizes()
Control
calculateSizes in class Controlpublic void cursorToEnd()
protected Rect getDataRect(Rect dest)
Control
getDataRect in class Controldest - The destination rectangle.
protected boolean getCharRect(int which,
Rect dest)
public void ticked(int id,
int elapsed)
ticked in interface TimerProcticked in class Controlpublic void gotFocus(int how)
gotFocus in class Controlprotected void stopAllInput()
public void lostFocus(int how)
lostFocus in class Controlpublic void stopActiveInput()
public void updateText(boolean generateEvent)
protected void updateText(boolean generateEvent,
boolean fromEnter)
public char getPasswordCharacter()
getPasswordCharacter in class Controlpublic String getDisplay(String s)
s - The data String to display.protected void doPaintData(Graphics gr)
Control
doPaintData in class Controlgr - The Graphics object to paint to.
public void doPaint(Graphics g,
Rect area)
doPaint in class Controlpublic void paintCursor(Graphics gr)
public boolean paintLastChar(Graphics g)
public boolean paintLastChar(Graphics g,
boolean eraseIt)
public boolean paintConditionalChar(Graphics gr,
boolean underlined)
paintConditionalChar in class EditControlprotected boolean fix()
public boolean validateText(String what)
public void newText(String what,
int newCursorPos)
public void newText(String what,
int newCursorPos,
boolean repaintAll)
protected void moveCursorPos(int where,
boolean takeSelection)
protected void newCursorPos(int where,
boolean takeSelection)
protected void newCursorPos(int where)
public boolean deleteSelection()
deleteSelection in interface Selectablepublic boolean replaceSelection(Object with)
replaceSelection in interface Selectablepublic Object getSelection()
getSelection in interface Selectableprotected void startLocalInput(boolean selectAll)
startLocalInput in class EditControlprotected void setNativeInputFlags(TextInputParameters tip)
setNativeInputFlags in class EditControlpublic void onKeyEvent(KeyEvent ev)
onKeyEvent in class Controlpublic int findPressedChar(Point where)
public boolean hasSelection()
hasSelection in interface Selectablepublic void selectAll()
selectAll in class EditControlpublic boolean noSelection()
noSelection in interface Selectablepublic void penPressed(Point where)
ControlWithin this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
penPressed in class Controlwhere - The point on the Control where the pen was pressed.public void penReleased(Point where)
ControlWithin this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
penReleased in class Controlwhere - The point on the Control where the pen was released.public void penDoubleClicked(Point where)
ControlWithin this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
By default this method simply calls the penClicked() method.
penDoubleClicked in class Controlwhere - The point on the Control where the pen was double-clicked.public void startDragging(DragContext dc)
Control
startDragging in class Controldc - A DragContext indicating information about the dragging.public void dragged(DragContext dc)
Control
dragged in class Controldc - The DragContext for the dragging operation.protected void doDragAt(Point p)
public void resizeTo(int width,
int height)
Control
resizeTo in class Control
public boolean acceptsData(Object data,
DragContext how)
Control
acceptsData in class EditControlpublic void update()
update in class EditControlpublic Range getSelectionRange()
public int getCursorPosition()
public void onEvent(Event ev)
onEvent in interface EventListeneronEvent in class Control
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||