with Widgets.Buttons; use Widgets.Buttons;
private with Widgets.Scrollbars;
package Widgets.Containers.Scroll_Panes is
type Scroll_Pane is new Container and Button_Listener with private;
type A_Scroll_Pane is access all Scroll_Pane'Class;
function Create_Scroll_Pane( view : not null access Game_Views.Game_View'Class;
id : String ) return A_Scroll_Pane;
pragma Precondition( id'Length > 0 );
pragma Postcondition( Create_Scroll_Pane'Result /= null );
procedure Draw_Hbar( this : access Scroll_Pane; draw : Boolean );
procedure Draw_Vbar( this : access Scroll_Pane; draw : Boolean );
procedure Set_Client( this : access Scroll_Pane;
client : in out A_Widget );
pragma Postcondition( client = null );
private
use Widgets.Scrollbars;
type Scroll_Pane is new Container and Button_Listener with
record
client : A_Widget := null;
hscroll : A_H_Scrollbar := null;
vscroll : A_V_Scrollbar := null;
left,
right,
up,
down : A_Button := null;
drawHbar,
drawVbar : Boolean := True;
end record;
procedure Adjust_Layout( this : access Scroll_Pane );
procedure Construct( this : access Scroll_Pane;
view : not null access Game_Views.Game_View'Class;
id : String );
pragma Precondition( id'Length > 0 );
procedure Draw_Content( this : access Scroll_Pane; dc : Drawing_Context );
function Get_Inc_X( this : access Scroll_Pane ) return Integer;
function Get_Inc_Y( this : access Scroll_Pane ) return Integer;
procedure Handle_Action( this : access Scroll_Pane;
action : A_Button_Action );
function Handle_Mouse_Scroll( this : access Scroll_Pane;
evt : not null A_Mouse_Scroll_Event ) return Boolean;
procedure Handle_Resize( this : access Scroll_Pane );
end Widgets.Containers.Scroll_Panes;