The ControlSet
structure provides facilities for managing sets
of controls, with associated information, by name.
Synopsis
signature CONTROL_SET
structure ControlSet : CONTROL_SET
Interface
type 'a control = 'a Controls.control
type ('a, 'b) control_set
val new : unit -> ('a, 'b) control_set
val member : (('a, 'b) control_set * Atom.atom) -> bool
val find : (('a, 'b) control_set * Atom.atom)
-> {ctl : 'a control, info : 'b} option
val insert : (('a, 'b) control_set * 'a control * 'b) -> unit
val remove : (('a, 'b) control_set * Atom.atom) -> unit
val infoOf : ('a, 'b) control_set -> 'a control -> 'b option
val listControls : ('a, 'b) control_set -> {ctl : 'a control, info : 'b} list
val listControls' : (('a, 'b) control_set * int) -> {ctl : 'a control, info : 'b} list
val app : ({ctl : 'a control, info : 'b} -> unit) -> ('a, 'b) control_set -> unit
val stringControls : 'a Controls.value_cvt -> ('a, 'b) control_set
-> (string, 'b) control_set
Description
type ('a, 'b) control_set
-
The abstract type of control set, where the first type parameter is the value-type of the controls in the set and the second is the type of the information associated with each control.
val new : unit -> ('a, 'b) control_set
-
new ()
creates a new, empty, set of controls. val member : (('a, 'b) control_set * Atom.atom) -> bool
-
member (ctlSet, name)
returns true if there is a control with the given name in the set. val find : (('a, 'b) control_set * Atom.atom) -> {ctl : 'a control, info : 'b} option
-
find (ctsSet, name)
returnsSOME{ctl, info}
when the controlctl
, which has the namename
is in the set andinfo
is its associated information. Otherwise,NONE
is returned. val insert : (('a, 'b) control_set * 'a control * 'b) -> unit
-
insert (ctsSet, ctl, info)
inserts the controlctl
with associated informationinto
into the control set. val remove : (('a, 'b) control_set * Atom.atom) -> unit
-
remove (ctlSet, name)
removes the named control from the set (if it is present). val infoOf : ('a, 'b) control_set -> 'a control -> 'b option
-
infoOf ctlSet ctl
returnsSOME info
, whenctl
is in the set with associated informationinfo
. Ifctl
is not in the set, thenNONE
is returned. val listControls : ('a, 'b) control_set -> {ctl : 'a control, info : 'b} list
-
listControls ctlSet
returns a list of the controls in the set ordered by priority. val listControls' : (('a, 'b) control_set * int) -> {ctl : 'a control, info : 'b} list
-
listControls (ctlSet, level)
returns a list of the controls in the set ordered by priority, but omits any controls with an obscurity level greater or equal tolevel
. val app : ({ctl : 'a control, info : 'b} -> unit) -> ('a, 'b) control_set -> unit
-
app f ctlSet
applies the functionf
to the controls (and their associated information). The order in whichf
is applied is unspecified. val stringControls : 'a Controls.value_cvt -> ('a, 'b) control_set -> (string, 'b) control_set
-
stringControls cvt ctlSet
returns a set of string controls, where the controls in the new set are created by applying the value-convertercvt
to the controls inctlSet
. The associated information is preserved.