|
Sydney | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Widget
Raises:
beforedragstart
DragEvent
. Setting the continueDrag
property of the DragEvent
to false
will prevent the drag operation from starting. (See DragEvent.continueDrag
.)beforedragmove
DragEvent
. Once this event has been raised, the dragged-widget's position is updated to match the widget
property of the DragEvent
that was passed to the beforedragmove
listeners. Therefor, modifying the widget
property will affect the new position of the dragged widget. Listeners can thus constrain the region inside which the dragged-widget can be dragged. (See DragEvent.widget
.)afterdragmove
DragEvent
that was passed to the matching beforedragmove
event. Modifying the members of the DragEvent
during an afterdragmove
event has no effect.afterdragstop
DragEvent
. The mouse
property of the DragEvent
reflects the co-ordinates of the mouse at the time of the drop, and the widget
property represents the co-ordinates of the dragged-widget at the time of the drop. (See DragEvent.mouse
and DragEvent.widget
.)afterdragcancel
DragEvent
. In the case of an afterdragcancel
event, the mouse
property of the DragEvent
reflects the co-ordinates that the mouse would have been at had it been a mouse event that caused the drag operation to be cancelled. Also, the widget
property is the co-ordinates where the dragged-widget has been placed because of the cancellation. Together, this means that the same listener could be attached to both afterdragstop
and afterdragcancel
because the members of the DragEvent
are consistent between the two events. (See DragEvent.mouse
and DragEvent.widget
.)Field Summary | |
<final> EventTable |
eventTable
|
DOMNode |
html
This widget's HTML node. |
<final> string |
id
|
LayoutData |
layoutData
|
Widget |
parent
|
<static> int |
DISPOSE_COUNT
|
<static> int |
NEXT_WIDGET_ID
|
Constructor Summary | |
Widget
(<DOMNode> html, <Widget> parent)
The base widget class. |
Method Summary | |
boolean
|
addEventListener(eventName, listener)
|
void
|
blur()
|
void
|
createEventTable(eventList)
|
void
|
dispose()
|
void
|
focus()
|
Pixels
|
getAbsoluteBottom()
Returns the y-coordinate of the bottom of this widget relative to the screen, rather than the widget's parent. |
Pixels
|
getAbsoluteLeft()
|
Pixels
|
getAbsoluteRight()
|
Pixels
|
getAbsoluteTop()
|
Pixels
|
getBottom()
|
Point
|
getBounds()
|
Pixels
|
getClientHeight()
|
Pixels
|
getClientWidth()
|
Point
|
getCorner()
|
Pixels
|
getHeight()
|
Pixels
|
getLeft()
|
float
|
getPixelsPerEm()
|
Pixels
|
getRight()
|
string
|
getToolTip()
|
Pixels
|
getTop()
|
Pixels
|
getWidth()
|
void
|
installContextMenu(<Menu> menu)
Installs the given menu as a context menu for this widget. |
void
|
installDefaultContextMenu()
Installs the default context menu on the widget. |
boolean
|
isDisposed()
|
boolean
|
isDraggable()
Returns true or false to indicate whether or not
the user can drag this widget.
|
boolean
|
isEnabled(<boolean> dontCheckParent)
Returns true if the widget is enabled, false otherwise.
|
void
|
layout(<boolean> flushCache)
Causes the widget to redraw itself and any children it may have. |
void
|
moveTo(x, y)
|
void
|
moveToAbsolute(x, y)
|
void
|
raiseEvent(eventName, event)
|
void
|
registerEventType(eventName)
|
boolean
|
removeEventListener(eventName, listener)
|
void
|
setAbsoluteBottom(bottom)
|
void
|
setAbsoluteLeft(left)
|
void
|
setAbsoluteRight(right)
|
void
|
setAbsoluteTop(top)
|
void
|
setBottom(<Quantity> bottom)
Sets this widget's bottom co-ordinate. |
void
|
setBounds(x, y)
|
void
|
setDraggable(newDraggable)
Reconfigures this widget to be either draggable or not draggable. |
void
|
setEnabled(<boolean> isEnabled)
Set the enabled state of this widget. |
void
|
setHeight(<Object> height)
Sets this widget's height. |
void
|
setLeft(<Object> left)
Sets this widget's left co-ordinate. |
void
|
setParent(<Widget> parent)
Sets this widget's parent to parent .
|
void
|
setRight(<Quantity> right)
Sets this widget's right co-ordinate. |
void
|
setToolTip(tip)
|
void
|
setTop(<Object> top)
Sets this widget's top co-ordinate. |
void
|
setWidth(<Object> width)
Sets this widget's width. |
string
|
toString()
Returns a string representation of this widget. |
void
|
uninstallContextMenu()
If this widget has a context menu, uninstalls it. |
Field Detail |
<final> EventTable eventTable
DOMNode html
html
(such as the style
property).
<final> string id
LayoutData layoutData
Widget parent
<static> int DISPOSE_COUNT
<static> int NEXT_WIDGET_ID
Constructor Detail |
function Widget(<DOMNode> html, <Widget> parent)
html
- an HTML node to use as this widget's representation.
parent
- a Widget
that contains this widget. Use of this parameter is deprecated and it will hopefully be removed in a codebase cleanup.
Method Detail |
boolean addEventListener(eventName, listener)
void blur()
void createEventTable(eventList)
void dispose()
void focus()
Pixels getAbsoluteBottom()
Pixels getAbsoluteLeft()
Pixels getAbsoluteRight()
Pixels getAbsoluteTop()
Pixels getBottom()
Point getBounds()
Pixels getClientHeight()
Pixels getClientWidth()
Point getCorner()
Pixels getHeight()
Pixels getLeft()
float getPixelsPerEm()
Pixels getRight()
string getToolTip()
Pixels getTop()
Pixels getWidth()
void installContextMenu(<Menu> menu)
menu
- the menu to use as a context menu. Pass null
to block context menus without providing an alternative.
void installDefaultContextMenu()
installDefaultContextMenu
is necessary if
this widget should use the browser-supplied default context menu, but at
least one of the widget's ancestors uses a custom context menu or blocks
context menus. This necessity derives from the DOM event model because
context menu requests on this widget will "bubble" up to the nearest
ancestor that handles them. If there's no such ancestor then the
default behaviour is invoked and the user sees the default context menu.
However, if any of the ancestors have installed non-default context
menus, the nearest one will handle the menu request and show its
non-default one, thus defeating this widget's desired default menu.
This method is mostly useful for built-in widgets like text boxes that
have context menus containing useful functions like 'Copy', and 'Paste'.
Only available after including menu.js.
boolean isDisposed()
boolean isDraggable()
true
or false
to indicate whether or not
the user can drag this widget.
true
if this widget can be dragged by the user, false
otherwise
boolean isEnabled(<boolean> dontCheckParent)
true
if the widget is enabled, false
otherwise.
dontCheckParent
- (optional) - If true then ignore the parent when doing the disabled check.
void layout(<boolean> flushCache)
flushCache
- if flushCache is true
then the layout manager should ignore any cached values it may have and recompute everything
void moveTo(x, y)
void moveToAbsolute(x, y)
void raiseEvent(eventName, event)
void registerEventType(eventName)
boolean removeEventListener(eventName, listener)
void setAbsoluteBottom(bottom)
void setAbsoluteLeft(left)
void setAbsoluteRight(right)
void setAbsoluteTop(top)
void setBottom(<Quantity> bottom)
bottom
- the co-ordinate at which to place the bottom edge of this widget. bottom
must be a Quantity
(unlike setWidth()
, setTop()
, setLeft()
, or setHeight()
) because setBottom
must delegate to setTop
.
void setBounds(x, y)
void setDraggable(newDraggable)
newDraggable
is true
, then mouse and key
listeners will be registered in the appropriate places to simulate
traditional drag-and-drop behaviour.
newDraggable
- true
or false
.
void setEnabled(<boolean> isEnabled)
isEnabled
- a boolean
indicating whether or not to enable the widget. true
enables the widget and false
disables it.
void setHeight(<Object> height)
height
- the height to make this widget. height
is used almost directly to set the style.height
property of the underlying HTML node, so height
can be any value whose toString()
returns something that is a valid CSS height.
void setLeft(<Object> left)
left
- the point at which to place the left edge of this widget. left
is used almost directly to set the style.left
property of the underlying HTML node, so left
can be any value whose toString()
returns something that is a valid CSS left.
void setParent(<Widget> parent)
parent
.
parent
- this widget's new parent
void setRight(<Quantity> right)
right
- the co-ordinate at which to place the right edge of this widget. right
must be a Quantity
(unlike setWidth()
, setTop()
, setLeft()
, or setHeight()
) because setRight
must delegate to setLeft
.
void setToolTip(tip)
void setTop(<Object> top)
top
- the point at which to place the top of this widget. top
is used almost directly to set the style.top
property of the underlying HTML node, so top
can be any value whose toString()
returns something that is a valid CSS top.
void setWidth(<Object> width)
width
- the width to make this widget. width
is used almost directly to set the style.width
property of the underlying HTML node, so width
can be any value whose toString()
returns something that is a valid CSS width.
string toString()
void uninstallContextMenu()
|
Sydney | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |