|  | Source code | Contents | Index

Graphics.UI.ObjectIO.StdControl |

Portability | portable
Stability | provisional
Maintainer | ka2_mail@yahoo.com

Contents

Function declarations
  Common
  Show/Hide controls.
  Enabling/Disabling of controls.
  Control layout
  Get/Change the text of (Text/Edit/Button)Control.
  Drawing in CustomControl, CustomButtonControl and CompoundControl
  Positioning and resizing of controls
  Selection controls (The functions are applicable to
  Compound control specific functions.
  Edit control specific functions.
  PopUp control specific functions.
  ListBox control specific functions.
  Slider control specific functions.
A visible modules

Description
StdControl specifies all control operations. Object I/O library supports various kinds of built-in controls which can be placed inside windows and dialogs. In order to define his/her own type controls, the user should give an instance of Controls class (see Graphics.UI.ObjectIO.StdWindow)
Synopsis

getParentWindowId :: Id -> GUI ps (Maybe Id)
controlSize :: Controls cdef => cdef ls ps -> Bool -> Maybe (Int, Int) -> Maybe (Int, Int) -> Maybe (Int, Int) -> GUI ps Size
openControls :: Controls cdef => Id -> ls -> cdef ls ps -> GUI ps ()
closeControls :: Id -> [Id] -> Bool -> GUI ps ()
closeAllControls :: Id -> GUI ps ()
showControl :: Id -> GUI ps ()
showControls :: [Id] -> GUI ps ()
hideControl :: Id -> GUI ps ()
hideControls :: [Id] -> GUI ps ()
getControlShowStates :: [Id] -> GUI ps [(Bool, Bool)]
getControlShowState :: Id -> GUI ps (Bool, Bool)
enableControl :: Id -> GUI ps ()
enableControls :: [Id] -> GUI ps ()
disableControl :: Id -> GUI ps ()
disableControls :: [Id] -> GUI ps ()
getControlSelectStates :: [Id] -> GUI ps [(Bool, SelectState)]
getControlSelectState :: Id -> GUI ps (Bool, SelectState)
getControlLayouts :: [Id] -> GUI ps [(Bool, (Maybe ItemPos, Vector2))]
getControlLayout :: Id -> GUI ps (Bool, (Maybe ItemPos, Vector2))
setControlText :: Id -> String -> GUI ps ()
setControlTexts :: [(Id, String)] -> GUI ps ()
getControlText :: Id -> GUI ps (Bool, Maybe String)
getControlTexts :: [Id] -> GUI ps [(Bool, Maybe String)]
drawInControl :: Id -> Draw x -> GUI ps (Maybe x)
updateControl :: Id -> Maybe ViewFrame -> GUI ps ()
setControlLooks :: [(Id, Bool, (Bool, Look))] -> GUI ps ()
setControlLook :: Id -> Bool -> (Bool, Look) -> GUI ps ()
getControlLooks :: [Id] -> GUI ps [(Bool, Maybe (Bool, Look))]
getControlLook :: Id -> GUI ps (Bool, Maybe (Bool, Look))
setControlPos :: Id -> [(Id, ItemPos)] -> GUI ps Bool
getControlViewSize :: Id -> GUI ps (Bool, Size)
getControlViewSizes :: [Id] -> GUI ps [(Bool, Size)]
getControlOuterSizes :: [Id] -> GUI ps [(Bool, Size)]
getControlOuterSize :: Id -> GUI ps (Bool, Size)
getControlMinimumSizes :: [Id] -> GUI ps [(Bool, Maybe Size)]
getControlMinimumSize :: Id -> GUI ps (Bool, Maybe Size)
getControlResizes :: [Id] -> GUI ps [(Bool, Maybe ControlResizeFunction)]
getControlResize :: Id -> GUI ps (Bool, Maybe ControlResizeFunction)
getControlItems :: [Id] -> GUI ps [(Bool, Maybe [String])]
getControlItem :: Id -> GUI ps (Bool, Maybe [String])
selectControlItem :: Id -> Index -> GUI ps ()
getControlSelections :: [Id] -> GUI ps [(Bool, Maybe Index)]
getControlSelection :: Id -> GUI ps (Bool, Maybe Index)
markControlItems :: Id -> [Index] -> GUI ps ()
unmarkControlItems :: Id -> [Index] -> GUI ps ()
setControlsMarkState :: MarkState -> Id -> [Index] -> GUI ps ()
getControlMarks :: [Id] -> GUI ps [(Bool, Maybe [Index])]
getControlMark :: Id -> GUI ps (Bool, Maybe [Index])
getControlViewFrames :: [Id] -> GUI ps [(Bool, Maybe ViewFrame)]
getControlViewFrame :: Id -> GUI ps (Bool, Maybe ViewFrame)
moveControlViewFrame :: Id -> Vector2 -> GUI ps ()
getControlViewDomains :: [Id] -> GUI ps [(Bool, Maybe ViewDomain)]
getControlViewDomain :: Id -> GUI ps (Bool, Maybe ViewDomain)
setControlViewDomain :: Id -> ViewDomain -> GUI ps ()
getControlScrollFunction :: Id -> GUI ps (Bool, Maybe ((Direction, Maybe ScrollFunction), (Direction, Maybe ScrollFunction)))
getControlScrollFunctions :: [Id] -> GUI ps [(Bool, Maybe ((Direction, Maybe ScrollFunction), (Direction, Maybe ScrollFunction)))]
setControlScrollFunction :: Id -> Direction -> ScrollFunction -> GUI ps ()
openCompoundControls :: Controls cdef => Id -> ls -> cdef ls ps -> GUI ps ()
setEditControlCursor :: Id -> Int -> GUI ps ()
getControlNrLines :: [Id] -> GUI ps [(Bool, Maybe NrLines)]
getControlNrLine :: Id -> GUI ps (Bool, Maybe NrLines)
openPopUpControlItems :: Id -> Index -> [PopUpControlItem ps ps] -> GUI ps ()
closePopUpControlItems :: Id -> [Index] -> GUI ps ()
openListBoxControlItems :: Id -> Index -> [ListBoxControlItem ps ps] -> GUI ps ()
closeListBoxControlItems :: Id -> [Index] -> GUI ps ()
setSliderState :: Id -> IdFun SliderState -> GUI ps ()
setSliderStates :: [(Id, IdFun SliderState)] -> GUI ps ()
setSliderThumb :: Id -> Int -> GUI ps ()
setSliderThumbs :: [(Id, Int)] -> GUI ps ()
getSliderDirection :: Id -> GUI ps (Bool, Maybe Direction)
getSliderDirections :: [Id] -> GUI ps [(Bool, Maybe Direction)]
getSliderState :: Id -> GUI ps (Bool, Maybe SliderState)
getSliderStates :: [Id] -> GUI ps [(Bool, Maybe SliderState)]
module Graphics.UI.ObjectIO.StdControlDef
module Graphics.UI.ObjectIO.StdControlClass

Function declarations
Common
getParentWindowId :: Id -> GUI ps (Maybe Id)
getParentWindowId returns id of parent window of control with specified Id.
controlSize :: Controls cdef => cdef ls ps -> Bool -> Maybe (Int, Int) -> Maybe (Int, Int) -> Maybe (Int, Int) -> GUI ps Size
giving horizontal and vertical margins and item spaces, controlSize function calculates the size of the given control.
openControls :: Controls cdef => Id -> ls -> cdef ls ps -> GUI ps ()
Controls can be dynamically added to an existing window with openControls function.
closeControls :: Id -> [Id] -> Bool -> GUI ps ()
The closeControls function closes the specified controls in the indicated window.
closeAllControls :: Id -> GUI ps ()
Show/Hide controls.
showControl :: Id -> GUI ps ()
displays a control in its most recent size and position.
showControls :: [Id] -> GUI ps ()
displays a given set of controls
hideControl :: Id -> GUI ps ()
hides the control and activates another control
hideControls :: [Id] -> GUI ps ()
hides a given set of controls
getControlShowStates :: [Id] -> GUI ps [(Bool, Bool)]
returns a list of currents show states from list of control ids
getControlShowState :: Id -> GUI ps (Bool, Bool)
returns current show state of the control
Enabling/Disabling of controls.
enableControl :: Id -> GUI ps ()
The enableControl function enables mouse and keyboard input to the specified control. When input is enabled, the control receives all input.
enableControls :: [Id] -> GUI ps ()
enables set of controls
disableControl :: Id -> GUI ps ()
The disableControl function disables mouse and keyboard input to the specified control. When input is disabled, the control does not receive input such as mouse clicks and key presses.
disableControls :: [Id] -> GUI ps ()
disables set of controls
getControlSelectStates :: [Id] -> GUI ps [(Bool, SelectState)]
returns a list of select state from list of controls ids
getControlSelectState :: Id -> GUI ps (Bool, SelectState)
returns current select state of given control
Control layout
getControlLayouts :: [Id] -> GUI ps [(Bool, (Maybe ItemPos, Vector2))]
getControlLayout :: Id -> GUI ps (Bool, (Maybe ItemPos, Vector2))
Get/Change the text of (Text/Edit/Button)Control.
setControlText :: Id -> String -> GUI ps ()
If the specified Id is an Id of Text, Edit of Button control, the text (caption) of the control is changed.
setControlTexts :: [(Id, String)] -> GUI ps ()
Works like `setControlText` but for set of controls
getControlText :: Id -> GUI ps (Bool, Maybe String)
If the specified Id is an Id of Text, Edit or Button control, the text (caption) of the control is returned.
getControlTexts :: [Id] -> GUI ps [(Bool, Maybe String)]
Works like getControlText but for set of controls.
Drawing in CustomControl, CustomButtonControl and CompoundControl
drawInControl :: Id -> Draw x -> GUI ps (Maybe x)
direct draw in control
updateControl :: Id -> Maybe ViewFrame -> GUI ps ()
The updateControl function updates the view frame of the specified control.
setControlLooks :: [(Id, Bool, (Bool, Look))] -> GUI ps ()
change the `Look` of the corresponding set of controls but redraw only if the first boolean parameter is `True`
setControlLook :: Id -> Bool -> (Bool, Look) -> GUI ps ()
change the `Look` of the corresponding control but redraw only if the first boolean parameter is `True`
getControlLooks :: [Id] -> GUI ps [(Bool, Maybe (Bool, Look))]
returns current controls `Look`
getControlLook :: Id -> GUI ps (Bool, Maybe (Bool, Look))
returns current controls `Look`
Positioning and resizing of controls
setControlPos :: Id -> [(Id, ItemPos)] -> GUI ps Bool
The setControlPos function changes the position of the specified control. It is relative to the upper-left corner of the parent window's client area.
getControlViewSize :: Id -> GUI ps (Bool, Size)
The getControlViewSize function retrieves the dimensions of a control's client area
getControlViewSizes :: [Id] -> GUI ps [(Bool, Size)]
returns a list of control dimensions from list of controls ids
getControlOuterSizes :: [Id] -> GUI ps [(Bool, Size)]
returns a list of control outer dimensions from list of controls ids
getControlOuterSize :: Id -> GUI ps (Bool, Size)
The getControlOuterSize function retrieves the dimensions of the bounding rectangle of the specified control.
getControlMinimumSizes :: [Id] -> GUI ps [(Bool, Maybe Size)]
returns the minimal valid size when resizing
getControlMinimumSize :: Id -> GUI ps (Bool, Maybe Size)
returns the minimal valid size when resizing
getControlResizes :: [Id] -> GUI ps [(Bool, Maybe ControlResizeFunction)]
Works like `getControlResizes` but for set of controls
getControlResize :: Id -> GUI ps (Bool, Maybe ControlResizeFunction)
returns the control resizing function. When the parent window of a given control is resized, then the control can be resized if it has a resize function.
Selection controls (The functions are applicable to
getControlItems :: [Id] -> GUI ps [(Bool, Maybe [String])]
The getControlItems function returns the list of control items.
getControlItem :: Id -> GUI ps (Bool, Maybe [String])
returns the list of items for a given control
selectControlItem :: Id -> Index -> GUI ps ()
The selectControlItem function selects a string in the selection control. Any previous selection in the control is removed.
getControlSelections :: [Id] -> GUI ps [(Bool, Maybe Index)]
Call this member function to determine which item is selected, for each selection control in the list.
getControlSelection :: Id -> GUI ps (Bool, Maybe Index)
Call this member function to determine which item in the selection control is selected.
markControlItems :: Id -> [Index] -> GUI ps ()
The items with specified indices becomes set on.
unmarkControlItems :: Id -> [Index] -> GUI ps ()
The items with specified indices becomes set off.
setControlsMarkState :: MarkState -> Id -> [Index] -> GUI ps ()
Sets or resets the mark state of a selection control.
getControlMarks :: [Id] -> GUI ps [(Bool, Maybe [Index])]
Works like `getControlMark` but for set of selection controls
getControlMark :: Id -> GUI ps (Bool, Maybe [Index])
returns a the list of indices which indicates currently selected items
Compound control specific functions.
getControlViewFrames :: [Id] -> GUI ps [(Bool, Maybe ViewFrame)]
returns a list of `ViewFrame`s from list of control ids
getControlViewFrame :: Id -> GUI ps (Bool, Maybe ViewFrame)
If the specified Id is an Id of Compound control, the current `ViewFrame` of the control is returned.
moveControlViewFrame :: Id -> Vector2 -> GUI ps ()
moves the `ViewFrame` of the CompoundControl in the direction of the given vector.
getControlViewDomains :: [Id] -> GUI ps [(Bool, Maybe ViewDomain)]
getControlViewDomain :: Id -> GUI ps (Bool, Maybe ViewDomain)
setControlViewDomain :: Id -> ViewDomain -> GUI ps ()
getControlScrollFunction :: Id -> GUI ps (Bool, Maybe ((Direction, Maybe ScrollFunction), (Direction, Maybe ScrollFunction)))
getControlScrollFunction(s) yields the `ScrollFunction`s of the indicated CompoundControl. If the given control is not a CompoundControl, then Nothing is returned.
getControlScrollFunctions :: [Id] -> GUI ps [(Bool, Maybe ((Direction, Maybe ScrollFunction), (Direction, Maybe ScrollFunction)))]
Works like `setControlText` but for set of controls
setControlScrollFunction :: Id -> Direction -> ScrollFunction -> GUI ps ()
Sets a new scroll function of the CompoundControl.
openCompoundControls :: Controls cdef => Id -> ls -> cdef ls ps -> GUI ps ()
openCompoundControls adds controls to the indicated CompoundControl
Edit control specific functions.
setEditControlCursor :: Id -> Int -> GUI ps ()
Set the cursor position of an EditControl.
getControlNrLines :: [Id] -> GUI ps [(Bool, Maybe NrLines)]
The getControlNrLines function returns the number of lines for each EditControl from specified list of ids.
getControlNrLine :: Id -> GUI ps (Bool, Maybe NrLines)
The getControlNrLine function returns the number of lines that can be seen (on the screen at the moment) for a given control.
PopUp control specific functions.
openPopUpControlItems :: Id -> Index -> [PopUpControlItem ps ps] -> GUI ps ()
The openPopUpControlItems function adds new items to the PopUpControl.
closePopUpControlItems :: Id -> [Index] -> GUI ps ()
The closePopUpControlItems function deletes a string with specified index from the list box of the popup control.
ListBox control specific functions.
openListBoxControlItems :: Id -> Index -> [ListBoxControlItem ps ps] -> GUI ps ()
The openListBoxControlItems function adds new items to the ListBoxControl.
closeListBoxControlItems :: Id -> [Index] -> GUI ps ()
The closeListBoxControlItems function deletes a string with specified index from the control.
Slider control specific functions.
setSliderState :: Id -> IdFun SliderState -> GUI ps ()
changes the `SliderState` and redraws the settings of the SliderControls.
setSliderStates :: [(Id, IdFun SliderState)] -> GUI ps ()
changes the `SliderState` and redraws the settings of the SliderControls.
setSliderThumb :: Id -> Int -> GUI ps ()
changes the thumb value of the `SliderState` of SliderControl.
setSliderThumbs :: [(Id, Int)] -> GUI ps ()
changes the thumb value of the `SliderState` for each SliderControl from the given set.
getSliderDirection :: Id -> GUI ps (Bool, Maybe Direction)
gets the slider direction i. e. `Horizontal` or `Vertical`.
getSliderDirections :: [Id] -> GUI ps [(Bool, Maybe Direction)]
gets the sliders directions.
getSliderState :: Id -> GUI ps (Bool, Maybe SliderState)
gets a current `SliderState`
getSliderStates :: [Id] -> GUI ps [(Bool, Maybe SliderState)]
gets a current `SliderState`s
A visible modules
module Graphics.UI.ObjectIO.StdControlDef
module Graphics.UI.ObjectIO.StdControlClass
Produced by Haddock version 0.8