|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.ui.Control | +--waba.ui.Container | +--superwaba.ext.xplat.ui.MultiEdit
MultiEdit is an Edit with support for multiple lines. A static scrollbar is added, but disabled/enabled as needed.
Here is an example showing an Edit control being used:
import superwaba.ext.xplat.ui.MultiEdit; public class MyProgram extends MainWindow { MultiEdit mEdit; public void onStart() { // the constructor method is called with the mask, the number of lines // and the vertical interval in pixel between two lines mEdit = new MultiEdit("",3,1); add(mEdit,LEFT,TOP); // add/setRect must precede setText mEdit.setText("What text you want"); //eventually } }
Field Summary | |
static char |
ENTER
|
int |
gap
|
boolean |
hasCursorWhenNotEditable
Set to false if you don't want the cursor to blink when the edit is not editable |
protected String |
mask
|
static MultiEditMenu |
menu
|
Fields inherited from class waba.ui.Container |
BORDER_LOWERED,
BORDER_NONE,
BORDER_RAISED,
BORDER_SIMPLE,
children,
lastH,
lastW,
lastX,
lastY,
parentWindow,
tail |
Fields inherited from class waba.ui.Control |
AFTER,
appId,
asContainer,
asWindow,
backColor,
backDis,
BEFORE,
BOTTOM,
CENTER,
enabled,
FILL,
FIT,
fm,
fmH,
focusLess,
font,
foreColor,
foreDis,
height,
LEFT,
parent,
PREFERRED,
RANGE,
RIGHT,
SAME,
TOP,
visible,
width,
x,
x2,
y,
y2 |
Constructor Summary | |
MultiEdit(int rowCount,
int spaceBetweenLines)
Constructor for a text Edit with a vertical scroll Bar, gap is 1 by default and control's bounds must be given with a setRect. |
|
MultiEdit(String mask,
int rowCount,
int spaceBetweenLines)
Constructor for a text Edit with a vertical scroll Bar, gap is 1 by default and control's bounds must be given with a setRect. |
Method Summary | |
protected void |
draw(Graphics g,
boolean cursorOnly)
|
int |
getNumberOfTextLines()
Gets total number of lines in the text |
int |
getPreferredHeight()
Returns the preffered height of this control. |
int |
getPreferredWidth()
Returns the preffered width of this control. |
String |
getText()
Returns the text displayed in the edit control. |
boolean |
isEditable()
Gets if the control accepts input from the user |
protected void |
onBoundsChanged()
Called after an 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 event)
Called by the system to pass events to the edit control. |
protected void |
onFontChanged()
Called after a setFont |
void |
onPaint(Graphics g)
Draws the border (if any). |
protected void |
onWindowPaintFinished()
Called after the window has finished a paint. |
protected void |
popPosState()
|
void |
popupKCC()
user method to popup the keyboard/calendar/calculator for this edit. |
void |
popupMenu()
|
protected void |
pushPosState()
|
void |
restoreText()
Restores the contents of this TextArea from the file MEme.PROV.DATA. |
void |
saveText()
Saves the contents of this TextArea to the file MEme.PROV.DATA. |
void |
setCapitaliseMode(byte cap)
Sets the capitalise settings for this MultiEdit. |
void |
setDrawDots(boolean on)
If true, a dotted line appears under each row of text (on by default) |
void |
setEditable(boolean on)
Sets if the control accepts input from the user |
void |
setKeyboard(byte kbd)
Used to change the default keyboard to be used with this Edit control. |
void |
setMaxLength(int length)
Sets the desired maximum length for text entered in the Edit. |
void |
setNumberOfRows(int rowCount)
Used to set the number of rows of this MultiEdit. |
void |
setRect(int x,
int y,
int width,
int height)
Sets the rect for this MultiEdit. |
void |
setText(String s)
Sets the text displayed in the edit control. |
void |
setValidChars(String validCharsString)
sets the valid chars that can be entered in this edit. if null is passed, any char can be entered. (case insensitive). added by guich |
Methods inherited from class waba.ui.Container |
add,
add,
add,
broadcastEvent,
findChild,
getChildren,
getClientRect,
onStart,
paintChildren,
remove,
setBorderStyle,
setEnabled |
Methods inherited from class waba.ui.Control |
addTimer,
contains,
createGraphics,
getAbsoluteRect,
getBackColor,
getFont,
getFontMetrics,
getForeColor,
getNext,
getParent,
getParentWindow,
getPos,
getRect,
getSize,
isDisplayed,
isEnabled,
isVisible,
postEvent,
removeTimer,
repaint,
repaintNow,
requestFocus,
setBackColor,
setBackForeColors,
setFocusLess,
setFont,
setForeColor,
setRect,
setRect,
setVisible |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
Field Detail |
public static final char ENTER
public boolean hasCursorWhenNotEditable
protected String mask
public static MultiEditMenu menu
public int gap
Constructor Detail |
public MultiEdit(int rowCount, int spaceBetweenLines)
public MultiEdit(String mask, int rowCount, int spaceBetweenLines)
Method Detail |
public int getPreferredHeight()
public int getPreferredWidth()
public void setKeyboard(byte kbd)
public void setDrawDots(boolean on)
public void setNumberOfRows(int rowCount)
public void setCapitaliseMode(byte cap)
public void setValidChars(String validCharsString)
public void setMaxLength(int length)
public String getText()
public void setText(String s)
public void saveText()
public void restoreText()
public void setEditable(boolean on)
public boolean isEditable()
public int getNumberOfTextLines()
public void popupKCC()
public void popupMenu()
protected void onBoundsChanged()
public void onEvent(Event event)
event
- the event to processEvent
,
KeyEvent
,
PenEvent
protected void draw(Graphics g, boolean cursorOnly)
protected void onWindowPaintFinished()
public void onPaint(Graphics g)
super.onPaint(g);
, or the border will not be drawn.g
- the graphics object for drawingGraphics
protected void pushPosState()
protected void popPosState()
protected void onColorsChanged(boolean colorsChanged)
public void setRect(int x, int y, int width, int height)
protected void onFontChanged()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |