DEFINITION SetGadgets; (* portable *)

 IMPORT Objects, Gadgets;

 TYPE
  Set = POINTER TO SetDesc;
  SetDesc = RECORD ( Gadgets.ObjDesc ) 
   val: SET
  END;

  Frame = POINTER TO FrameDesc;
  FrameDesc = RECORD ( Gadgets.FrameDesc ) 
   val: SET
  END;

(* Convert an integer into a set *)
 PROCEDURE IntToSet (int: LONGINT; VAR set: SET);

(* Convert a set into an integer *)
 PROCEDURE SetToInt (set: SET; VAR int: LONGINT);

(* Procedures used by Set *)
 PROCEDURE CopySet (VAR M: Objects.CopyMsg; from, to: Set);
 PROCEDURE SetHandler (obj: Objects.Object; VAR M: Objects.ObjMsg);
 PROCEDURE InitSet (obj: Set);
 PROCEDURE NewSet;

(* Procedures used by Frame *)
 PROCEDURE CopyFrame (VAR M: Objects.CopyMsg; from, to: Frame);
 PROCEDURE FrameHandle (F: Objects.Object; VAR M: Objects.ObjMsg);
 PROCEDURE InitFrame (F: Frame);
 PROCEDURE NewFrame;

END SetGadgets.

(*
Set
 Create with: Gadgets.Link SetGadgets.NewSet
 Alias: -
 Function: Stores a 32 bit set.
 Attributes:
  Value: Integer representation of the object's value.
  String: String representation of the object's value (Oberon language convension).
 Links: -

Frame
 Create with: Gadgets.Insert SetGadgets.NewFrame
 Alias: -
 Function: This frame visualises a 32 bit set. One bit can be included or excluded
by clicking
   on its placeholder (bit 0 start at the left hand side of the gadget). A bit
is said
   to be included when at its corresponding position a black bar is shown. Otherwise
   the bit is not included in the set.
 Attributes:
  Value: Integer representation of the object's value.
  String: String representation of the object's value (Oberon language convension).
 Links: -

Example
   

*)