 | WxGeneric-0.5.0: Library which constructing generic (SYB3-based) widgets for WxHaskell | Contents | Index |
|
| Graphics.UI.WxGeneric.Composite |
|
|
|
|
| Description |
| Module to ease composing zero-to-many widgets to a larger
composite widget.
|
|
| Synopsis |
|
|
|
|
| Composite type
|
|
| data Composite super user |
| Data type which contains a composite widget
| Instances | |
|
|
| 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.
|
| | Instances | |
|
|
| 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 |