with Scrollables; use Scrollables;
package Widgets.Palettes is
type Palette is abstract new Widget and Scrollable with private;
type A_Palette is access all Palette'Class;
function Get_Item_Count( this : access Palette ) return Natural is abstract;
procedure Get_Item_Details( this : access Palette;
row,
col : Natural;
bmp : out A_Bitmap;
border : out Color_Type ) is abstract;
procedure Set_Columns( this : access Palette; columns : Natural );
procedure Set_Icon_Size( this : access Palette; width, height : Positive );
private
type Palette is abstract new Widget and Scrollable with
record
columns : Natural := 1;
iconHeight,
iconWidth : Positive := 16;
highlightRow,
highlightCol : Integer := 0;
selectedItem : Integer := 0;
end record;
procedure Construct( this : access Palette;
view : not null access Game_Views.Game_View'Class;
id : String );
pragma Precondition( id'Length > 0 );
procedure Draw_Content( this : access Palette; dc : Drawing_Context );
function Get_Min_Height( this : access Palette ) return Natural;
function Get_Min_Width( this : access Palette ) return Natural;
function Get_Scroll_Inc_X( this : access Palette ) return Integer;
function Get_Scroll_Inc_Y( this : access Palette ) return Integer;
procedure Get_Selected( this : not null access Palette'Class;
row,
col : out Natural );
procedure Handle_Exit( this : access Palette );
procedure Handle_Mouse_Move( this : access Palette;
evt : not null A_Mouse_Event );
end Widgets.Palettes;