summaryrefslogtreecommitdiff
path: root/objectio/support_radio.icl
blob: dd60858560d2530b1e25fe72a958c1bfb37a16af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module support_radio

// ********************************************************************************
// Clean tutorial example program.
//
// This program can be used to test the different ControlAttributes for a 
// RadioControl in a Dialog.
// ********************************************************************************

import StdEnv, StdIO

Start :: *World -> *World
Start world
# (controlid, world) = openId world 
# radios = [
        RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 1 [ControlPos (Left, zero), ControlHide],
        RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 2 [ControlPos (Left, zero), ControlId controlid],
        RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 3 [ControlPos (Left, zero), ControlSelectState Able],
        RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 4 [ControlPos (RightTo controlid, zero), ControlSelectState Unable],
        RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 5 [ControlPos (Left, zero), ControlTip "Some tip"]
    ]
# controls = ListLS radios
# dialog = Dialog "Support - RadioControl" controls [WindowClose (noLS closeProcess)]
= startIO NDI Void (initialise dialog) [] world
where
    initialise dialog pst
    # (error,pst)       = openDialog 0 dialog pst
    | error <> NoError  = closeProcess pst
    | otherwise         = pst