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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
-- Programmed by Jedidiah Barber
-- Released into the public domain
with
FLTK.Widgets.Boxes,
FLTK.Widgets.Groups.Color_Choosers;
private with
Ada.Finalization,
Interfaces.C.Strings;
package FLTK.Asks is
type Beep_Kind is
(Default_Beep, Message_Beep, Error_Beep,
Question_Beep, Password_Beep, Notification_Beep);
type Confirm_Result is (Cancel, Confirm);
type Choice_Result is (First, Second, Third);
type Extended_Choice_Result is (First, Second, Third, Blocked, Closed, Escaped);
type RGB_Float is new Long_Float range 0.0 .. 1.0;
type RGB_Int is mod 256;
type File_Chooser_Callback is access procedure
(Item : in String);
function Get_Cancel_String
return String;
procedure Set_Cancel_String
(Value : in String);
function Get_Close_String
return String;
procedure Set_Close_String
(Value : in String);
function Get_No_String
return String;
procedure Set_No_String
(Value : in String);
function Get_OK_String
return String;
procedure Set_OK_String
(Value : in String);
function Get_Yes_String
return String;
procedure Set_Yes_String
(Value : in String);
procedure Alert
(Message : String);
procedure Beep
(Kind : in Beep_Kind := Default_Beep);
function Choice
(Message, Button1 : in String)
return Choice_Result;
function Choice
(Message, Button1, Button2 : in String)
return Choice_Result;
function Choice
(Message, Button1, Button2, Button3 : in String)
return Choice_Result;
function Extended_Choice
(Message, Button1 : in String)
return Extended_Choice_Result;
function Extended_Choice
(Message, Button1, Button2 : in String)
return Extended_Choice_Result;
function Extended_Choice
(Message, Button1, Button2, Button3 : in String)
return Extended_Choice_Result;
function Text_Input
(Message : in String;
Default : in String := "")
return String;
procedure Message_Box
(Message : in String);
function Password
(Message : in String;
Default : in String := "")
return String;
function Color_Chooser
(Title : in String;
R, G, B : in out RGB_Float;
Mode : in FLTK.Widgets.Groups.Color_Choosers.Color_Mode :=
FLTK.Widgets.Groups.Color_Choosers.RGB)
return Confirm_Result;
function Color_Chooser
(Title : in String;
R, G, B : in out RGB_Int;
Mode : in FLTK.Widgets.Groups.Color_Choosers.Color_Mode :=
FLTK.Widgets.Groups.Color_Choosers.RGB)
return Confirm_Result;
function Dir_Chooser
(Message, Default : in String;
Relative : in Boolean := False)
return String;
function File_Chooser
(Message, Filter_Pattern, Default : in String;
Relative : in Boolean := False)
return String;
procedure Set_File_Chooser_Callback
(Func : in File_Chooser_Callback);
procedure Set_File_Chooser_OK_String
(Value : in String);
function Get_Message_Hotspot
return Boolean;
procedure Set_Message_Hotspot
(To : in Boolean);
procedure Set_Message_Font
(Font : in Font_Kind;
Size : in Font_Size);
function Get_Message_Icon
return FLTK.Widgets.Boxes.Box_Reference;
procedure Set_Message_Title
(To : in String);
procedure Set_Message_Title_Default
(To : in String);
private
Icon_Box : aliased FLTK.Widgets.Boxes.Box;
Cancel_Str, Close_Str, No_Str, OK_Str, Yes_Str : Interfaces.C.Strings.chars_ptr;
Chooser_OK_Str : Interfaces.C.Strings.chars_ptr;
Chooser_Func : File_Chooser_Callback;
pragma Inline (Get_Cancel_String);
pragma Inline (Get_Close_String);
pragma Inline (Get_No_String);
pragma Inline (Get_OK_String);
pragma Inline (Get_Yes_String);
pragma Inline (Alert);
pragma Inline (Beep);
pragma Inline (Text_Input);
pragma Inline (Message_Box);
pragma Inline (Password);
pragma Inline (Color_Chooser);
pragma Inline (Dir_Chooser);
pragma Inline (File_Chooser);
pragma Inline (Set_File_Chooser_Callback);
pragma Inline (Get_Message_Hotspot);
pragma Inline (Set_Message_Hotspot);
pragma Inline (Set_Message_Font);
pragma Inline (Get_Message_Icon);
pragma Inline (Set_Message_Title);
pragma Inline (Set_Message_Title_Default);
-- Needed to ensure chars_ptr storage is properly cleaned up
type Dialog_String_Final_Controller is new Ada.Finalization.Controlled with null record;
overriding procedure Finalize
(This : in out Dialog_String_Final_Controller);
Cleanup : Dialog_String_Final_Controller;
end FLTK.Asks;
|