summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-scrolls.ads
blob: 9f5cdd2a7c356c7b0aea1d50555e1b17c1cd88e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146


--  Programmed by Jedidiah Barber
--  Released into the public domain


with

    FLTK.Widgets.Valuators.Sliders.Scrollbars;


package FLTK.Widgets.Groups.Scrolls is


    type Scroll is new Group with private;

    type Scroll_Reference (Data : not null access Scroll'Class) is limited null record
        with Implicit_Dereference => Data;

    type Scroll_Kind is
           (Horizontal,
            Vertical,
            Both,
            Always_On,
            Horizontal_Always,
            Vertical_Always,
            Both_Always);




    package Forge is

        function Create
               (X, Y, W, H : in Integer;
                Text       : in String := "")
            return Scroll;

        function Create
               (Parent     : in out Group'Class;
                X, Y, W, H : in     Integer;
                Text       : in     String := "")
            return Scroll;

    end Forge;




    function H_Bar
           (This : in out Scroll)
        return Valuators.Sliders.Scrollbars.Scrollbar_Reference;

    function V_Bar
           (This : in out Scroll)
        return Valuators.Sliders.Scrollbars.Scrollbar_Reference;




    procedure Clear
           (This : in out Scroll);




    procedure Scroll_To
           (This : in out Scroll;
            X, Y : in     Integer);

    procedure Set_Type
           (This : in out Scroll;
            Mode : in     Scroll_Kind);




    function Get_Scrollbar_Size
           (This : in Scroll)
        return Integer;

    procedure Set_Scrollbar_Size
           (This : in out Scroll;
            To   : in     Integer);

    --  These two functions are far too similar in name and
    --  function to the Get_X and Get_Y for Widgets.
    function Get_Scroll_X
           (This : in Scroll)
        return Integer;

    function Get_Scroll_Y
           (This : in Scroll)
        return Integer;




    procedure Draw
           (This : in out Scroll);

    function Handle
           (This  : in out Scroll;
            Event : in     Event_Kind)
        return Event_Outcome;


private


    type Scroll is new Group with record
        Horizon, Vertigo : aliased Valuators.Sliders.Scrollbars.Scrollbar;
    end record;

    overriding procedure Initialize
           (This : in out Scroll);

    overriding procedure Finalize
           (This : in out Scroll);

    procedure Extra_Init
           (This       : in out Scroll;
            X, Y, W, H : in     Integer;
            Text       : in     String);

    procedure Extra_Final
           (This : in out Scroll);


    pragma Inline (Clear);

    pragma Inline (Scroll_To);
    pragma Inline (Set_Type);

    pragma Inline (Get_Scrollbar_Size);
    pragma Inline (Set_Scrollbar_Size);
    pragma Inline (Get_Scroll_X);
    pragma Inline (Get_Scroll_Y);

    pragma Inline (Draw);
    pragma Inline (Handle);


end FLTK.Widgets.Groups.Scrolls;