DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦0e92bbf5e⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Form, seg_0046ec

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



--| @SUMMARY This package provides an abstraction to define, display, and
--| parse forms.  Thr form can be displayed in a window_io window with users
--| responses returned in an iterator.
--| @INDICES (Window_Io)
with Fonts;
with Window_Io;
with Unbounded_String;
package Form is

    subtype Window_Type is Window_Io.File_Type;

    type Form_Definition is private;

    function Make return Form_Definition;

    --| @DESCRIPTION Returns an unaliased copy of a form definition.
    function Copy (Form : Form_Definition) return Form_Definition;

    subtype Item_Name is String;

    --| @DESCRIPTION Adds an new item to a form definition with the
    --| specified prompt.  Note that the prompts font and kind can be
    --| specified.
    --|
    procedure Add (Item        : Item_Name;
                   Prompt      : String;
                   Prompt_Font : Window_Io.Font := Fonts.Inverse_Bold;
                   Prompt_Kind : Window_Io.Designation := Window_Io.Prompt;
                   To_Form     : in out Form_Definition);

    --| @DESCRIPTION Replaces the prompt specification for a named item
    --| This is useful when configuring a form for re-display after and
    --| error has been found in the response.
    --|
    --| @PARAMETERS New_Prompt If the New_Prompt is defaulted to "",
    --| the old prompt is unchanged.
    --| @RAISES (Item_Not_Found)
    procedure Modify_Prompt
                 (For_Item    : Item_Name;
                  New_Prompt  : String := "";
                  Prompt_Font : Window_Io.Font := Fonts.Inverse_Bold;
                  Prompt_Kind : Window_Io.Designation := Window_Io.Prompt;
                  In_Form     : in out Form_Definition);

    type Modification_Iterator is private;

    --| @DESCRIPTION Erases the an open Form_Output window and displays the
    --| form. If Wait_For_Editing is True, an iterator of user responses is
    --| returned. If "Wait_For_Editing" is False, the form is displayed
    --| only and a done iterator is returned.
    --|
    --| @PARAMETERS Blank_Lines allows the client to specify the number
    --| of blank lines between form entries
    procedure Create (Form_Output           :     Window_Io.File_Type;
                      Form_Input            :     Window_Io.File_Type;
                      Definition            :     Form_Definition;
                      The_Form              : out Modification_Iterator;
                      Blank_Lines           :     Natural := 0;
                      Wait_For_User_Editing :     Boolean := False);

    --| @DESCRIPTION Coverts the response to a form_definition for re-display
    --| after errors are found
    function Convert (Mods_Iter : Modification_Iterator) return Form_Definition;

    type Modification_Information is private;

    procedure Next  (Iter : in out Modification_Iterator);
    function  Done  (Iter : Modification_Iterator) return Boolean;
    function  Value (Iter : Modification_Iterator)
                   return Modification_Information;

    --| @DESCRIPTION Returns the string image of the current form item
    function Item_Image (Mod_Info : Modification_Information) return String;

    --| @DESCRIPTION Returns the text typed by the user for the corresponding
    --| item.
    function Response (Mod_Info : Modification_Information) return String;

    --| @DESCRIPTION Returns true if no reponse was offered by the user.
    function Empty (Mod_Info : Modification_Information) return Boolean;

    --| @DESCRIPTION Indicates that the form as edited by the user could
    --| not be parsed.
    Unable_To_Parse_Response : exception;

    --| @DESCRIPTION Indicates that the item is not included in the
    --| current Form_Definition
    Item_Not_Found : exception;

private

    Item_Size : constant := 80;

    package Unbounded is new Unbounded_String (Item_Size);

    subtype Item_String is Unbounded.Variable_String;

    type Form_Item;

    type Form_Definition is access Form_Item;

    type Form_Item is
        record
            Name        : Item_String;
            Prompt      : Item_String;
            Prompt_Font : Window_Io.Font;
            Prompt_Kind : Window_Io.Designation;
            Next_Item   : Form_Definition;
        end record;

    type Modification_Information is new Form_Item;

    type Modification_Iterator is new Form_Definition;

end Form;

E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=1d rec1=00 rec2=01 rec3=06e
        [0x01] rec0=15 rec1=00 rec2=02 rec3=054
        [0x02] rec0=13 rec1=00 rec2=03 rec3=084
        [0x03] rec0=1c rec1=00 rec2=04 rec3=02a
        [0x04] rec0=14 rec1=00 rec2=05 rec3=000
    tail 0x217002a5c815c675a8b25 0x42a00088462061e03