wx-0.12.1.5: wxHaskell

Portabilityportable
Stabilityprovisional
Maintainerwxhaskell-devel@lists.sourceforge.net

Graphics.UI.WX.Classes

Contents

Description

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.

Synopsis

Data types

data Border Source

Window borders

Constructors

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

class Textual w whereSource

Widgets with a label or text field.

Methods

text :: Attr w StringSource

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

class Literate w whereSource

Widgets with a font.

Methods

font :: Attr w FontStyleSource

The font of the widget.

fontSize :: Attr w IntSource

The font size.

fontWeight :: Attr w FontWeightSource

The font weight.

fontFamily :: Attr w FontFamilySource

The font family.

fontShape :: Attr w FontShapeSource

The font style.

fontFace :: Attr w StringSource

The font face: determines a platform dependent font.

fontUnderline :: Attr w BoolSource

Is the font underlined?

textColor :: Attr w ColorSource

Text color.

textBgcolor :: Attr w ColorSource

Text background color

Instances

Rendering

class Dimensions w whereSource

Widgets that have a size.

Methods

outerSize :: Attr w SizeSource

The outer size of a widget (in pixels).

position :: Attr w PointSource

The (relative) position of a widget.

area :: Attr w RectSource

The occupied area.

bestSize :: ReadAttr w SizeSource

The preferred size of a widget.

clientSize :: Attr w SizeSource

The area available for client use (i.e. without the border etc).

virtualSize :: Attr w SizeSource

The virtual size of a widget (ie. the total scrolling area)

Instances

class Colored w whereSource

Methods

bgcolor :: Attr w ColorSource

The background color.

color :: Attr w ColorSource

The (foreground) color

Instances

class Visible w whereSource

Visible widgets.

Methods

visible :: Attr w BoolSource

Is the widget visible?

refresh :: w -> IO ()Source

Refresh the widget explicitly.

fullRepaintOnResize :: Attr w BoolSource

Should the widget be fully repainted on resize? This attribute only has effect when set at creation. If False, you will have to repaint the new window area manually at a resize, but flickering caused by background redraws can be prevented in this way. (False by default)

Instances

class Bordered w whereSource

Widgets with a border.

Methods

border :: Attr w BorderSource

Specify the border of a widget.

Instances

Hierarchy

class Child w whereSource

Widgets that are part of a hierarchical order.

Methods

parent :: ReadAttr w (Window ())Source

The parent widget.

Instances

class Parent w whereSource

Parent widgets.

Methods

children :: ReadAttr w [Window ()]Source

Get the child widgets of a window.

clipChildren :: Attr w BoolSource

Reduce flicker by not redrawing the background under child controls. This attribute has to be set at creation time. (True by default)

Instances

class Closeable w whereSource

Widgets that can be closed.

Methods

close :: w -> IO ()Source

Close the widget.

Instances

Containers

class Selection w whereSource

Widgets with a single selection (radio group or listbox)

Methods

selection :: Attr w IntSource

The current selection as a zero-based index. Certain widgets return -1 when no item is selected.

class Selections w whereSource

Widget with zero or more selections (multi select list boxes)

Methods

selections :: Attr w [Int]Source

The currently selected items in zero-based indices.

Instances

class Items w a | w -> a whereSource

Widgets containing certain items (like strings in a listbox)

Methods

itemCount :: ReadAttr w IntSource

Number of items.

items :: Attr w [a]Source

All the items as a list. This attribute might not be writable for some widgets (like radioboxes)

item :: Int -> Attr w aSource

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.

class Able w whereSource

Widgets that can be enabled or disabled.

Methods

enabled :: Attr w BoolSource

Enable, or disable, the widget.

class Help w whereSource

Widgets with help text.

Methods

help :: Attr w StringSource

Short help text, normally displayed in the status bar or popup balloon.

Instances

class Tipped w whereSource

Widgets that have a tooltip

Methods

tooltip :: Attr w StringSource

The tooltip information

class Identity w whereSource

The identity determines the wxWindows ID of a widget.

Methods

identity :: Attr w IntSource

The identity determines the wxWindows ID of a widget.

class Styled w whereSource

The style is a bitmask that determines various properties of a widget.

Methods

style :: Attr w IntSource

The windows style.

Instances

class Framed w whereSource

Widgets that have a system frame around them.

Methods

resizeable :: Attr w BoolSource

Make the widget user resizeable? This attribute must be set at creation time.

minimizeable :: Attr w BoolSource

Can the widget be minimized? This attribute must be set at creation time.

maximizeable :: Attr w BoolSource

Can the widget be maximized? This attribute must be set at creation time and is normally used together with resizeable.

closeable :: Attr w BoolSource

Can the widget be closed by the user? This attribute must be set at creation time.

Instances

class Checkable w whereSource

Checkable widgets

Methods

checkable :: Attr w BoolSource

Is the widget checkable?

checked :: Attr w BoolSource

Is the widget checked?

class Dockable w whereSource

Dockable widgets.

Methods

dockable :: Attr w BoolSource

Is the widget dockable?

class Pictured w whereSource

Widgets with a picture.

Methods

picture :: Attr w FilePathSource

The image of a widget.

class Valued w whereSource

Items with a value.

Methods

value :: Attr (w a) aSource

The value of an object.

Instances

class Sized w whereSource

Sized objects (like bitmaps)

Methods

size :: Attr w SizeSource

The size of an object. (is outerSize for Dimensions widgets).

Instances

class HasDefault w whereSource

Objects which activate a Window by default keypress

Methods

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.

Instances