module support_check

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

import StdEnv, StdIO

Start :: *World -> *World
Start world
# (controlid, world) = openId world 
# checks = [
        CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlHide],
        CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlId controlid],
        CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlSelectState Able],
        CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlSelectState Unable],
        CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlTip "Some tip"]
    ]
# controls = ListLS checks
# dialog = Dialog "Support - CheckControl" 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