Tk Library Source Code

Documentation
Login


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

NAME

canvas::edit::circle - Editing a circle on a canvas

Table Of Contents

SYNOPSIS

package require Tcl 8.5
package require Tk 8.5
package require canvas::edit::points ?0.1?
package require canvas::edit::circle ?0.1?

::canvas::edit circle objectName canvas options...
objectName destroy
objectName enable
objectName disable
objectName active
objectName set minx miny maxx maxy
objectName clear
activeCmd editorObj id
createCmd canvas x y
dataCmd editorObj coordinates

DESCRIPTION

This package provides a class whose instances handle editing a circle on a canvas. Instances can be configured with regard to the visual appearance of the markers denoting the circle's principal points. Note that instances do not store the edited circle themselves, but delegate this to a configurable object.

Interaction

The circle editor internally uses an instance of package canvas::edit::points, and inherits all the options and behaviours for it. The color options are additionally applied to the circle element of this editor

Beyond that it provides an option, -circle-config, to customize the circle item used to render the circle through its principal points. Note that it cannot overide the inherited color options.

During interaction instances execute a state machine where the user creates two points, at which point the system completes the circle and reports it. At that point the system prevents adding more points. Dragging the points is still possible, enabling resizing and moving the circle. Deleting any of the principal points deletes the entire circle, at which point the system is again ready for the creation of a new circle from two points.

Class API

Instance API

Instances of the circle editors provide the following API:

Options

The class command accepts the following options

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category canvas of the Tklib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

KEYWORDS

canvas, circle, editing