CURL.GUI.SHAPES (package)

This package provides a lightweight 2D graphics system designed to allow the easy implementation of charts, graphs, or any other 2D graphics.

Description

The Curl Shapes system is a retained-mode graphics system, much like the Curl GUI Toolkit. It stores and retains the graphical objects and their relationships with one another.

The fundamental base class for shapes is Shape. The standard container for Shapes is Canvas.

You may implement your own Shape subclass. Additionally, Curl provides the following built-in Shape implementations:

Example


Example
{import * from CURL.GUI.SHAPES}

{Canvas
    width = 3in,
    height = 2in,
    {GraphicShape
        {Frame
            vorigin = "top",
            horigin = "left",
            width = 1.5in,
            {text
                This is a pie chart made up of several overlapping
                EllipseShapes.
            }
        }
    },
    {EllipseShape
        {GRect -2in, 3in, 0in, 1in},
        border-color = "black",
        border-width = 1pt,
        color = "red",
        start-angle = 0deg,
        stop-angle = 30% * 360deg,
        {on PointerEnter at shape:Shape do
            set shape.color = "cyan"
        },
        {on PointerLeave at shape:Shape do
            set shape.color = "red"
        }
    },
    {EllipseShape
        {GRect -2in, 3in, 0in, 1in},
        border-color = "black",
        border-width = 1pt,
        color = "blue",
        start-angle = 30% * 360deg,
        stop-angle = 85% * 360deg,
        {on PointerEnter at shape:Shape do
            set shape.color = "cyan"
        },
        {on PointerLeave at shape:Shape do
            set shape.color = "blue"
        }
    },
    {EllipseShape
        {GRect -2in, 3in, 0in, 1in},
        border-color = "black",
        border-width = 1pt,
        color = "green",
        start-angle = 85% * 360deg,
        stop-angle = 95% * 360deg,
        {on PointerEnter at shape:Shape do
            set shape.color = "cyan"
        },
        {on PointerLeave at shape:Shape do
            set shape.color = "green"
        }
    },
    {EllipseShape
        {GRect -2in, 3in, 0in, 1in},
        border-color = "black",
        border-width = 1pt,
        color = "grey",
        start-angle = 95% * 360deg,
        stop-angle = 100% * 360deg,
        {on PointerEnter at shape:Shape do
            set shape.color = "cyan"
        },
        {on PointerLeave at shape:Shape do
            set shape.color = "grey"
        }
    }
}
Package Members:
arrow-body-width
arrow-head-length
arrow-head-style
arrow-head-width
arrow-tail-length
arrow-tail-style
arrow-tail-width
ArrowShape
ArrowStyle
Canvas
CanvasAnchor
CanvasLayout
corner-radius
DiscreteGraphicSelectAll
DiscreteGraphicSelectionContext
DiscreteGraphicSelectionFrame
EllipseShape
GraphicShape
ImageShape
line-style
PathShape
RectangleShape
RegionShape
RoundedRectangleShape
Shape
shape-root
ShapeBox
ShapeBoxLayout
ShapeContainerBase
ShapeDragee
ShapeGroup
ShapeLayout
ShapeRoot
ShapeSelectable
ShapeSelectionPolygon
start-angle
stop-angle
stroke-thickness
TextShape
wedge?