Safe Haskell | None |
---|---|
Language | Haskell98 |
This modules defines attributes common to many widgets and organizes them into Haskell classes. Look at the instance definitions to see what kind of widgets support the attributes.
Sometimes it is
hard to find what attributes a certain widget supports since the instance
definitions might be on some class higher in the hierarchy. For example,
many instances are defined for Window
a
-- this means that all
those attributes are applicable to any kind of Window
, i.e. frames,
buttons, panels etc. However, these attributes will not be explicitly
listed at the type definitions of those classes.
- data Border
- class Textual w where
- class Literate w where
- font :: Attr w FontStyle
- fontSize :: Attr w Int
- fontWeight :: Attr w FontWeight
- fontFamily :: Attr w FontFamily
- fontShape :: Attr w FontShape
- fontFace :: Attr w String
- fontUnderline :: Attr w Bool
- textColor :: Attr w Color
- textBgcolor :: Attr w Color
- class Dimensions w where
- class Colored w where
- class Visible w where
- class Bordered w where
- class Child w where
- class Parent w where
- class Closeable w where
- class Selection w where
- class Selections w where
- selections :: Attr w [Int]
- class Items w a | w -> a where
- itemCount :: ReadAttr w Int
- items :: Attr w [a]
- item :: Int -> Attr w a
- itemDelete :: w -> Int -> IO ()
- itemsDelete :: w -> IO ()
- itemAppend :: w -> a -> IO ()
- class Able w where
- class Help w where
- class Tipped w where
- class Identity w where
- class Styled w where
- class Framed w where
- resizeable :: Attr w Bool
- minimizeable :: Attr w Bool
- maximizeable :: Attr w Bool
- closeable :: Attr w Bool
- class Checkable w where
- class Dockable w where
- class Pictured w where
- class Valued w where
- class Sized w where
- class HasDefault w where
- unsafeDefaultItem :: Attr w (Window ())
- defaultButton :: Attr w (Button ())
Data types
Window borders
BorderSimple | Displays a thin border around the window. |
BorderDouble | Displays a double border. Windows only. |
BorderSunken | Displays a sunken border. |
BorderRaised | Displays a raised border. |
BorderStatic | Displays a border suitable for a static control. Windows only |
BorderNone | No border |
Text
Widgets with a label or text field.
The text of a widget. It is interpreted differently for for different widgets, for example, the title of a frame or the content of a static text control.
appendText :: w -> String -> IO () Source
Widgets with a font.
font :: Attr w FontStyle Source
The font of the widget.
The font size.
fontWeight :: Attr w FontWeight Source
The font weight.
fontFamily :: Attr w FontFamily Source
The font family.
fontShape :: Attr w FontShape Source
The font style.
fontFace :: Attr w String Source
The font face: determines a platform dependent font.
fontUnderline :: Attr w Bool Source
Is the font underlined?
textColor :: Attr w Color Source
Text color.
textBgcolor :: Attr w Color Source
Text background color
Rendering
class Dimensions w where Source
Widgets that have a size.
Nothing
outerSize :: Attr w Size Source
The outer size of a widget (in pixels).
position :: Attr w Point Source
The (relative) position of a widget.
The occupied area.
bestSize :: ReadAttr w Size Source
The preferred size of a widget.
clientSize :: Attr w Size Source
The area available for client use (i.e. without the border etc).
virtualSize :: Attr w Size Source
The virtual size of a widget (ie. the total scrolling area)
Dimensions (Window a) |
Visible widgets.
Nothing
Is the widget visible?
Refresh the widget explicitly.
Widgets with a border.
Nothing
Hierarchy
Widgets that are part of a hierarchical order.
Nothing
Parent widgets.
Nothing
Containers
class Selection w where Source
Widgets with a single selection (radio group or listbox)
class Selections w where Source
Widget with zero or more selections (multi select list boxes)
selections :: Attr w [Int] Source
The currently selected items in zero-based indices.
class Items w a | w -> a where Source
Widgets containing certain items (like strings in a listbox)
itemCount :: ReadAttr w Int Source
Number of items.
All the items as a list. This attribute might not be writable for some widgets (like radioboxes)
item :: Int -> Attr w a Source
An item by zero-based index.
itemDelete :: w -> Int -> IO () Source
Delete an item. Only valid for writeable items.
itemsDelete :: w -> IO () Source
Delete all items. Only valid for writeable items.
itemAppend :: w -> a -> IO () Source
Append an item. Only valid for writeable items.
Misc.
Widgets that can be enabled or disabled.
Widgets with help text.
Help ToolBarItem | |
Help (MenuItem a) |
Widgets that have a tooltip
The identity determines the wxWidgets ID of a widget.
The style is a bitmask that determines various properties of a widget.
Widgets that have a system frame around them.
Nothing
resizeable :: Attr w Bool Source
Make the widget user resizeable? This attribute must be set at creation time.
minimizeable :: Attr w Bool Source
Can the widget be minimized? This attribute must be set at creation time.
maximizeable :: Attr w Bool Source
Can the widget be maximized? This attribute must be set at creation time
and is normally used together with resizeable
.
closeable :: Attr w Bool Source
Can the widget be closed by the user? This attribute must be set at creation time.
Framed (TopLevelWindow a) |
class Checkable w where Source
Checkable widgets
Checkable ToolBarItem | |
Checkable (ToggleButton a) | |
Checkable (CheckBox a) | |
Checkable (MenuItem a) |
Dockable widgets.
Widgets with a picture.
Pictured (BitmapToggleButton a) | |
Pictured (BitmapButton a) | |
Pictured (TopLevelWindow a) |
Items with a value.
Sized objects (like bitmaps)
class HasDefault w where Source
Objects which activate a Window
by default keypress
unsafeDefaultItem :: Attr w (Window ()) Source
Define a default item as any type deriving from Window
. Great care
is required when using this option as you will have to cast the item
to/from Window() using objectCast
.
For the common use case where the window in question is a Button
,
please use defaultButton
as it is typesafe.
defaultButton :: Attr w (Button ()) Source
Define the default button for a TopLevelWindow
. This is recommended
for most use cases as the most common default control is a Button
.