[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[WI8] HTMLWidget

HTMLWidget is the base class for all in-page widgets.
The concept of parent is introduced to allow the widgets to refer to upper level elements.
Also a name instance variable is used for the widgets (name is obtained via registration with the parent).
Finally an opened/closed status is maintained by the widgets.


HTMLWidget inherits from [WI8] WI8Widget.

Instance Variables

nameUnlike desktop when you deal with multiple widgets you need to name them
parentAllows to refer to upper level elements in the composition hierarchy
openedWidget opened status

Relevant Methods


@Open an HTMLWidget passing a name or a handler
domEventsReturns list of supported DOM events (see events below)
htmlSupportReturns HTMLDiv
text:Creates HTMLWidget that shows the passed text
title:Creates HTMLWidget that shows the passed text as a title


actionWidgetFrom: specUtility to return an action widget based on spec over self (eg. an image widget)
actionWidgetFrom: spec in: repository on: aReceiverUtility to return an action widget based on spec over a receiver (eg. an image widget)
addChild:Adds a child widget to the receiver
centerAdds a child center element to the receiver
closeReceiver is closed and removed as child of its parent
createElement: aTagCreates a GUI element with tag in the receiver's document
defaultMakeupSets the style of the receiver (left empty)
desktopReturns the top level container (from parent or from superclass)
hideWindowHide window via style setting
initializeNameGets name from parent or current desktop
isHiddenReturn whether receiver is currently hidden
isOpenReturn whether receiver is currently opened
open:in:Opens the receiver as a child of a container.
resetRefined by subclasses
updateReset and configure the receiver


WI8Widget can handle the following events (besides the ones inherited from its superclass):

DOM Events

click:Mouse clicked
dblclick:Mouse double clicked
mouseDown:Mouse down
mouseMove:Mouse moved
mouseOver:Mouse over
mouseOut:Mouse out
mouseUp:Mouse up
keyDown:Key down
keyPress:Key pressed
keyUp:Key up

Local Events

startDrag:in:Start drag and drop gesture
canDragSource:Verify if drag and drop is supported

DOM Events

click:A mousedown and mouseup event occured on the same element. Or the user activated the element that has the keyboard focus (usually by pressing Enter or the space bar).
dblclick:Two mouse click events occured on the same element within a reasonable time
mouseDown:A user pressed a mouse button over an element
mouseMove:The pointer is moving while it is over an element
mouseOver:The mouse pointer is moved onto an element, or onto one of its children
mouseOut:The mouse pointer is moved out of an element, or out of one of its children
mouseUp:A user released a mouse button over an element