Object Tiler | Oberon
PROCEDURE (t: Tile) Draw*; VAR r: Rectangle; BEGIN r := t.frame; Objects.DrawObj(t.obj, r.x, r.y, r.w, r.h); END Draw; PROCEDURE LayoutGrid*(tiles: Tiles.List); VAR i, cols, rows, cw, ch: INTEGER; BEGIN cols := ENTIER(SQRT(Len(tiles))); rows := (Len(tiles) + cols - 1) DIV cols; cw := Display.Width DIV cols; ch := Display.Height DIV rows; FOR i := 0 TO Len(tiles)-1 DO tiles[i].frame := Rect( (i MOD cols)*cw, (i DIV cols)*ch, cw, ch ); END END LayoutGrid;
[1] Wirth, N., & Gutknecht, J. (1992). Project Oberon – The Design of an Operating System and Compiler . Addison‑Wesley. oberon object tiler
[2] Reali, P. (2003). Using Oberon’s object model for graphical user interfaces . ETH Zurich Technical Report 432. PROCEDURE (t: Tile) Draw*; VAR r: Rectangle; BEGIN r := t
