|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 5120 (0x1400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Repaint_Number_Tiles, seg_00539c, separate Puz_Main
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
separate (Puz_Main) procedure Repaint_Number_Tiles is Counter : S_Natural; Width : S_Long; Height : S_Long; X_Offset : S_Long; Y_Offset : S_Long; ----cut the Tile_Window into a grid of nxn pieces by inscribing -- each rectangle with a black border; -- I don't want to use subwindows for each tile so that I can -- slide groups of tiles together as a single unit, rather than -- being forced to move one tile at a time. procedure Line (X1, Y1, X2, Y2 : S_Long) is begin X_Draw_Line (Dpy, Tile_Window.Drawable, Gc, S_Short (X1), S_Short (Y1), S_Short (X2), S_Short (Y2)); end Line; procedure Rect (X, Y : S_Long) is begin Line (Ulx (X, Y), Uly (X, Y), Urx (X, Y), Ury (X, Y)); Line (Urx (X, Y), Ury (X, Y), Lrx (X, Y), Lry (X, Y)); Line (Lrx (X, Y), Lry (X, Y), Llx (X, Y), Lly (X, Y)); Line (Llx (X, Y), Lly (X, Y), Ulx (X, Y), Uly (X, Y)); end Rect; begin Height := S_Long (Tile_Font_Info.Ascent + Tile_Font_Info.Descent); Y_Offset := S_Long ((Tile_Height - Height) / 2 + S_Long (Tile_Font_Info.Ascent)); X_Set_Font (Dpy, Gc, Tile_Font_Info.Font_Id); Counter := 0; for I in 0 .. Puzzle_Height - 1 loop for J in 0 .. Puzzle_Width - 1 loop declare Im : constant String := S_Natural'Image (Position (Counter)); begin if Position (Counter) = 0 then Rect_Set (Tile_Window, Ulx (J, I), Uly (J, I), Tile_Width, Tile_Height, Fg_Pixel); else Rect_Set (Tile_Window, Ulx (J, I), Uly (J, I), Tile_Width, Tile_Height, Bg_Pixel); Rect (J, I); Width := S_Long (X_Text_Width (Tile_Font_Info, To_X_String (Im (Im'First + 1 .. Im'Last)))); X_Offset := (Tile_Width - Width) / 2; X_Draw_String (Dpy, Tile_Window.Drawable, Gc, S_Short (Ulx (J, I) + X_Offset), S_Short (Uly (J, I) + Y_Offset), To_X_String (Im (Im'First + 1 .. Im'Last))); end if; end; Counter := Counter + 1; end loop; end loop; end Repaint_Number_Tiles;
nblk1=4 nid=0 hdr6=8 [0x00] rec0=1b rec1=00 rec2=01 rec3=056 [0x01] rec0=00 rec1=00 rec2=04 rec3=00c [0x02] rec0=1a rec1=00 rec2=02 rec3=04e [0x03] rec0=0f rec1=00 rec2=03 rec3=000 tail 0x217008948819789559ef8 0x42a00088462063203