|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--waba.ui.Control
|
+--waba.ui.ToolTip
ToolTip : Allows to display a tooltip when user keeps the pen in the control.
The default popup delay is 1000ms and the amount of time it will be displayed is
2000ms (a pen up also hides the control).
The tooltip must always be added after the control is added and had its
bounds set; otherwise, you must call the added method to initialize
the tip's bounds.
You can set the border color by changing the borderColor member (no border by default)
and also the internal gap (see member insideGap).
The static members distX and distY lets you set the default distance from the control for all tooltips. It must be set before the tooltip is created.
Example :The tooltip can have multiple lines, separing them using the char '|' in your message.
ToolTip.distX = 10; // 0 by default ToolTip.distY = 4; // 0 by default ToolTip.insideGap = 8; // 4 by default Button b; add(b = new Button("Hello Tooltip!"),CENTER,BOTTOM);
ToolTip t = new ToolTip(b, "Hi, this is a button");
t.borderColor = new Color(0,255,0); // null/none by default t.millisDelay = 500; // 1000 by default t.millisDisplay = 4000; // 2000 by default t.setBackColor(new Color(250,0,0)); // same as control's container by default
ToolTip t = new ToolTip(control, "Hi!|It's Me");A ControlEvent.PRESSED event will be dispatched to the attached control right before the text is shown.
| Field Summary | |
Color |
borderColor
The border color. |
static int |
distX
The x distance between the tip and the control, 0 by default. |
static int |
distY
The y distance between the tip and the control, 0 by default. |
static int |
insideGap
The gap between the border and the text. |
int |
millisDelay
The amount of time that the pen must be down until the tip pops up (by default, 1000ms) |
int |
millisDisplay
The mount of time that the tip will be shown (by default, 2000ms) |
| Fields inherited from class waba.ui.Control |
AFTER,
appId,
appObj,
asContainer,
asWindow,
backColor,
backDis,
BEFORE,
BOTTOM,
CENTER,
clearValueInt,
clearValueStr,
enabled,
FILL,
FIT,
fm,
fmH,
focusLess,
focusTraversable,
font,
foreColor,
foreDis,
height,
highlightRectsCount,
isHighlighting,
LEFT,
parent,
PREFERRED,
RANGE,
RIGHT,
SAME,
TOP,
uiCE,
uiFlat,
uiPalm,
uiVista,
visible,
width,
x,
x2,
y,
y2 |
| Constructor Summary | |
ToolTip(Control control,
java.lang.String message)
Constructor |
|
| Method Summary | |
void |
added()
Set up the bounds for when we popup |
void |
onEvent(Event e)
Called to process key, pen, control and other posted events. |
void |
setBackColor(Color c)
Pass the color to the label, since we're invisible |
void |
setControlRect(Rect r)
Change the control rect to the given one. |
void |
setForeColor(Color c)
Pass the color to the label, since we're invisible |
void |
setText(java.lang.String newText)
Sets the text of the tooltip. |
| Methods inherited from class waba.ui.Control |
addTimer,
changeHighlighted,
clear,
contains,
createGraphics,
drawHighlight,
getAbsoluteRect,
getBackColor,
getFont,
getFontMetrics,
getForeColor,
getNext,
getParent,
getParentWindow,
getPos,
getPreferredHeight,
getPreferredWidth,
getRect,
getSize,
isDisplayed,
isEnabled,
isVisible,
onBoundsChanged,
onColorsChanged,
onFontChanged,
onPaint,
onWindowPaintFinished,
postEvent,
removeTimer,
repaint,
repaintNow,
requestFocus,
setBackForeColors,
setEnabled,
setFocusLess,
setFont,
setRect,
setRect,
setRect,
setVisible,
translateFromOrigin,
uiStyleChanged |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static int insideGap
public static int distX
public static int distY
public int millisDelay
public int millisDisplay
public Color borderColor
| Constructor Detail |
public ToolTip(Control control,
java.lang.String message)
control - the control which supports the tipmessage - the message which will be written in the tip. You can
make multiLine, using | character like in the Label control.| Method Detail |
public void added()
public void setForeColor(Color c)
public void setBackColor(Color c)
public void setText(java.lang.String newText)
setControlRect(control.getAbsoluteRect());public void setControlRect(Rect r)
public void onEvent(Event e)
event - the event to processEvent,
KeyEvent,
PenEvent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||