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 - metrics - download
Index: B T

⟦91360fc28⟧ TextFile

    Length: 2904 (0xb58)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Window_Io;
with Bounded_String;
package body Box_Display is

    Graphics_Set : constant Window_Io.Font :=
       Window_Io.Font'(Window_Io.Graphics, Window_Io.Vanilla);

    function Make return Box is
        Return_Box : Box;
    begin
        Return_Box.Height := 0;
        Return_Box.Width := 0;
        Bounded_String.Copy (Return_Box.Label, "");
        return Return_Box;
    end Make;

    procedure Set_Size
                 (On_Box : in out Box; Height : Natural; Width : Natural) is
    begin
        On_Box.Height := Height;
        On_Box.Width := Width;
    end Set_Size;

    procedure Set_Label (On_Box : in out Box; Label : String) is
    begin
        Bounded_String.Copy (On_Box.Label, Label);
    end Set_Label;

    function Height (A_Box : Box) return Natural is
    begin
        return A_Box.Height;
    end Height;

    function Width (A_Box : Box) return Natural is
    begin
        return A_Box.Width;
    end Width;

    function Label (On_Box : Box) return String is
    begin
        return Bounded_String.Image (On_Box.Label);
    end Label;

    procedure Display (The_Box : Box;
                       In_Window : Window_Io.File_Type;
                       At_Line : Window_Io.Line_Number;
                       At_Column : Window_Io.Column_Number) is
    begin
        Window_Io.Position_Cursor (In_Window, At_Line, At_Column);
        Window_Io.Overwrite (In_Window, "l", Graphics_Set);

        for I in 1 .. The_Box.Width loop
            Window_Io.Overwrite (In_Window, "q", Graphics_Set);
        end loop;

        Window_Io.Overwrite (In_Window, "k", Graphics_Set);

        Window_Io.Position_Cursor (In_Window, At_Line + 1, At_Column);

        for I in 1 .. The_Box.Height loop
            Window_Io.Overwrite (In_Window, "x", Graphics_Set);
            Window_Io.Move_Cursor (In_Window, 1, -1);
        end loop;

        Window_Io.Position_Cursor (In_Window, At_Line + 1,
                                   At_Column + The_Box.Width + 1);

        for I in 1 .. The_Box.Height loop
            Window_Io.Overwrite (In_Window, "x", Graphics_Set);
            Window_Io.Move_Cursor (In_Window, 1, -1);
        end loop;

        Window_Io.Position_Cursor
           (In_Window, At_Line + The_Box.Height + 1, At_Column);
        Window_Io.Overwrite (In_Window, "m", Graphics_Set);

        for I in 1 .. The_Box.Width loop
            Window_Io.Overwrite (In_Window, "q", Graphics_Set);
        end loop;

        Window_Io.Overwrite (In_Window, "j", Graphics_Set);

        Window_Io.Position_Cursor (In_Window, At_Line + 1, At_Column + 1);
        Window_Io.Overwrite
           (In_Window, Bounded_String.Image (The_Box.Label), Window_Io.Normal);

        for I in 1 .. The_Box.Width - Bounded_String.Length (The_Box.Label) loop
            Window_Io.Overwrite (In_Window, ' ', Window_Io.Normal);
        end loop;
    end Display;
end Box_Display;