WxGeneric-0.5.0: Library which constructing generic (SYB3-based) widgets for WxHaskellContentsIndex
Graphics.UI.WxGeneric.Composite
Contents
Composite type
Mapping attributes
Mapping events
Other
Description
Module to ease composing zero-to-many widgets to a larger composite widget.
Synopsis
data Composite super user
pickPanel :: Composite super user -> Window w
pickSuper :: Composite super user -> super
pickUser :: Composite super user -> user
compose :: (Panel () -> IO (Layout, super, user)) -> Window w -> [Prop (Composite super user)] -> IO (Composite super user)
singleComposite :: Window w -> super -> user -> Composite super user
mapFromPanel :: (forall w. Attr (Window w) attr) -> Attr (Composite super user) attr
forAllChildren :: Attr (Window ()) attr -> (forall w. Attr (Window w) attr) -> Attr (Composite super user) attr
mapFromSuper :: Attr super attr -> Attr (Composite super user) attr
mapFromUser :: Attr user attr -> Attr (Composite super user) attr
mapEventF :: (to -> from) -> Event from event -> Event to event
mapEventSuper :: Event super event -> Event (Composite super user) event
mapEventPanel :: (forall w. Event (Window w) event) -> Event (Composite super user) event
class ValuedWidget x w | w -> x where
widgetValue :: Attr w x
widgetValue :: ValuedWidget x w => Attr w x
updateSuper :: (super -> super') -> Composite super user -> Composite super' user
updateUser :: (user -> user') -> Composite super user -> Composite super user'
Composite type
data Composite super user
Data type which contains a composite widget
show/hide Instances
ValuedWidget a (super a) => ValuedWidget a (Composite (super a) user)
Widget (Composite super user)
Able (Composite super user)
Bordered (Composite super user)
Child (Composite super user)
Colored (Composite super user)
Dimensions (Composite super user)
Identity (Composite super user)
Literate (Composite super user)
Visible (Composite super user)
Checkable super => Checkable (Composite super user)
Help super => Help (Composite super user)
Observable super => Observable (Composite super user)
Tipped super => Tipped (Composite super user)
Selection super => Selection (Composite super user)
Selections super => Selections (Composite super user)
Textual super => Textual (Composite super user)
Selecting super => Selecting (Composite super user)
Commanding super => Commanding (Composite super user)
Reactive (Composite super user)
Items super String => Items (Composite super user) String
pickPanel :: Composite super user -> Window w
pickSuper :: Composite super user -> super
pickUser :: Composite super user -> user
compose :: (Panel () -> IO (Layout, super, user)) -> Window w -> [Prop (Composite super user)] -> IO (Composite super user)

Composes zero-to-many widgets to a larger composite widget

The composite will automatically implement the following classes:

  • Widget
  • Able
  • Bordered
  • Child
  • Dimensions
  • Identity
  • Literate
  • Visible
  • Reactive (event class)

if the supertype implements one of the following classes, so will the Composite:

  • Items
  • Observable
  • Selection
  • Selections
  • Textual
  • Commanding (event class)
  • Selecting (event class)
  • ValuedWidget

if the composite needs to implement more classes it should be done as follows:

type MyComposite = Composite super user

instance Foo MyComposite where
   ...
singleComposite :: Window w -> super -> user -> Composite super user
Encapsulate a single 'Window w' in the composite type
Mapping attributes
mapFromPanel :: (forall w. Attr (Window w) attr) -> Attr (Composite super user) attr
Used when an attribute should apply to the panel
forAllChildren :: Attr (Window ()) attr -> (forall w. Attr (Window w) attr) -> Attr (Composite super user) attr
Used when an attribute should apply to the panel and all of its children
mapFromSuper :: Attr super attr -> Attr (Composite super user) attr
Used when an attribute should apply to the supertype
mapFromUser :: Attr user attr -> Attr (Composite super user) attr
Used when an attribute should apply to the usertype
Mapping events
mapEventF :: (to -> from) -> Event from event -> Event to event
Mapping events using a mapper function
mapEventSuper :: Event super event -> Event (Composite super user) event
Mapping events from supertype
mapEventPanel :: (forall w. Event (Window w) event) -> Event (Composite super user) event
Mapping events from the Panel ()
Other
class ValuedWidget x w | w -> x where
Methods
widgetValue :: Attr w x
An attribute for the value of a widget. The value should have as precise a type as possible. For example a slider should properly have type Attr Slider Int.
show/hide Instances
ValuedWidget a (GenWid a)
ValuedWidget a (super a) => ValuedWidget a (Composite (super a) user)
widgetValue :: ValuedWidget x w => Attr w x
An attribute for the value of a widget. The value should have as precise a type as possible. For example a slider should properly have type Attr Slider Int.
updateSuper :: (super -> super') -> Composite super user -> Composite super' user
updateUser :: (user -> user') -> Composite super user -> Composite super user'
Produced by Haddock version 2.1.0