-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | eXtended & Typed Controls for wxHaskell. -- -- The XTC library provides a typed interface to several wxHaskell -- controls. -- -- -- -- XTC controls keep track of typed values and items, rather than being -- string based. Selections in XTC controls consist of actual values -- instead of indices. @package xtc @version 1.0 -- | XTC: eXtended & Typed Controls for wxHaskell -- -- The XTC library provides a typed interface to several wxHaskell -- controls. -- -- -- -- XTC controls keep track of typed values and items, rather than being -- string based. Selections in XTC controls consist of actual values -- instead of indices. module Graphics.UI.XTC -- | The labeled class is used by mkRadioView, mkListView, -- mkMultiListView, and mkChoiceView for conveniently -- passing the function that maps an item onto its label. class Labeled x toLabel :: Labeled x => x -> String -- | Widgets that have a typed value. The value can be accessed via the -- attribute typedValue, and has type x. class TypedValued x w | w -> x typedValue :: TypedValued x w => Attr w (Maybe x) -- | Widgets that have a typed list of items. The item list can be accessed -- via the attribute typedItems, and has type [x]. class Items w String => TypedItems x w | w -> x typedItems :: TypedItems x w => Attr w [x] -- | Widgets that have a typed selection. The selection can be accessed via -- the attribute typedSelection, and has type x. class Selection w => TypedSelection x w | w -> x typedSelection :: TypedSelection x w => Attr w x -- | Widgets that have a typed selection that may be empty. The selection -- can be accessed via the attribute typedMaybeSelection, and has -- type Maybe x. class Selection w => TypedMaybeSelection x w | w -> x typedMaybeSelection :: TypedMaybeSelection x w => Attr w (Maybe x) -- | Widgets that have a typed list of selections. The selection list can -- be accessed via the attribute typedSelections, and has type -- [x]. class Selections w => TypedSelections x w | w -> x typedSelections :: TypedSelections x w => Attr w [x] class Observable w change :: Observable w => Event w (IO ()) -- | Pointer to a radio view, deriving from RadioBox. type RadioView x b = RadioBox (CRadioView x b) -- | Create a new radio view with an initial orientation and a list of -- typed items. The item type (x) must be an instance of -- Labeled to show each item's label. Use attribute -- typedSelection to access the currently selected item, and -- typedItems to access the list of items. Note: for a radio view -- (or radio box) the items may not be modified dynamically. -- -- mkRadioView :: Labeled x => Window a -> Orientation -> [x] -> [Prop (RadioView x ())] -> IO (RadioView x ()) -- | Create a new radio view with an initial orientation and a list of -- typed items. A function of type (x -> String) maps items -- onto labels. Use attribute typedSelection to access the -- currently selected item, and typedItems to access the list of -- items. Note: for a radio view (or radio box) the items may not be -- modified dynamically. -- -- mkRadioViewEx :: Window a -> (x -> String) -> Orientation -> [x] -> [Prop (RadioView x ())] -> IO (RadioView x ()) -- | Pointer to a single-selection list view, deriving from -- SingleListBox. type ListView a b = SingleListBox (CListView a b) -- | Create a single-selection list view. The item type (x) must -- be an instance of Labeled to show each item's label. Use -- attribute typedMaybeSelection to access the currently selected -- item, and typedItems to access the list of items. -- -- mkListView :: Labeled x => Window a -> [Prop (ListView x ())] -> IO (ListView x ()) -- | Create a single-selection list view. A function of type (x -> -- String) maps items onto labels. Use attribute -- typedMaybeSelection to access the currently selected item, and -- typedItems to access the list of items. -- -- mkListViewEx :: Window a -> (x -> String) -> [Prop (ListView x ())] -> IO (ListView x ()) -- | Pointer to a multiple-selection list view, deriving from -- MultiListBox. type MultiListView a b = MultiListBox (CMultiListView a b) -- | Create a multiple-selection list view. The item type (x) must -- be an instance of Labeled to show each item's label. Use -- attribute typedSelections to access the currently selected -- items, and typedItems to access the list of items. -- -- mkMultiListView :: Labeled x => Window a -> [Prop (MultiListView x ())] -> IO (MultiListView x ()) -- | Create a multiple-selection list view. A function of type (x -> -- String) maps items onto labels. Use attribute -- typedSelections to access the currently selected items, and -- typedItems to access the list of items. -- -- mkMultiListViewEx :: Window a -> (x -> String) -> [Prop (MultiListView x ())] -> IO (MultiListView x ()) -- | Pointer to a choice view, deriving from Choice. type ChoiceView a b = Choice (CChoiceView a b) -- | Create a choice view to select one item from a list of typed items. -- The item type (x) must be an instance of Labeled to -- show each item's label. Use attribute typedMaybeSelection to -- access the currently selected item, and typedItems to access -- the list of items. -- -- mkChoiceView :: Labeled x => Window a -> [Prop (ChoiceView x ())] -> IO (ChoiceView x ()) -- | Create a choice view to select one item from a list of typed items. A -- function of type (x -> String) maps items onto labels. Use -- attribute typedMaybeSelection to access the currently selected -- item, and typedItems to access the list of items. -- -- mkChoiceViewEx :: Window a -> (x -> String) -> Style -> [Prop (ChoiceView x ())] -> IO (ChoiceView x ()) -- | Pointer to a choice view, deriving from TextCtrl. type ValueEntry x b = TextCtrl (CValueEntry x b) -- | Create a single-line value entry control. The value type (x) -- must be an instance of Show and Read to present a value -- as a string in the entry and parse the string from the entry back to -- (maybe) a value. Use typedValue to access the value. Note: -- alignment has to be set at creation time (or the entry has -- default alignment (=left) ). -- -- mkValueEntry :: (Show x, Read x) => Window b -> [Prop (ValueEntry x ())] -> IO (ValueEntry x ()) -- | Create a single-line value entry control. The two functions of type -- (x -> String) and (String -> Maybe x) are used -- to present a value as a string in the entry and parse the string from -- the entry back to (maybe) a value. Use typedValue to access the -- value. Note: alignment has to be set at creation time (or the -- entry has default alignment (=left) ). -- -- mkValueEntryEx :: Window b -> (x -> String) -> (String -> Maybe x) -> [Prop (ValueEntry x ())] -> IO (ValueEntry x ()) instance Observable (TextCtrl a) instance Selection (ChoiceView x ()) instance Selecting (ChoiceView x ()) instance TypedValued x (ValueEntry x ()) instance TypedItems x (ChoiceView x ()) instance TypedMaybeSelection x (ChoiceView x ()) instance TypedItems x (MultiListView x ()) instance TypedSelections x (MultiListView x ()) instance TypedItems x (ListView x ()) instance TypedMaybeSelection x (ListView x ()) instance TypedItems x (RadioView x ()) instance TypedSelection x (RadioView x ()) instance Labeled String