SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface which has to be implemented by all draggable objects.
Author: JANConstructor Summary | |
IWDraggable(container, parent)
Draggable interface. |
Method Summary | |
void
|
allowDraggingOutsideParent(isDraggingOutsideParentAllowed)
Enables or disables the dragging mode for elements out of the parent node. The default value is false .
|
HTMLDivElement
|
getContainer()
Returns the draggable object |
int
|
getDragButton()
Returns the drag button for this element. |
HTMLDivElement
|
getDraggableContainer()
Returns the draggable container for this element. |
IWSize
|
getDraggingBounds()
Returns the dragging area. |
DOMElement
|
getOnMouseMoveContainer()
Returns the container which will be registered for onmousemove events.
|
boolean
|
isDraggable()
Returns true if this element is draggable, otherwise the return value is false .
|
boolean
|
isDraggingOutsideParentAllowed()
Returns true if this element can be dragged out of the parent node. |
void
|
setDragButton(button)
Sets the drag button for this element. mouse button you must call the setDragButton() method with the parameter
IWButton.LEFT + IWButton.RIGHT .
|
void
|
setDraggable(isDraggable)
Sets an flag to indicate whether this element is draggable or not. |
void
|
setDraggableContainer(draggableContainer)
Sets the draggable container for this element. |
void
|
setDraggingBounds(bounds)
Sets the dragging area relative to the parent container. |
void
|
setOnMouseMoveContainer(container)
Sets the container which will be registered for onmousemove events.
By default the onmousemove events will be registered on the window.document
container.
|
Event Summary | |
void
|
triggerOnDrag(event)
The onDrag event is fired when the object is dragged. Register an event listener with IWEventManager.addListener(draggableObject, 'ondrag', yourHandlerMethod(event)); to recieve the event. |
void
|
triggerOnDragEnd(event)
The onDragEnd event is fired after the object is dragged. Register an event listener with IWEventManager.addListener(draggableObject, 'ondragend', yourHandlerMethod(event)); to recieve the event. |
void
|
triggerOnDragStart(event)
The onDragStart event is fired before the object is dragged. Register an event listener with IWEventManager.addListener(draggableObject, 'ondragstart', yourHandlerMethod(event)); to recieve the IWMouseEvent. |
Constructor Detail |
IWDraggable(container, parent)
HTMLDivElement container
- the dragging object
HTMLDivElement parent
- the logical parent object
Method Detail |
void allowDraggingOutsideParent(isDraggingOutsideParentAllowed)
false
.
boolean isDraggingOutsideParentAllowed
- true if this element can be dragged out of the parent node
void
HTMLDivElement getContainer()
HTMLDivElement
int getDragButton()
int
HTMLDivElement getDraggableContainer()
HTMLDivElement
IWSize getDraggingBounds()
IWSize
DOMElement getOnMouseMoveContainer()
onmousemove
events.
DOMElement
the container on which the onmousemove
events are registered.
boolean isDraggable()
true
if this element is draggable, otherwise the return value is false
.
boolean
true
if this element is draggable
boolean isDraggingOutsideParentAllowed()
boolean
true if this control can be dragged out of the parent node
void setDragButton(button)
setDragButton()
method with the parameter
IWButton.LEFT + IWButton.RIGHT
.
int button
- the new drag button. The default drag button is IWButton.LEFT
.
void
void setDraggable(isDraggable)
boolean isDraggable
void
void setDraggableContainer(draggableContainer)
HTMLDivElement draggableContainer
- the draggable container
void
void setDraggingBounds(bounds)
IWSize bounds
- the dragging area
void
void setOnMouseMoveContainer(container)
onmousemove
events.
By default the onmousemove
events will be registered on the window.document
container.
DOMElement container
void
Event Detail |
void triggerOnDrag(event)
Register an event listener with IWEventManager.addListener(draggableObject, 'ondrag', yourHandlerMethod(event)); to recieve the event.
IWMouseEvent event
- the on drag event
void
void triggerOnDragEnd(event)
Register an event listener with IWEventManager.addListener(draggableObject, 'ondragend', yourHandlerMethod(event)); to recieve the event.
IWMouseEvent event
- the event
void
void triggerOnDragStart(event)
Register an event listener with IWEventManager.addListener(draggableObject, 'ondragstart', yourHandlerMethod(event)); to recieve the IWMouseEvent.
IWMouseEvent event
- the event
void