Class Index | File Index

Classes


Class pwlib.tools.hand

The hand tool. This tool allows the user to drag the image canvas inside the viewport.
Defined in: hand.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<private> <inner>  
Tells if the viewport needs to be scrolled.
<private>  
Holds the previous tool ID.
<private> <inner>  
The interval ID used for invoking the viewport drag operation every few milliseconds.
Method Summary
Method Attributes Method Name and Description
 
Tool activation event handler.
 
Tool deactivation event handler.
<inner>  
The mousemove event handler.
<inner>  
The mouseup event handler.
 
keydown(ev)
Allows the user to press Escape to stop dragging the canvas, and to return to the previous tool.
 
Initialize the canvas drag.
 
Tool preactivation event handler.
<inner>  
Perform the canvas drag operation.
Class Detail
pwlib.tools.hand(app)
Parameters:
{PaintWeb} app
Reference to the main paint application object.
Field Detail
<private> <inner> {Boolean} needsScroll
Tells if the viewport needs to be scrolled.
Default Value:
false

<private> {String} prevTool
Holds the previous tool ID.

<private> <inner> timer
The interval ID used for invoking the viewport drag operation every few milliseconds.
See:
PaintWeb.config.toolDrawDelay
Method Detail
activate()
Tool activation event handler.

deactivate(ev)
Tool deactivation event handler.
Parameters:
ev

<inner> ev_mousemove(ev)
The mousemove event handler. This simply stores the current mouse location.
Parameters:
{Event} ev
The DOM Event object.

<inner> ev_mouseup(ev)
The mouseup event handler.
Parameters:
ev

{Boolean} keydown(ev)
Allows the user to press Escape to stop dragging the canvas, and to return to the previous tool.
Parameters:
{Event} ev
The DOM Event object.
Returns:
{Boolean} True if the key was recognized, or false if not.

mousedown(ev)
Initialize the canvas drag.
Parameters:
{Event} ev
The DOM event object.

{Boolean} preActivate()
Tool preactivation event handler.
Returns:
{Boolean} True if the tool can become active, or false if not.

<inner> viewportScroll()
Perform the canvas drag operation. This function is called every few milliseconds.

Press Escape to stop dragging and to get back to the previous tool.


Documentation generated by JsDoc Toolkit 2.3.0 on Sat Jun 26 2010 21:57:03 GMT+0300 (EEST)