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

⟦808345f28⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Requester, seg_038731

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



with Bounded_String;

package body Requester is
    procedure Clear is
        use Object;
        Blanck : String (1 .. 80) := (1 .. 80 => ' ');
    begin
        for I in 1 .. 10 loop
            Easy_Y.Set_Display (Window => Requester_Window);
            Easy_Y.Print (0, Object.Index (I * 10),
                          Bounded_String.Value (Blanck, 80));
        end loop;
    end Clear;


    procedure Rectangle (X, Y : Object.Index; Title : Object.Tiny_String) is
        use Object;  
        Long : Object.Index :=
           30 + 8 * Object.Index (Bounded_String.Length (Title));
    begin
        Easy_Y.Set_Display (Window => Requester_Window);
        Easy_Y.Put_Font (To => Easy_Y.Small_Font);
        Easy_Y.Put_Size (Window => Requester_Window, Size => 1);

        Easy_Y.Line (X, Y, X + Long, Y);
        Easy_Y.Line (X + Long, Y, X + Long, Y + 40);
        Easy_Y.Line (X + Long, Y + 40, X, Y + 40);
        Easy_Y.Line (X, Y + 40, X, Y);

        Easy_Y.Line (X + 5, Y + 5, X + Long - 5, Y + 5);
        Easy_Y.Line (X + Long - 5, Y + 5, X + Long - 5, Y + 35);
        Easy_Y.Line (X + Long - 5, Y + 35, X + 5, Y + 35);
        Easy_Y.Line (X + 5, Y + 35, X + 5, Y + 5);

        Easy_Y.Print (X1 => X + 15, Y1 => Y + 25, The_String => Title);
    end Rectangle;


    procedure Push (X, Y : Object.Index; Title : Object.Tiny_String) is
        use Object;
        Long : Object.Index :=
           30 + 8 * Object.Index (Bounded_String.Length (Title));
    begin
        Easy_Y.Set_Display (Window => Requester_Window);
        Easy_Y.Put_Font (To => Easy_Y.Small_Font);
        Easy_Y.Put_Size (Window => Requester_Window, Size => 1);

        Easy_Y.Line (X, Y + 1, X + Long, Y + 1);
        Easy_Y.Line (X + Long - 1, Y, X + Long - 1, Y + 40);
        Easy_Y.Line (X + Long, Y + 39, X, Y + 39);
        Easy_Y.Line (X + 1, Y + 40, X + 1, Y);

        Easy_Y.Line (X + 5, Y + 5, X, Y);
        Easy_Y.Line (X + Long - 5, Y + 5, X + Long, Y);
        Easy_Y.Line (X + Long - 5, Y + 35, X + Long, Y + 40);
        Easy_Y.Line (X + 5, Y + 35, X, Y + 40);

        Easy_Y.Print (X1 => X + 16, Y1 => Y + 26, The_String => Title);
        delay (1.0);
    end Push;


    function In_Area (X, Y : Object.Index; Title : Object.Tiny_String)
                     return Boolean is
        use Object;
        Long : Object.Index :=
           30 + 8 * Object.Index (Bounded_String.Length (Title));
    begin
        if X <= Easy_Y.Get_X_Mouse and then
           Easy_Y.Get_X_Mouse <= X + Long and then
           Y <= Easy_Y.Get_Y_Mouse and then
           Easy_Y.Get_Y_Mouse <= Y + 40 then
            return True;
        else
            return False;
        end if;
    end In_Area;


    function Choice (The_Message : Message.Unary) return Object.Index is  
        use Object;
        Mess : Message.Unary := The_Message;
        Position : Object.Index;
    begin  
        Easy_Y.Set_Display (Window => Requester_Window);

        Message.Init (Mess);
        Position := Dx / 2;
        Clear;
        for I in 1 .. Number_Button loop
            Rectangle (X => 10 + Position,
                       Y => 35,
                       Title => Message.Get (Name_From => Mess));
            Position := Position + Dx + 50 +
                           8 * Object.Index
                                  (Bounded_String.Length
                                      (Message.Get (Name_From => Mess)));
            Message.Next (Mess);
        end loop;

        loop
            case Easy_Y.Next_Event is
                when Easy_Y.Update =>  
                    Message.Init (Mess);
                    Position := Dx / 2;
                    Clear;
                    for I in 1 .. Number_Button loop
                        Rectangle (X => 10 + Position,
                                   Y => 35,
                                   Title => Message.Get (Name_From => Mess));
                        Position := Position + Dx + 50 +
                                       8 * Object.Index
                                              (Bounded_String.Length
                                                  (Message.Get
                                                      (Name_From => Mess)));
                        Message.Next (Mess);
                    end loop;

                when Easy_Y.Button_Down =>
                    Message.Init (Mess);
                    Position := Dx / 2;
                    for I in 1 .. Number_Button loop
                        if In_Area
                              (X => 10 + Position,
                               Y => 35,
                               Title => Message.Get (Name_From => Mess)) then
                            Push (X => 10 + Position,
                                  Y => 35,
                                  Title => Message.Get (Name_From => Mess));
                            return I;
                        end if;
                        Position := Position + Dx + 50 +
                                       8 * Object.Index
                                              (Bounded_String.Length
                                                  (Message.Get
                                                      (Name_From => Mess)));
                        Message.Next (Mess);
                    end loop;
                when Easy_Y.Button_Up =>
                    null;
                when others =>
                    null;
            end case;
        end loop;
    end Choice;


    procedure Open (X, Y : Object.Index;
                    Screen : String;
                    The_Message : Message.Unary;
                    Str : Object.Tiny_String) is
        use Object;
        Long : Object.Index := 0;
        Mess : Message.Unary := The_Message;
    begin
        Easy_Y.Put_Title (Window => Requester_Window, Title => Str);
        Easy_Y.Put_Left (Window => Requester_Window, Left => X);
        Easy_Y.Put_Right (Window => Requester_Window, Right => Y);

        Message.Init (Mess);
        Number_Button := 0;
        while not Message.Is_Done (Mess) loop
            Long := Long + 50 +
                       8 * Object.Index (Bounded_String.Length
                                            (Message.Get (Name_From => Mess)));
            Number_Button := Number_Button + 1;
            Message.Next (Mess);
        end loop;
        if Number_Button /= 0 and then
           Long < 100 + 10 * Object.Index (Bounded_String.Length (Str)) then
            declare
                use Object;
                Long_Old : Object.Index := Long;
            begin
                Long := 100 + 10 * Object.Index (Bounded_String.Length (Str));
                Dx := (Long - Long_Old) / Number_Button;
            end;
        else
            Dx := 0;
        end if;

        Easy_Y.Put_Width (Window => Requester_Window, Width => Long);
        Easy_Y.Put_Height (Window => Requester_Window, Height => 100);
        Easy_Y.Open (Display => Screen, Window => Requester_Window);
        Easy_Y.Put_Font (To => Easy_Y.Small_Font);
        Easy_Y.Put_Size (Window => Requester_Window, Size => 1);

        Easy_Y.Update;
    end Open;


    procedure Close is
    begin
        Easy_Y.Close (Window => Requester_Window);
    end Close;

end Requester;


E3 Meta Data

    nblk1=a
    nid=6
    hdr6=12
        [0x00] rec0=1d rec1=00 rec2=01 rec3=04c
        [0x01] rec0=1a rec1=00 rec2=04 rec3=020
        [0x02] rec0=1e rec1=00 rec2=0a rec3=008
        [0x03] rec0=1a rec1=00 rec2=05 rec3=02c
        [0x04] rec0=09 rec1=00 rec2=09 rec3=03e
        [0x05] rec0=13 rec1=00 rec2=03 rec3=024
        [0x06] rec0=1c rec1=00 rec2=07 rec3=004
        [0x07] rec0=1c rec1=00 rec2=08 rec3=03c
        [0x08] rec0=05 rec1=00 rec2=02 rec3=000
        [0x09] rec0=04 rec1=00 rec2=02 rec3=000
    tail 0x2173624b884e7696f4d90 0x42a00088462060003
Free Block Chain:
  0x6: 0000  00 00 01 b9 80 04 65 72 29 3b 04 00 1c 20 20 20  ┆      er);      ┆