Type Control
Extends
Widget.
RWT Scripting analog to org.eclipse.swt.widgets.Control. All controls given by
rap.getObject are instances of this type, even if their specific subtype is not
documented.
Method Attributes | Method Name and Description |
---|---|
addListener(type, listener)
Register the function as a listener of the given type
|
|
Forces the receiver to have the keyboard focus, causing
all keyboard events to be delivered to it.
|
|
Returns the receiver's background color.
|
|
Returns the receiver's cursor, or null if it has not been set.
|
|
Returns
true if the receiver is enabled, and
false otherwise. |
|
Returns the receiver's foreground color.
|
|
Returns the receiver's tool tip text, or null if it has
not been set.
|
|
Returns
true if the receiver is visible, and
false otherwise. |
|
removeListener(type, listener)
De-register the function as a listener of the given type
|
|
setBackground(color)
Sets the receiver's background color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
|
setEnabled(enabled)
Enables the receiver if the argument is
true ,
and disables it otherwise. |
|
setForeground(color)
Sets the receiver's foreground color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
|
setToolTipText(toolTipText)
Sets the receiver's tool tip text to the argument, which
may be null indicating that no tool tip text should be shown.
|
|
setVisible(visible)
Marks the receiver as visible if the argument is
true ,
and marks it invisible otherwise. |
Event Attributes | Event Name and Description |
---|---|
Sent when the widget gains focus
|
|
Sent when the widget looses focus
|
|
Sent when the widget is hidden
|
|
Sent when a key is pressed
|
|
Sent when a key is released
|
|
Sent when a mouse button is clicked twice
|
|
Sent when a mouse button is pressed
|
|
Sent when the mouse pointer enters the widget
|
|
Sent when the mouse pointer exits the widget
|
|
Sent when the mouse pointer is moved
|
|
Sent when a mouse button is released
|
|
Sent when the mouse wheel is moved
|
|
Sent when the widget is painted
|
|
Sent when the widget appears
|
- Parameters:
- {string} type
- The type of the event (e.g. SWT.Resize).
- {Function} listener
- The callback function. It is executed in global context.
- Returns:
- {boolean}
true
if the control got focus, andfalse
if it was unable to.
- Returns:
- {int[]} the background color as array [ red, green, blue ]
When the mouse pointer passes over a control its appearance is changed to match the control's cursor.
All possible values are available as constants on the SWT object.
- Returns:
- {string|null} the receiver's cursor or
null
true
if the receiver is enabled, and
false
otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.
- Returns:
- {boolean} the receiver's enabled state
- Returns:
- {int[]} the foreground color as array [ red, green, blue ]
- Returns:
- {string|null} the receiver's tool tip text
true
if the receiver is visible, and
false
otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
- Returns:
- {boolean} the receiver's visibility state
- Parameters:
- {string} type
- The type of the event (e.g. SWT.Resize).
- {Function} listener
- The callback function
- Parameters:
- {int[]|null} color
- the new color as array [ red, green, blue ] or null
true
,
and disables it otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.
- Parameters:
- {boolean} enabled
- the new enabled state
- Parameters:
- {int[]|null} color
- the new color as array [ red, green, blue ] or null
- Parameters:
- {string|null} toolTipText
- the new tool tip text (or null)
true
,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
NOTE: If there is a Show
or Hide
Java listener attached
to this widget, it may be notified at a later point in time. ClientListener
are notified right away.
- Parameters:
- {boolean} visible
- the new visibility state
- Parameters:
- {Event} event
- See:
- SWT.FocusIn
- Parameters:
- {Event} event
- See:
- SWT.FocusOut
- Parameters:
- {Event} event
- See:
- SWT.Hide
- Parameters:
- {Event} event
- See:
- SWT.KeyDown
- Parameters:
- {Event} event
- See:
- SWT.KeyUp
- Parameters:
- {Event} event
- See:
- SWT.MouseDoubleClick
- Parameters:
- {Event} event
- See:
- SWT.MouseDown
- Parameters:
- {Event} event
- See:
- SWT.MouseEnter
- Parameters:
- {Event} event
- See:
- SWT.MouseExit
- Parameters:
- {Event} event
- See:
- SWT.MouseMove
- Parameters:
- {Event} event
- See:
- SWT.MouseUp
- Parameters:
- {Event} event
- See:
- SWT.MouseWheel
- Parameters:
- {Event} event
- See:
- SWT.Paint
- Parameters:
- {Event} event
- See:
- SWT.Show