with FLTK.Widgets, Squares; private with Ada.Containers.Vectors; package Grids is type Grid is new FLTK.Widgets.Widget with private; -- Don't use this. function Create (X, Y, W, H : in Integer; Text : in String) return Grid; -- Use this instead. function Create (X, Y : in Integer) return Grid; -- Meant for Displays to adjust the Grid. procedure Set_Cols (This : in out Grid; To : in Natural); -- Meant for Displays to adjust the Grid. procedure Set_Rows (This : in out Grid; To : in Natural); function In_Bounds (This : in Grid; X, Y : in Integer) return Boolean; function Get_Square (This : in Grid; X, Y : in Integer) return Squares.Square; procedure Set_Square (This : in out Grid; X, Y : in Integer; Item : in Squares.Square) with Pre => This.In_Bounds (X, Y); procedure Pixel_To_Colrow (This : in Grid; X, Y : in Integer; C, R : out Integer); procedure Colrow_To_Pixel (This : in Grid; C, R : in Integer; X, Y : out Integer); procedure Draw (This : in out Grid); private Empty_Square : aliased Squares.Square := Squares.Void; Step : constant Natural := 40; package Square_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Squares.Square, "=" => Squares."="); package Square_Vector_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Square_Vectors.Vector, "=" => Square_Vectors."="); type Grid is new FLTK.Widgets.Widget with record Cells : Square_Vector_Vectors.Vector; Rows, Cols : Integer; end record; end Grids;