SybWidget-0.4.0: Library which aids constructing generic (SYB3-based) widgetsSource codeContentsIndex
Graphics.UI.SybWidget.PriLabel
Description

PriLabels are labels with a priority.

PriLabels are usefull when widgets can have their label set multiple times. This happens with genericcally created widgets. For example in:

data Foo = Foo { someName :: Bar } data Bar = Bar Int

widgets created from Bar instances can have labels set due it's constructor name and the fieldName in Foo (someName). A GUI application programmer may also set the widgets label.

When a widget has set it's label multiple times, the priority can be used to decide which label should be chosen.

Synopsis
data PriLabel = PriLabel {
priority :: Priority
labelString :: String
}
data Priority
= BadConstr
| GoodConstr
| FieldName
| UserDefined
badConstrLabel :: String -> PriLabel
goodConstrLabel :: String -> PriLabel
fieldNameLabel :: String -> PriLabel
userDefinedLabel :: String -> PriLabel
bestLabel :: PriLabel -> PriLabel -> PriLabel
humanizeLabel :: PriLabel -> PriLabel
defaultLabel :: String -> PriLabel
labelless :: PriLabel
Documentation
data PriLabel Source
Prioritized label. If two PriLabel can be used for some component, then the one with highest priority is used.
Constructors
PriLabel
priority :: Priority
labelString :: String
show/hide Instances
data Priority Source
The label priority.
Constructors
BadConstr
GoodConstr
FieldName
UserDefined
show/hide Instances
badConstrLabel :: String -> PriLabelSource
goodConstrLabel :: String -> PriLabelSource
fieldNameLabel :: String -> PriLabelSource
userDefinedLabel :: String -> PriLabelSource
bestLabel :: PriLabel -> PriLabel -> PriLabelSource
Choose label with highest priority. If equal then choose the left |(first parameter) label.
humanizeLabel :: PriLabel -> PriLabelSource
Humanized label strings, by turning labels like someLabelName into Some label name.
defaultLabel :: String -> PriLabelSource
Creates a default (lowest priority) PriLabel
labelless :: PriLabelSource
Produced by Haddock version 2.1.0