blob: ed5a4a5553df93a745425c0165891a46849dc549 (
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
163
164
165
166
167
|
-- Programmed by Jedidiah Barber
-- Released into the public domain
with
FLTK.Filenames;
package FLTK.Widgets.Groups.Browsers.Textline.File is
-- Due to the inherited methods being made private in C++, overriding
--
-- Item_Width
-- Item_Height
-- Item_Draw
-- Full_List_Height
-- Average_Item_Height
--
-- will have no effect on the behaviour of this widget in FLTK.
--
-- This may change in versions beyond 1.3.
type File_Browser is new Textline_Browser with private;
type File_Browser_Reference (Data : not null access File_Browser'Class) is
limited null record with Implicit_Dereference => Data;
type File_Kind is (Files, Directories);
type Icon_Size is mod 256;
package Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String := "")
return File_Browser;
end Forge;
function Load
(This : in out File_Browser;
Dir : in String;
Sort : in not null FLTK.Filenames.Compare_Function :=
FLTK.Filenames.Numeric_Sort'Access)
return Natural;
procedure Load
(This : in out File_Browser;
Dir : in String;
Sort : in not null FLTK.Filenames.Compare_Function :=
FLTK.Filenames.Numeric_Sort'Access);
function Get_File_Kind
(This : in File_Browser)
return File_Kind;
procedure Set_File_Kind
(This : in out File_Browser;
Value : in File_Kind);
function Get_Filter
(This : in File_Browser)
return String;
procedure Set_Filter
(This : in out File_Browser;
Value : in String);
function Get_Icon_Size
(This : in File_Browser)
return Icon_Size;
procedure Set_Icon_Size
(This : in out File_Browser;
Value : in Icon_Size);
function Get_Text_Size
(This : in File_Browser)
return Font_Size;
procedure Set_Text_Size
(This : in out File_Browser;
Size : in Font_Size);
function Full_List_Height
(This : in File_Browser)
return Integer;
function Average_Item_Height
(This : in File_Browser)
return Integer;
function Item_Width
(This : in File_Browser;
Item : in Item_Cursor)
return Integer;
function Item_Height
(This : in File_Browser;
Item : in Item_Cursor)
return Integer;
procedure Item_Draw
(This : in File_Browser;
Item : in Item_Cursor;
X, Y, W, H : in Integer);
private
type File_Browser is new Textline_Browser with null record;
overriding procedure Initialize
(This : in out File_Browser);
overriding procedure Finalize
(This : in out File_Browser);
procedure Extra_Init
(This : in out File_Browser;
X, Y, W, H : in Integer;
Text : in String);
procedure Extra_Final
(This : in out File_Browser);
pragma Inline (Set_File_Kind);
pragma Inline (Set_Filter);
pragma Inline (Get_Icon_Size);
pragma Inline (Set_Icon_Size);
pragma Inline (Get_Text_Size);
pragma Inline (Set_Text_Size);
pragma Inline (Full_List_Height);
pragma Inline (Average_Item_Height);
pragma Inline (Item_Width);
pragma Inline (Item_Height);
pragma Inline (Item_Draw);
end FLTK.Widgets.Groups.Browsers.Textline.File;
|