Source codeContentsIndex
Canvas
Description
HTk's canvas widget. A canvas is a drawing pad, that can also contain widgets in embedded windows. A canvas widget contains canvas items.
Synopsis
class (GUIObject w) => HasPostscript w where
postscript :: w -> [CreationConfig PostScript] -> IO ()
data ScrollBar
class (Widget w) => HasScroller w where
isWfOrientation :: w -> Orientation -> Bool
scrollbar :: Orientation -> ScrollBar -> Config w
moveto :: Orientation -> w -> Fraction -> IO ()
scroll :: Orientation -> w -> Int -> ScrollUnit -> IO ()
view :: Orientation -> w -> IO (Fraction, Fraction)
data ScrollUnit
data Canvas
newCanvas :: (Container par) => par -> [Config Canvas] -> IO Canvas
closeEnough :: Double -> Canvas -> IO Canvas
getCloseEnough :: Canvas -> IO Double
confine :: Bool -> Canvas -> IO Canvas
getConfine :: Canvas -> IO Bool
screenToCanvasCoord :: Canvas -> Orientation -> Distance -> Maybe Distance -> IO Distance
type ScrollRegion = (Position, Position)
scrollRegion :: ScrollRegion -> Canvas -> IO Canvas
getScrollRegion :: Canvas -> IO ScrollRegion
scrollIncrement :: Orientation -> Distance -> Canvas -> IO Canvas
Documentation
class (GUIObject w) => HasPostscript w where
Widgets that support postscript export instantiate the class HasPostscript.
Methods
postscript :: w -> [CreationConfig PostScript] -> IO ()
Exports postscript from the given widget.
Instances
HasPostscript Canvas
data ScrollBar
The ScrollBar datatype.
class (Widget w) => HasScroller w where
Methods
isWfOrientation :: w -> Orientation -> Bool
True for widgets that are scrollable in the given orientation.
scrollbar :: Orientation -> ScrollBar -> Config w
Associates a scrollbar with a scrollable widget.
moveto :: Orientation -> w -> Fraction -> IO ()
Positions the scrolled widget so the give Fraction is off-screen to the left.
scroll :: Orientation -> w -> Int -> ScrollUnit -> IO ()
Scrolls the associated widget by n pages or units (depending on the given ScrollUnit).
view :: Orientation -> w -> IO (Fraction, Fraction)
Returns two fractions between 0 and 1 that describe the amount of the widget off-screen to the left and the amount of the widget visible.
Instances
HasScroller Canvas
HasScroller Editor
HasScroller (Entry a)
HasScroller (ListBox a)
(HasScroller a) => HasScroller (ScrollBox a)
data ScrollUnit
data Canvas
The Canvas datatype.
newCanvas
:: (Container par)
=> par the parent widget, which has to be a container widget (an instance of class Container).
-> [Config Canvas] the list of configuration options for this canvas.
-> IO Canvas A canvas widget.
Constructs a new canvas widget and returns a handler.
closeEnough :: Double -> Canvas -> IO Canvas
getCloseEnough
:: Canvas the canvas to get this configuration from.
-> IO Double The requested distance.
Selector for the maximum distance from the mouse to an overlapped object.
confine
:: Bool Bool, see above.
-> Canvas the canvas to apply this configuration.
-> IO Canvas The concerned canvas.
True constraints view to the scroll region.
getConfine
:: Canvas the canvas to get this configuration from.
-> IO Bool The confine configuration as a Bool value (see confine).
Selector for the confine configuration, constraints view to the scroll region if True.
screenToCanvasCoord
:: Canvas the concerned canvas widget.
-> Orientation the orientation (Vertical or Horizontal).
-> Distance the input coordinate.
-> Maybe Distance an optional grid (the output can be rounded to multiples of this grid if specified).
-> IO Distance The requested distance in the specified orientation.
Maps from screen X or Y coordinates (orientation parameter) to the corresponding coordinates in canvas space.
type ScrollRegion = (Position, Position)
The ScrollRegion datatype (scrollable region of the canvas widget).
scrollRegion
:: ScrollRegion the scroll region to set.
-> Canvas the canvas widget to apply this scrollregion.
-> IO Canvas The concerned canvas.
Sets the scrollable region for a canvas widget.
getScrollRegion
:: Canvas the canvas widget to get the applied scroll region from.
-> IO ScrollRegion The requested scroll region.
Gets the applied scroll region from a canvas widget.
scrollIncrement
:: Orientation the orientation (Vertical or Horizontal).
-> Distance the distance to set.
-> Canvas the canvas widget to apply this scrolling distance.
-> IO Canvas The concerned canvas.
Sets the distance for one scrolling unit.
Produced by Haddock version 0.3