Safe Haskell | None |
---|
- data Panel
- data Win = Win {}
- data GuiNode = GuiNode {}
- newtype GuiHandle = GuiHandle {
- unGuiHandle :: Int
- newtype Gui = Gui {
- unGui :: LowGui
- data Elem
- data InitMe = InitMe {
- initHandle :: Var
- initValue :: Double
- restoreTree :: GuiMap -> Gui -> Gui
- guiMap :: [GuiNode] -> GuiMap
- mapGuiOnPanel :: (Gui -> Gui) -> Panel -> Panel
- fromElem :: ElemOuts -> [InitMe] -> Elem -> Gui
- fromGuiHandle :: GuiHandle -> Gui
- guiStmt :: Monad m => [Panel] -> DepT m ()
- hor :: [Gui] -> Gui
- ver :: [Gui] -> Gui
- space :: Gui
- sca :: Double -> Gui -> Gui
- horSca :: [(Double, Gui)] -> Gui
- verSca :: [(Double, Gui)] -> Gui
- padding :: Int -> Gui -> Gui
- margin :: Int -> Gui -> Gui
- props :: [Prop] -> Gui -> Gui
- forceProps :: [Prop] -> Gui -> Gui
- data Prop
- = SetLabel String
- | SetMaterial Material
- | SetBoxType BoxType
- | SetColor1 Color
- | SetColor2 Color
- | SetTextColor Color
- | SetFontSize Int
- | SetFontType FontType
- | SetEmphasis Emphasis
- | SetSliderType SliderType
- | SetTextType TextType
- | SetButtonType ButtonType
- | SetOrient Orient
- | SetKnobType KnobType
- | SetLabelType LabelType
- data BorderType
- = NoBorder
- | DownBoxBorder
- | UpBoxBorder
- | EngravedBorder
- | EmbossedBorder
- | BlackLine
- | ThinDown
- | ThinUp
- type Color = Colour Double
- data Rect = Rect {}
- data FontType
- data Emphasis
- = NoEmphasis
- | Italic
- | Bold
- | BoldItalic
- data Material
- data Orient
- data LabelType
- = NormalLabel
- | NoLabel
- | SymbolLabel
- | ShadowLabel
- | EngravedLabel
- | EmbossedLabel
- setBorder :: BorderType -> Gui -> Gui
- setLabel :: String -> Gui -> Gui
- setMaterial :: Material -> Gui -> Gui
- setLabelType :: LabelType -> Gui -> Gui
- setColor1 :: Color -> Gui -> Gui
- setColor2 :: Color -> Gui -> Gui
- setColors :: Color -> Color -> Gui -> Gui
- setTextColor :: Color -> Gui -> Gui
- setFontSize :: Int -> Gui -> Gui
- setFontType :: FontType -> Gui -> Gui
- setEmphasis :: Emphasis -> Gui -> Gui
- setOrient :: Orient -> Gui -> Gui
- data ValDiap = ValDiap {
- valDiapMin :: Double
- valDiapMax :: Double
- type ValStep = Double
- data ValScaleType
- = Linear
- | Exponential
- data ValSpan = ValSpan {}
- linSpan :: Double -> Double -> ValSpan
- expSpan :: Double -> Double -> ValSpan
- uspan :: ValSpan
- bspan :: ValSpan
- uspanExp :: ValSpan
- data KnobType
- setKnobType :: KnobType -> Gui -> Gui
- data SliderType
- setSliderType :: SliderType -> Gui -> Gui
- data TextType
- = NormalText
- | NoDrag
- | NoEdit
- setTextType :: TextType -> Gui -> Gui
- data BoxType
- = FlatBox
- | UpBox
- | DownBox
- | ThinUpBox
- | ThinDownBox
- | EngravedBox
- | EmbossedBox
- | BorderBox
- | ShadowBox
- | Roundedbox
- | RoundedShadowBox
- | RoundedFlatBox
- | RoundedUpBox
- | RoundedDownBox
- | DiamondUpBox
- | DiamondDownBox
- | OvalBox
- | OvalShadowBox
- | OvalFlatBox
- setBoxType :: BoxType -> Gui -> Gui
- data ButtonType
- setButtonType :: ButtonType -> Gui -> Gui
- panel :: Gui -> SE ()
- keyPanel :: Gui -> SE ()
- tabs :: [(String, Gui)] -> SE ()
- keyTabs :: [(String, Gui)] -> SE ()
- panels :: [Gui] -> SE ()
- keyPanels :: [Gui] -> SE ()
- panelBy :: String -> Maybe Rect -> Gui -> SE ()
- keyPanelBy :: String -> Maybe Rect -> Gui -> SE ()
- tabsBy :: String -> Maybe Rect -> [(String, Maybe Rect, Gui)] -> SE ()
- keyTabsBy :: String -> Maybe Rect -> [(String, Maybe Rect, Gui)] -> SE ()
- type Input a = a
- type Output a = a -> SE ()
- type Inner = SE ()
- noInput :: Input ()
- noOutput :: Output ()
- noInner :: Inner
- type Widget a b = SE (Gui, Output a, Input b, Inner)
- widget :: SE (Gui, Output a, Input b, Inner) -> Widget a b
- type Source a = SE (Gui, Input a)
- source :: SE (Gui, Input a) -> Source a
- type Sink a = SE (Gui, Output a)
- sink :: SE (Gui, Output a) -> Sink a
- type Display = SE Gui
- display :: SE Gui -> Display
- count :: ValDiap -> ValStep -> Maybe ValStep -> Double -> Source (Evt D)
- countSig :: ValDiap -> ValStep -> Maybe ValStep -> Double -> Source Sig
- joy :: ValSpan -> ValSpan -> (Double, Double) -> Source (Sig, Sig)
- knob :: String -> ValSpan -> Double -> Source Sig
- roller :: String -> ValSpan -> ValStep -> Double -> Source Sig
- slider :: String -> ValSpan -> Double -> Source Sig
- sliderBank :: String -> [Double] -> Source [Sig]
- numeric :: String -> ValDiap -> ValStep -> Double -> Source Sig
- meter :: String -> ValSpan -> Double -> Sink Sig
- box :: String -> Display
- button :: String -> Source (Evt Unit)
- butBank :: String -> Int -> Int -> (Int, Int) -> Source (Evt (D, D))
- butBankSig :: String -> Int -> Int -> (Int, Int) -> Source (Sig, Sig)
- butBank1 :: String -> Int -> Int -> (Int, Int) -> Source (Evt D)
- butBankSig1 :: String -> Int -> Int -> (Int, Int) -> Source Sig
- toggle :: String -> Source (Evt D)
- toggleSig :: String -> Source Sig
- value :: String -> Double -> Sink Sig
- setTitle :: String -> Gui -> SE Gui
- data KeyEvt
- data Key
- = CharKey Char
- | F1
- | F2
- | F3
- | F4
- | F5
- | F6
- | F7
- | F8
- | F9
- | F10
- | F11
- | F12
- | Scroll
- | CapsLook
- | LeftShift
- | RightShift
- | LeftCtrl
- | RightCtrl
- | Enter
- | LeftAlt
- | RightAlt
- | LeftWinKey
- | RightWinKey
- | Backspace
- | ArrowUp
- | ArrowLeft
- | ArrowRight
- | ArrowDown
- | Insert
- | Home
- | PgUp
- | Delete
- | End
- | PgDown
- | NumLock
- | NumDiv
- | NumMul
- | NumSub
- | NumHome
- | NumArrowUp
- | NumPgUp
- | NumArrowLeft
- | NumSpace
- | NumArrowRight
- | NumEnd
- | NumArrowDown
- | NumPgDown
- | NumIns
- | NumDel
- | NumEnter
- | NumPlus
- | Num7
- | Num8
- | Num9
- | Num4
- | Num5
- | Num6
- | Num1
- | Num2
- | Num3
- | Num0
- | NumDot
- keyIn :: KeyEvt -> Evt Unit
Documentation
restoreTree :: GuiMap -> Gui -> GuiSource
fromGuiHandle :: GuiHandle -> GuiSource
Layout
Horizontal groupping of the elements. All elements are placed in the stright horizontal line and aligned by Y-coordinate and height.
Vertical groupping of the elements. All elements are placed in the stright vertical line and aligned by X-coordinate and width.
sca :: Double -> Gui -> GuiSource
Scales an element within the group. It depends on the type of the alignment (horizontal or vertical) which side of the bounding box is scaled. If it's a horizontal group then the width is scaled and height is scaled otherwise.
Every element in the group has a scaling factor. By default it equals to one. During rendering all scaling factors are summed and divided on the sum of all factors. So that factors become weights or proportions. This process is called normalization. Scaling one element affects not only this element but all other elements in the group!
An example:
One element is twice as large as the other two:
hor [a, b, sca 2 c]
Why is it so? Let's look at the hidden scaling factors:
hor [sca 1 a, sca 1 b, sca 2 c]
During rendering we scale all the scaling fators so that total sum equals to one:
hor [sca 0.25 a, sca 0.25 b, sca 0.5 c]
horSca :: [(Double, Gui)] -> GuiSource
Weighted horizontal grouping. It takes a list of scaling factors and elements.
verSca :: [(Double, Gui)] -> GuiSource
Weighted vertical grouping. It takes a list of scaling factors and elements.
padding :: Int -> Gui -> GuiSource
Sets the padding of the element. How much empty space to reserve outside the element.
margin :: Int -> Gui -> GuiSource
Sets the margin of the element. How much empty space to reserve between the elements within the group. It affects only compound elements.
Props
forceProps :: [Prop] -> Gui -> GuiSource
Sets the properties for a GUI element on all levels.
Properties of the widgets.
data BorderType Source
The type of the material of the element. It affects sliders and buttons.
The orientation of the widget (slider, roller). This property is never needs to be set in practice. If this property is not set then default orientation is calculated from the bounding box of the widget. If the width is greater than the height then we need to use a horizontal widget otherwise it should be a vertical one.
Some values are not implemented on the Csound level.
Setters
Handy short-cuts for the function props
.
setBorder :: BorderType -> Gui -> GuiSource
setMaterial :: Material -> Gui -> GuiSource
setLabelType :: LabelType -> Gui -> GuiSource
setTextColor :: Color -> Gui -> GuiSource
setFontSize :: Int -> Gui -> GuiSource
setFontType :: FontType -> Gui -> GuiSource
setEmphasis :: Emphasis -> Gui -> GuiSource
Widgets
The diapason of the continuous value.
ValDiap | |
|
A value span is a diapason of the value and a type of the scale (can be linear or exponential).
linSpan :: Double -> Double -> ValSpanSource
Makes a linear ValSpan
with specified boundaries.
linSpan minVal maxVal
expSpan :: Double -> Double -> ValSpanSource
Makes an exponential ValSpan
with specified boundaries.
expSpan minVal maxVal
setKnobType :: KnobType -> Gui -> GuiSource
setSliderType :: SliderType -> Gui -> GuiSource
setTextType :: TextType -> Gui -> GuiSource
The type of the box. Some values are not implemented on the Csound level.
setBoxType :: BoxType -> Gui -> GuiSource
data ButtonType Source
The type of the button. It affects toggle buttons and button banks.
In Csound buttons and toggle buttons
are constructed with the same function (but with different button types).
But in this library they are contructed by different functions (button
and toggle
).
Normal button is a plain old button, but other values specify toggle buttons.
So this property doesn't affect the buttons (since they could be only normal buttons).
setButtonType :: ButtonType -> Gui -> GuiSource
Panels
Renders the GUI elements on the window. Rectangle is calculated automatically (window doesn't listens for keyboard events).
keyPanel :: Gui -> SE ()Source
Renders the GUI elements on the window. Rectangle is calculated automatically (window listens for keyboard events).
tabs :: [(String, Gui)] -> SE ()Source
Renders the GUI elements with tabs. Rectangles are calculated automatically.
keyTabs :: [(String, Gui)] -> SE ()Source
Renders the GUI elements with tabs. Rectangles are calculated automatically.
panelBy :: String -> Maybe Rect -> Gui -> SE ()Source
Renders the GUI elements on the window. We can specify the window title and rectangle of the window.
keyPanelBy :: String -> Maybe Rect -> Gui -> SE ()Source
Renders the GUI elements on the window. We can specify the window title and rectangle of the window. Panesls are sensitive to keyboard events.
tabsBy :: String -> Maybe Rect -> [(String, Maybe Rect, Gui)] -> SE ()Source
Renders the GUI elements with tabs. We can specify the window title and rectangles for all tabs and for the main window.
keyTabsBy :: String -> Maybe Rect -> [(String, Maybe Rect, Gui)] -> SE ()Source
Renders the GUI elements with tabs. We can specify the window title and rectangles for all tabs and for the main window. Tabs are sensitive to keyboard events.
Types
type Widget a b = SE (Gui, Output a, Input b, Inner)Source
A widget consists of visible element (Gui), value consumer (Output) and producer (Input) and an inner state (Inner).
Widgets
count :: ValDiap -> ValStep -> Maybe ValStep -> Double -> Source (Evt D)Source
Allows the user to increase/decrease a value with mouse clicks on a corresponding arrow button. Output is an event stream that contains values when counter changes.
count diapason fineValStep maybeCoarseValStep initValue
doc: http:www.csounds.commanualhtml/FLcount.html
countSig :: ValDiap -> ValStep -> Maybe ValStep -> Double -> Source SigSource
A variance on the function count
, but it produces
a signal of piecewise constant function.
joy :: ValSpan -> ValSpan -> (Double, Double) -> Source (Sig, Sig)Source
It is a squared area that allows the user to modify two output values at the same time. It acts like a joystick.
joy valueSpanX valueSpanY (initX, initY)
knob :: String -> ValSpan -> Double -> Source SigSource
A FLTK widget opcode that creates a knob.
knob valueSpan initValue
roller :: String -> ValSpan -> ValStep -> Double -> Source SigSource
FLroller is a sort of knob, but put transversally.
roller valueSpan step initVal
slider :: String -> ValSpan -> Double -> Source SigSource
FLslider puts a slider into the corresponding container.
slider valueSpan initVal
sliderBank :: String -> [Double] -> Source [Sig]Source
Constructs a list of linear unit sliders (ranges in [0, 1]). It takes a list of init values.
numeric :: String -> ValDiap -> ValStep -> Double -> Source SigSource
numeric (originally FLtext in the Csound) allows the user to modify a parameter value by directly typing it into a text field.
numeric diapason step initValue
meter :: String -> ValSpan -> Double -> Sink SigSource
A slider that serves as indicator. It consumes values instead of producing.
meter valueSpan initValue
box :: String -> DisplaySource
A FLTK widget that displays text inside of a box. If the text is longer than 255 characters the text is split on several parts (Csound limitations).
box text
butBank :: String -> Int -> Int -> (Int, Int) -> Source (Evt (D, D))Source
A FLTK widget opcode that creates a bank of buttons. Result is (x, y) coordinate of the triggered button.
butBank xNumOfButtons yNumOfButtons
butBankSig :: String -> Int -> Int -> (Int, Int) -> Source (Sig, Sig)Source
A variance on the function butBank
, but it produces
a signal of piecewise constant function.
Result is (x, y) coordinate of the triggered button.
butBank1 :: String -> Int -> Int -> (Int, Int) -> Source (Evt D)Source
A FLTK widget opcode that creates a bank of buttons.
butBank xNumOfButtons yNumOfButtons
toggle :: String -> Source (Evt D)Source
A FLTK widget opcode that creates a toggle button.
button text
toggleSig :: String -> Source SigSource
A variance on the function toggle
, but it produces
a signal of piecewise constant function.
value :: String -> Double -> Sink SigSource
FLvalue shows current the value of a valuator in a text field.
value initVal
Transformers
Keyboard
Keys.