HTk.Widgets.ScrollBar
Description
HTk's scrollbar widget.
A scroll bar is a widget which controls scrolling.
- 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 ScrollBar
- newScrollBar :: Container par => par -> [Config ScrollBar] -> IO ScrollBar
- data ScrollUnit
- newtype Slider w = Slider w
- class Widget w => HasSlider w where
- repeatInterval :: Int -> Config (Slider w)
- getRepeatInterval :: Slider w -> IO Int
- repeatDelay :: Int -> Config (Slider w)
- getRepeatDelay :: Slider w -> IO Int
- data ScrollBarElem
- = Arrow1
- | Trough1
- | ScrollBarSlider
- | Trough2
- | Arrow2
- activateScrollBarElem :: ScrollBar -> ScrollBarElem -> IO ()
- getActivatedElem :: ScrollBar -> IO (Maybe ScrollBarElem)
- type Fraction = Double
- fraction :: ScrollBar -> Position -> IO Fraction
- identify :: ScrollBar -> Position -> IO (Maybe ScrollBarElem)
- setView :: ScrollBar -> Fraction -> Fraction -> IO ()
Documentation
class Widget w => HasScroller w whereSource
Scrollable widgets instantiate class HasScroller.
Methods
isWfOrientation :: w -> Orientation -> BoolSource
scrollbar :: Orientation -> ScrollBar -> Config wSource
moveto :: Orientation -> w -> Fraction -> IO ()Source
scroll :: Orientation -> w -> Int -> ScrollUnit -> IO ()Source
Instances
| HasScroller Canvas | A canvas is a scrollable widget. |
| HasScroller Editor | An editor is a scrollable widget. |
| HasScroller (Entry a) | An entry field is scrollable in horizontal direction. |
| HasScroller (ListBox a) | A listbox is a scrollable widget. |
| HasScroller a => HasScroller (ScrollBox a) | A scrollbox has scrollbars. |
The ScrollBar datatype.
Instances
| Eq ScrollBar | |
| Destroyable ScrollBar | A scrollbar widget can be destroyed. |
| GUIObject ScrollBar | Internal. |
| HasEnable ScrollBar | A scrollbar widget is a stateful widget, it can be enabled or disabled. |
| HasOrientation ScrollBar | The scrollbars orientation can be |
| HasBorder ScrollBar | A scrollbar widget has a configureable border. |
| HasSize ScrollBar | You can specify the width of a scrollbar. |
| HasColour ScrollBar | A scrollbar widget has a background and activebackground (regarding slider) colour. |
| HasTooltip ScrollBar | A scrollbar can have a tooltip. |
| Widget ScrollBar | A scrollbar widget has standard widget properties (concerning focus, cursor). |
| HasSlider ScrollBar | The scrollbar has a configureable slider component. |
Arguments
| :: Container par | |
| => par | the parent widget, which has to be a container widget
(an instance of |
| -> [Config ScrollBar] | the list of configuration options for this scrollbar. |
| -> IO ScrollBar | A scrollbar widget. |
Constructs a new scrollbar widget and returns a handler.
data ScrollUnit Source
The ScrollUnit datatype - units for scrolling operations.
Instances
| Read ScrollUnit | Internal. |
| Show ScrollUnit | Internal. |
| GUIValue ScrollUnit | Internal. |
The Slider datatype.
Constructors
| Slider w |
Instances
| GUIObject w => GUIObject (Slider w) | Internal. |
| HasSize (Slider (Scale a)) | A scale's slider has a configureable size. |
| (HasSlider w, GUIObject w) => HasColour (Slider w) | The slider component has a configureable foreground and background colour. |
| ScaleValue a => HasIncrement (Slider (Scale a)) a | A scale's slider has a configureable resulution. |
class Widget w => HasSlider w whereSource
Widgets with sliders (scale widget, scrollbar) instantiate the
class HasSlider.
Methods
repeatInterval :: Int -> Config (Slider w)Source
getRepeatInterval :: Slider w -> IO IntSource
repeatDelay :: Int -> Config (Slider w)Source
getRepeatDelay :: Slider w -> IO IntSource
data ScrollBarElem Source
The ScrollBarElem datatype - representing the elements
of the scrollbar.
Constructors
| Arrow1 | |
| Trough1 | |
| ScrollBarSlider | |
| Trough2 | |
| Arrow2 |
Instances
| Enum ScrollBarElem | |
| Eq ScrollBarElem | |
| Ord ScrollBarElem | |
| Read ScrollBarElem | Internal. |
| Show ScrollBarElem | Internal. |
| GUIValue ScrollBarElem | Internal. |
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> ScrollBarElem | the element to activate. |
| -> IO () | None. |
Sets the active element (which can be arrow1, arrow2 or slider).
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> IO (Maybe ScrollBarElem) |
|
Gets the active element (arrow1, arrow2 or slider).
Fractions are floating point values between 0 and 1 representing relative positions within the scrolled range.
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> Position | the conderned position. |
| -> IO Fraction | The fraction indicating the relative location in the through. |
Returns a fraction between 0 and 1 indicating the relative location of the given position in the through.
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> Position | the concerned position. |
| -> IO (Maybe ScrollBarElem) |
|
Returns the ScrollBarElem to indicate what is under
the given position.
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> Fraction | fraction between 0 and 1 representing the relative position of the top left of the display. |
| -> Fraction | fraction between 0 and 1 representing the relative position of the bottom right of the display. |
| -> IO () | None. |
Sets the scrollbar parameters.