Documentation for gcanvas.ew v0.10.5
Table of Contents

Introduction

The graphex canvas system (gcanvas.ew) is used for drawing objects on a 'canvas' which can scroll around. This is a work in progress but it is relatively featureful and the API should be fairly stable.

------------------NOTICE-------------------------------*
 Software ID: gcanvas.ew
  Version:     0.10.5 04/December/2006 
 Copyright:   (c) 2006 Gary Shingles
              All rights reserved.
 Licence:
 This software is provided 'as-is', without any express or implied warranty.
 In no event will the authors be held liable for any damages arising from
 the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. 2. If you use this software in a product, acknowedgement in the product's documenation and binary are required. 3. Altered source versions, and works substantially derived from the it, must... a) be plainly be marked as such, b) not be misrepresented as the original software, c) include this notice, unaltered. ------------------End of NOTICE------------------------*


Table of Contents

Topic

Description

IndexAlphabetical list of all items.
CanvasA managed viewport into a larger graphex. This system is built on top of the 'graphex' system.
EventsGetting events from the canvas
FUBARNot so well thought out stuff, or TODO stuff
GridControls automatic grid drawing on the canvas
InternalInformation for developers
ObjectsEverything drawn on the canvas is an 'object'
PropertiesRudimentary ways to attach info to a canvas or object
ScrollBarsControlling and accessing Scroll Bars
TODOThings to Come
UtilsRoutines to help manipulate the canvas

Index

blank_canvas [const] My standard way of maintaining consistency in reasonably complex sequences
Canvas
canvas_list [var] sequence. Maintains a list to of Canvas objects
CI [func] returns the index into the canvas_list of the canvas with ID canvasID or
C_* [const] unfortunately named like Euphoria's C_* constants, so might change
debug_draw_bbox [var] controls whether a BrightRed box is drawn around the extents of all rendered objects
drawGfxCanvas [proc] Draw the canvas using the current view port offset
Events
ev_onScroll [proc] internally set event handler for both types of scroll bar
FUBAR
GC_HSCROLL [const] and GC_VSCROLL
GC_SCROLL_* [const] Rather unfriendlily named constants of the automatically added scroll bar width and heights
getGfxCanvasAutoScroll [func] Return the canvas's auto scroll behaviour
getGfxCanvasGfx [func] Get a 'handle' on the underlying graphex object used by the canvas.
getGfxCanvasGridData [proc] Get the grid data from the canvas, see GR_* for the meanings.
getGfxCanvasHScrollMax [func] Get the maximum value of the horizontal scroll bar given the dimensions of the view port and the OSB
getGfxCanvasObjectData [func] Get the data from an object that has previously been added to the canvas
getGfxCanvasOffset [func] Get the current view port offset
getGfxCanvasProperty [func] Return the Euphoria object associated with the canvas by setGfxCanvasProperty
getGfxCanvasScrollButtonID [func] Get the win32lib id of the button created at the conjunction of both scroll bars
getGfxCanvasShapeProperty [func] Get the property set by getGfxCanvasShapeProperty
getGfxCanvasVScrollMax [func] Get the maximum value of the vertical scroll bar given the dimensions of the view port and the OSB
gfxCanvasAddHScroll [proc] Cause a horizontal scroll bar to be displayed on the canvas
gfxCanvasAddObject [func] Add a graphex style object to the canvas.
gfxCanvasAddScrollBars [proc] Cause both scroll bars and the button to be added to the canvas
gfxCanvasAddScrollButton [proc] Adds the little button that is so natural with two scroll bars present
gfxCanvasAddVScroll [proc] Cause a Vertical scroll bar to be displayed on the canvas
gfxCanvasAttachHandler [proc] Mechanism to attach an event to the canvas.
gfxCanvasCenter [proc] Cause the canvas to be displayed with its contents centered.
gfxCanvasDebugShowBBOX [proc] This is a debug routine which displays an objects bounding box in red around an object.
gfxCanvasDragBegin [proc] a mouse drag has ended
gfxCanvasDragBegin [proc] a mouse drag has started
gfxCanvasObjectAt [func] If an object has been added to the canvas by gfxCanvasAddObject then this system can probably
gfxCanvasObjectsInCanvasRect [func] return the object IDs in a certain rect relative to the whole Off Screen Buffer
gfxCanvasObjectsInWindowRect [func] return the object ids in a certain rect relative to the gfx
gfxCanvasRemoveHScroll [proc] Cause the canvas's Horizontal sroll bar to be removed
gfxCanvasRemoveObject [func] Remove a graphex style shape from the canvas based on its ID
gfxCanvasRemoveScrollBars [proc] Cause both scroll bars and the button to be removed from the canvas
gfxCanvasRemoveScrollButton [proc] Removes the natural scroll bar button
gfxCanvasRemoveVScroll [proc] Cause the canvas's Vertical sroll bar to be removed
gfxCanvasResize [proc] Change the size of the canvas (eg if the window is resized)
gfxCanvasUpdateOSB [proc] Redraws any objects on the offscreen buffer that need to be shown
GFX_CANVAS_CLICK_TIMEOUT [const] currently unused, and hopefully will never have to be
gfx_mouse [proc] the event handler for the unthoughtout mouse abstractions
gfx_mouse_params [func] ??
Grid
GRID_* [const] Types of grid to be drawn, see setGfxCanvasGrid
GR_* [const] sequence field positions for grid data for setGfxCanvasGridData and getGfxCanvasGridData
Internal
last_id [var] integer. Last id of object added to canvas.
newGfxCanvas [func] Create a new canvas
Objects
Properties
ScrollBars
scroll_but_r_id [var] This remembers the routine id of the event handler for w32HClick on the scroll bar button
setGfxCanvasAutoScroll [proc] Determine whether scroll bars will automatically appear on the canvas (default is true if needed)
setGfxCanvasGfx [proc] UNTESTED changing the graphex object on the canvas
setGfxCanvasGrid [func] Set the type of grid (if any) is displayed on the canvas
setGfxCanvasGridData [proc] Set the grid data of the canvas, usually from data obtained from getGfxCanvasGridData
setGfxCanvasObjectData [proc] Change the data held by the canvas about an object. It is safest to use getGfxCanvasObjectData
setGfxCanvasOffset [proc] Change the top left coordinate offset (both X and Y) of the view port
setGfxCanvasProperty [proc] Set a property (really just a Euphoria object) on the canvas
setGfxCanvasScrollButtonHandler [proc] nominate the routine to receive w32HClick on the button between the scroll bars
setGfxCanvasShapeProperty [proc] Set the property associated with an object added to the canvas
setGfxCanvasXOffset [proc] Change the X offset of the view port
setGfxCanvasYOffset [proc] Change the Y offset of the view port
S_* [const] Should probably be O_* :-)
TODO
Utils