Sydney

Class Widget

Object
   |
   +--Widget
Direct Known Subclasses:
ToolbarLine, TextArea, Icon, RootWidget, RadioButton, ToolbarButton, TabbedPane.Tab, Select, Container, Link, TableColumn, Reset, Text, TabbedPane, CheckBox, Splitter.Bar, Picture, HiddenVar, Button, MenuItem, Submit, Label, Spacer, TitledViewer, Item, ListItem

class Widget

Raises:

beforedragstart
whenever a draggable widget is about to be dragged. Listeners receive an instance of DragEvent. Setting the continueDrag property of the DragEvent to false will prevent the drag operation from starting. (See DragEvent.continueDrag.)
beforedragmove
whenever the user moves the mouse during a drag operation, but before the dragged-widget's position is updated. Listeners are passed an instance of 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
whenever the user moves the mouse during a drag operation, but after the dragged-widget's position has been updated. Listeners are passed the same instance of DragEvent that was passed to the matching beforedragmove event. Modifying the members of the DragEvent during an afterdragmove event has no effect.
afterdragstop
whenever a drag operation terminates normally on a draggable widget (ie. the user 'dropped' the widget). Listeners are passed an instance of 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
whenever a drag operation is cancelled by the user (probably by pressing the escape key). Listeners are passed an instance of 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.)
Defined in widget.js


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

eventTable

<final> EventTable eventTable

html

DOMNode html

id

<final> string id

layoutData

LayoutData layoutData

parent

Widget parent

DISPOSE_COUNT

<static> int DISPOSE_COUNT

NEXT_WIDGET_ID

<static> int NEXT_WIDGET_ID

Constructor Detail

Widget

function Widget(<DOMNode> html, <Widget> parent)
Method Detail

addEventListener

boolean addEventListener(eventName, listener)

blur

void blur()

createEventTable

void createEventTable(eventList)

dispose

void dispose()

focus

void focus()

getAbsoluteBottom

Pixels getAbsoluteBottom()

getAbsoluteLeft

Pixels getAbsoluteLeft()

getAbsoluteRight

Pixels getAbsoluteRight()

getAbsoluteTop

Pixels getAbsoluteTop()

getBottom

Pixels getBottom()

getBounds

Point getBounds()

getClientHeight

Pixels getClientHeight()

getClientWidth

Pixels getClientWidth()

getCorner

Point getCorner()

getHeight

Pixels getHeight()

getLeft

Pixels getLeft()

getPixelsPerEm

float getPixelsPerEm()

getRight

Pixels getRight()

getToolTip

string getToolTip()

getTop

Pixels getTop()

getWidth

Pixels getWidth()

installContextMenu

void installContextMenu(<Menu> menu)

installDefaultContextMenu

void installDefaultContextMenu()

isDisposed

boolean isDisposed()

isDraggable

boolean isDraggable()

isEnabled

boolean isEnabled(<boolean> dontCheckParent)

layout

void layout(<boolean> flushCache)

moveTo

void moveTo(x, y)

moveToAbsolute

void moveToAbsolute(x, y)

raiseEvent

void raiseEvent(eventName, event)

registerEventType

void registerEventType(eventName)

removeEventListener

boolean removeEventListener(eventName, listener)

setAbsoluteBottom

void setAbsoluteBottom(bottom)

setAbsoluteLeft

void setAbsoluteLeft(left)

setAbsoluteRight

void setAbsoluteRight(right)

setAbsoluteTop

void setAbsoluteTop(top)

setBottom

void setBottom(<Quantity> bottom)

setBounds

void setBounds(x, y)

setDraggable

void setDraggable(newDraggable)

setEnabled

void setEnabled(<boolean> isEnabled)

setHeight

void setHeight(<Object> height)

setLeft

void setLeft(<Object> left)

setParent

void setParent(<Widget> parent)

setRight

void setRight(<Quantity> right)

setToolTip

void setToolTip(tip)

setTop

void setTop(<Object> top)

setWidth

void setWidth(<Object> width)

toString

string toString()

uninstallContextMenu

void uninstallContextMenu()

Sydney

SourceForge.net Logo