summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-windows.ads
blob: 3ea38c1c59772300c25f373f73a2938defce5665 (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162


with

    FLTK.Images.RGB;

private with

    Interfaces.C;


package FLTK.Widgets.Groups.Windows is


    type Window is new Group with private;

    type Border_State is (None, Visible);

    type Cursor is
           (Default, Arrow, Crosshair, Wait,
            Insert, Hand, Help, Move,
            NS, WE, NWSE, NESW,
            N, NE, E, SE, S, SW, W, NW,
            None);




    package Forge is

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

        function Create
               (W, H : in Integer)
            return Window;

    end Forge;




    procedure Show
           (This : in out Window);

    procedure Hide
           (This : in out Window);

    procedure Make_Current
           (This : in out Window);




    function Get_Border
           (This : in Window)
        return Border_State;

    procedure Set_Border
           (This : in out Window;
            To   : in     Border_State);

    procedure Set_Label
           (This : in out Window;
            Text : in     String);

    procedure Set_Size_Range
           (This                           : in out Window;
            Min_W, Min_H                   : in     Integer;
            Max_W, Max_H, Incre_W, Incre_H : in     Integer := 0;
            Keep_Aspect                    : in     Boolean := False);

    procedure Set_Icon
           (This : in out Window;
            Pic  : in out FLTK.Images.RGB.RGB_Image'Class);

    procedure Set_Modal
           (This : in out Window);

    procedure Set_Non_Modal
           (This : in out Window);

    procedure Set_Cursor
           (This : in out Window;
            To   : in     Cursor);

    procedure Set_Default_Cursor
           (This : in out Window;
            To   : in     Cursor);




    function Get_X_Root
           (This : in Window)
        return Integer;

    function Get_Y_Root
           (This : in Window)
        return Integer;

    function Get_Decorated_W
           (This : in Window)
        return Integer;

    function Get_Decorated_H
           (This : in Window)
        return Integer;




    procedure Draw
           (This : in out Window);

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


private


    type Window is new Group with null record;

    overriding procedure Finalize
           (This : in out Window);




    --  What delightful magic numbers FLTK cursors are!
    --  (These correspond to the enum found in Enumerations.H)
    Cursor_Values : array (Cursor) of Interfaces.C.int :=
           (Default   => 0,
            Arrow     => 35,
            Crosshair => 66,
            Wait      => 76,
            Insert    => 77,
            Hand      => 31,
            Help      => 47,
            Move      => 27,
            NS        => 78,
            WE        => 79,
            NWSE      => 80,
            NESW      => 81,
            N         => 70,
            NE        => 69,
            E         => 49,
            SE        => 8,
            S         => 9,
            SW        => 7,
            W         => 36,
            NW        => 68,
            None      => 255);


end FLTK.Widgets.Groups.Windows;