Source codeContentsIndex
CanvasItem
Description
The module CanvasItem exports basic classes and general functionality on canvas items.
Synopsis
data Canvas
data BitMapHandle
= Predefined String
| BitMapHandle BitMap
| BitMapFile String
data BitMap
class HasCoords w where
coord :: Coord -> Config w
getCoord :: w -> IO Coord
class (GUIObject w) => CanvasItem w
class (CanvasItem w) => FilledCanvasItem w where
filling :: (ColourDesignator c) => c -> Config w
getFilling :: w -> IO Colour
outline :: (ColourDesignator c) => c -> Config w
getOutline :: w -> IO Colour
stipple :: BitMapHandle -> Config w
getStipple :: w -> IO BitMapHandle
outlinewidth :: Distance -> Config w
getOutlineWidth :: w -> IO Distance
class (CanvasItem w) => SegmentedCanvasItem w where
splinesteps :: Int -> Config w
getSplinesteps :: w -> IO Int
smooth :: Bool -> Config w
getSmooth :: w -> IO Bool
moveItem :: (Synchronized w, CanvasItem w) => w -> Distance -> Distance -> IO ()
scaleItem :: (Synchronized w, CanvasItem w) => w -> Distance -> Distance -> Double -> Double -> IO ()
raiseItem :: (CanvasItem ci, CanvasItem w) => ci -> w -> IO ()
lowerItem :: (CanvasItem ci, CanvasItem w) => ci -> w -> IO ()
putItemOnTop :: (CanvasItem w) => w -> IO ()
putItemAtBottom :: (CanvasItem ci) => ci -> IO ()
itemsNotOnSameCanvas :: IOError
Documentation
data Canvas
The Canvas datatype.
data BitMapHandle
The BitMapHandle datatype - a handle for a bitmap resource.
Constructors
Predefined String
BitMapHandle BitMap
BitMapFile String
Instances
BitMapDesignator BitMapHandle
data BitMap
The BitMap datatype.
class HasCoords w where
You can set the coords (position / size) of a canvas item on the parent canvas.
Methods
coord :: Coord -> Config w
Sets the coord(s) of a canvas item on the parent canvas.
getCoord :: w -> IO Coord
Gets the coord(s) of a canvas item on the parent canvas.
Instances
(CanvasItem w) => HasCoords w
class (GUIObject w) => CanvasItem w
Any canvas item is an instance of the abstract class CanvasItem.
Instances
CanvasItem Arc
CanvasItem BitMapItem
CanvasItem CanvasTag
CanvasItem EmbeddedCanvasWin
CanvasItem ImageItem
CanvasItem Line
CanvasItem Oval
CanvasItem Polygon
CanvasItem Rectangle
CanvasItem TextItem
class (CanvasItem w) => FilledCanvasItem w where
Methods
filling :: (ColourDesignator c) => c -> Config w
Sets the filling of a canvas item.
getFilling :: w -> IO Colour
Gets the filling of a canvas item.
outline :: (ColourDesignator c) => c -> Config w
Sets the outline colour of a canvas item.
getOutline :: w -> IO Colour
Gets the outline colour of a canvas item.
stipple :: BitMapHandle -> Config w
Sets the stipple configuration of a canvas item.
getStipple :: w -> IO BitMapHandle
Gets the stipple configuration of a canvas item.
outlinewidth :: Distance -> Config w
Sets the outline width of a canvas item.
getOutlineWidth :: w -> IO Distance
Gets the outline width of a canvas item.
Instances
FilledCanvasItem Arc
FilledCanvasItem BitMapItem
FilledCanvasItem Line
FilledCanvasItem Oval
FilledCanvasItem Polygon
FilledCanvasItem Rectangle
FilledCanvasItem TextItem
class (CanvasItem w) => SegmentedCanvasItem w where
Segmented canvas items have a splinesteps and smooth configuration.
Methods
splinesteps :: Int -> Config w
Sets the number of line segments that approximate the spline.
getSplinesteps :: w -> IO Int
Gets the number of line segments that approximate the spline.
smooth :: Bool -> Config w
Sets the smooth configuration (if true a spline curve is drawn around the points).
getSmooth :: w -> IO Bool
Gets the actual smooth setting.
Instances
SegmentedCanvasItem Line
SegmentedCanvasItem Polygon
moveItem :: (Synchronized w, CanvasItem w) => w -> Distance -> Distance -> IO ()
Moves a canvas item horizontally and vertically by the given distances.
scaleItem :: (Synchronized w, CanvasItem w) => w -> Distance -> Distance -> Double -> Double -> IO ()
Scales a canvas item horizontally and vertically by the given distances.
raiseItem :: (CanvasItem ci, CanvasItem w) => ci -> w -> IO ()
Moves an item above another item in the display list.
lowerItem :: (CanvasItem ci, CanvasItem w) => ci -> w -> IO ()
Moves an item below another item in the display list.
putItemOnTop :: (CanvasItem w) => w -> IO ()
Puts an item on top of the display list.
putItemAtBottom :: (CanvasItem ci) => ci -> IO ()
Puts an items at bottom of the display list.
itemsNotOnSameCanvas :: IOError
Exception raised by CanasItem.onSameCanvas.
Produced by Haddock version 0.3