DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦6973cded3⟧ TextFile

    Length: 3911 (0xf47)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Bounded_String;
with Easy_Y;

package body Tiny_End is
    procedure Rectangle (X, Y : Object.Index; Title : Object.Tiny_String) is
        use Object;
    begin
        Easy_Y.Line (X, Y, X + 110, Y);
        Easy_Y.Line (X + 110, Y, X + 110, Y + 40);
        Easy_Y.Line (X + 110, Y + 40, X, Y + 40);
        Easy_Y.Line (X, Y + 40, X, Y);

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

        Easy_Y.Print (X1 => X + Object.Index
                                   (55 - 4 * Bounded_String.Length (Title)),
                      Y1 => Y + 25,
                      The_String => Title);
    end Rectangle;


    procedure Push (X, Y : Object.Index; Title : Object.Tiny_String) is
        use Object;
    begin
        Easy_Y.Line (X, Y + 1, X + 110, Y + 1);
        Easy_Y.Line (X + 109, Y, X + 109, Y + 40);
        Easy_Y.Line (X + 110, 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 + 105, Y + 5, X + 110, Y);
        Easy_Y.Line (X + 105, Y + 35, X + 110, Y + 40);
        Easy_Y.Line (X + 5, Y + 35, X, Y + 40);

        Easy_Y.Print (X1 => X + Object.Index
                                   (56 - 4 * Bounded_String.Length (Title)),
                      Y1 => Y + 26,
                      The_String => Title);
        delay (1.0);
    end Push;


    function In_Area (X, Y : Object.Index) return Boolean is
        use Object;
    begin
        if X <= Easy_Y.Get_X_Mouse and then
           Easy_Y.Get_X_Mouse <= X + 110 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 (X, Y : Object.Index; Screen : String) return E_Choice is
        Essai : Easy_Y.Window_Type;
        Str : Object.Tiny_String;
    begin
        Bounded_String.Copy (Str, "Fin du programme Tiny_Talk");
        Easy_Y.Put_Title (Window => Essai, Title => Str);
        Easy_Y.Put_Left (Window => Essai, Left => X);
        Easy_Y.Put_Right (Window => Essai, Right => Y);
        Easy_Y.Put_Width (Window => Essai, Width => 500);
        Easy_Y.Put_Height (Window => Essai, Height => 100);
        Easy_Y.Open (Display => Screen, Window => Essai);
        Easy_Y.Put_Font (To => Easy_Y.Medium_Font);

        loop
            case Easy_Y.Next_Event is
                when Easy_Y.Update =>
                    Bounded_String.Copy (Str, "Fin");
                    Rectangle (X => 30, Y => 35, Title => Str);

                    Bounded_String.Copy (Str, "Unparse");
                    Rectangle (X => 195, Y => 35, Title => Str);

                    Bounded_String.Copy (Str, "Recommencer");
                    Rectangle (X => 360, Y => 35, Title => Str);

                when Easy_Y.Button_Down =>
                    if In_Area (50, 35) then
                        Bounded_String.Copy (Str, "Fin");
                        Push (X => 30, Y => 35, Title => Str);
                        return E_Choice (Fin);
                    elsif In_Area (200, 35) then
                        Bounded_String.Copy (Str, "Unparse");
                        Push (X => 195, Y => 35, Title => Str);
                        return E_Choice (Unparse);
                    elsif In_Area (350, 35) then
                        Bounded_String.Copy (Str, "Recommencer");
                        Push (X => 360, Y => 35, Title => Str);
                        return E_Choice (Recommencer);
                    end if;

                when Easy_Y.Button_Up =>
                    null;
                when others =>
                    null;
            end case;
        end loop;
    end Choice;
end Tiny_End;