Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 393 lines (356 sloc) 11.35 kb
892cdbb @malaise Automatic relook Ada95.
authored
1 separate (Afpx)
2 package body Af_List is
9f28a0d @malaise *** empty log message ***
authored
3
892cdbb @malaise Automatic relook Ada95.
authored
4 Status : Status_Rec;
5 Opened : Boolean := False;
9f28a0d @malaise *** empty log message ***
authored
6
892cdbb @malaise Automatic relook Ada95.
authored
7 List_Window : Con_Io.Window;
9f28a0d @malaise *** empty log message ***
authored
8
729f263 @malaise Reset status on open instead of computing with potentially wrong list.
authored
9 -- Reset/Compute status
892cdbb @malaise Automatic relook Ada95.
authored
10 procedure Reset;
11 procedure Compute (First_Item_Id : in Positive);
3feaeed @malaise Compute pos as standalone
authored
12
9f28a0d @malaise *** empty log message ***
authored
13 -- Open / Re-open the list window
892cdbb @malaise Automatic relook Ada95.
authored
14 procedure Open is
15 use Afpx_Typ;
9f28a0d @malaise *** empty log message ***
authored
16 begin
17 -- Check there is a descriptor
892cdbb @malaise Automatic relook Ada95.
authored
18 Af_Dscr.Check;
9f28a0d @malaise *** empty log message ***
authored
19 -- Close previous window
892cdbb @malaise Automatic relook Ada95.
authored
20 if Con_Io.Is_Open (List_Window) then
21 Con_Io.Close (List_Window);
9f28a0d @malaise *** empty log message ***
authored
22 end if;
23 -- Check there is a window in the dscr
892cdbb @malaise Automatic relook Ada95.
authored
24 if Af_Dscr.Fields(Lfn).Kind = Afpx_Typ.Button then
25 Con_Io.Open (List_Window,
26 Af_Dscr.Fields(Lfn).Upper_Left,
27 Af_Dscr.Fields(Lfn).Lower_Right);
28 Opened := True;
3feaeed @malaise Compute pos as standalone
authored
29 -- Start at top
892cdbb @malaise Automatic relook Ada95.
authored
30 Status.Id_Selected := 0;
31 Reset;
9f28a0d @malaise *** empty log message ***
authored
32 else
892cdbb @malaise Automatic relook Ada95.
authored
33 Opened := False;
9f28a0d @malaise *** empty log message ***
authored
34 end if;
35
892cdbb @malaise Automatic relook Ada95.
authored
36 end Open;
9f28a0d @malaise *** empty log message ***
authored
37
892cdbb @malaise Automatic relook Ada95.
authored
38 procedure Move (Id : in Positive) is
9f28a0d @malaise *** empty log message ***
authored
39 begin
892cdbb @malaise Automatic relook Ada95.
authored
40 Line_List_Mng.Move_To (Line_List, Line_List_Mng.Next, Id - 1, False);
41 end Move;
9f28a0d @malaise *** empty log message ***
authored
42
892cdbb @malaise Automatic relook Ada95.
authored
43 procedure Get_Current_Item (Item : out Line_Rec) is
9f28a0d @malaise *** empty log message ***
authored
44 begin
892cdbb @malaise Automatic relook Ada95.
authored
45 Line_List_Mng.Read (Line_List, Item, Line_List_Mng.Next);
9f28a0d @malaise *** empty log message ***
authored
46 exception
892cdbb @malaise Automatic relook Ada95.
authored
47 when Line_List_Mng.Not_In_List =>
48 Line_List_Mng.Read (Line_List, Item, Line_List_Mng.Current);
49 end Get_Current_Item;
50
51 procedure Put (Row : in Con_Io.Row_Range; State : in Af_Ptg.State_List;
52 Item : in Line_Rec) is
53 Str : String (1 .. Af_Dscr.Fields(Lfn).Width) := (others => ' ');
54 Foreground : Con_Io.Effective_Colors;
55 Background : Con_Io.Effective_Basic_Colors;
9f28a0d @malaise *** empty log message ***
authored
56 begin
57 -- Set colors
892cdbb @malaise Automatic relook Ada95.
authored
58 Af_Ptg.Set_Colors (Af_Dscr.Fields(Lfn), State,
59 Foreground, Background);
9f28a0d @malaise *** empty log message ***
authored
60 -- Set str
892cdbb @malaise Automatic relook Ada95.
authored
61 if Item.Len > Str'Last then
62 Str := Item.Str (Str'Range);
9f28a0d @malaise *** empty log message ***
authored
63 else
892cdbb @malaise Automatic relook Ada95.
authored
64 Str (1 .. Item.Len) := Item.Str (1 .. Item.Len);
9f28a0d @malaise *** empty log message ***
authored
65 end if;
66 -- Move
892cdbb @malaise Automatic relook Ada95.
authored
67 Con_Io.Move ( (Row, 0), List_Window);
9f28a0d @malaise *** empty log message ***
authored
68 -- Put
892cdbb @malaise Automatic relook Ada95.
authored
69 Con_Io.Put (S => Str,
70 Name => List_Window,
71 Foreground => Foreground,
72 Blink_Stat => Af_Dscr.Fields(0).Colors.Blink_Stat,
73 Background => Background,
74 Move => False);
75 end Put;
76
77 procedure Clear (Row : in Con_Io.Row_Range) is
78 Str : constant String (1 .. Af_Dscr.Fields(Lfn).Width) := (others => ' ');
79 Foreground : Con_Io.Effective_Colors;
80 Background : Con_Io.Effective_Basic_Colors;
9f28a0d @malaise *** empty log message ***
authored
81 begin
82 -- Set colors
892cdbb @malaise Automatic relook Ada95.
authored
83 Af_Ptg.Set_Colors (Af_Dscr.Fields(Lfn), Af_Ptg.Normal,
84 Foreground, Background);
9f28a0d @malaise *** empty log message ***
authored
85 -- Move
892cdbb @malaise Automatic relook Ada95.
authored
86 Con_Io.Move ( (Row, 0), List_Window);
9f28a0d @malaise *** empty log message ***
authored
87 -- Put
892cdbb @malaise Automatic relook Ada95.
authored
88 Con_Io.Put (S => Str,
89 Name => List_Window,
90 Foreground => Foreground,
91 Blink_Stat => Af_Dscr.Fields(Lfn).Colors.Blink_Stat,
92 Background => Background,
93 Move => False);
94 end Clear;
95
96 procedure Put (Row : in Con_Io.Row_Range; State : in Af_Ptg.State_List) is
97 Id : Positive;
98 Item : Line_Rec;
9f28a0d @malaise *** empty log message ***
authored
99 begin
892cdbb @malaise Automatic relook Ada95.
authored
100 if not Opened then
101 raise Not_Opened;
9f28a0d @malaise *** empty log message ***
authored
102 end if;
892cdbb @malaise Automatic relook Ada95.
authored
103 Id := Status.Id_Top + Row;
104 Move (Id);
105 Get_Current_Item (Item);
106 Put (Row, State, Item);
9f28a0d @malaise *** empty log message ***
authored
107 exception
108 when others =>
892cdbb @malaise Automatic relook Ada95.
authored
109 raise Afpx_Internal_Error;
110 end Put;
9f28a0d @malaise *** empty log message ***
authored
111
112
892cdbb @malaise Automatic relook Ada95.
authored
113 procedure Set_Colors is
9f28a0d @malaise *** empty log message ***
authored
114 begin
892cdbb @malaise Automatic relook Ada95.
authored
115 Con_Io.Set_Foreground (Af_Dscr.Fields(Lfn).Colors.Foreground,
116 Af_Dscr.Fields(Lfn).Colors.Blink_Stat, List_Window);
117 Con_Io.Set_Background (Af_Dscr.Fields(Lfn).Colors.Background, List_Window);
118 end Set_Colors;
9f28a0d @malaise *** empty log message ***
authored
119
729f263 @malaise Reset status on open instead of computing with potentially wrong list.
authored
120 -- Reset status
892cdbb @malaise Automatic relook Ada95.
authored
121 procedure Reset is
729f263 @malaise Reset status on open instead of computing with potentially wrong list.
authored
122 begin
892cdbb @malaise Automatic relook Ada95.
authored
123 Status.Nb_Rows := 0;
124 Status.Id_Top := 0;
125 Status.Id_Bottom := 0;
126 Status.Id_Selected := 0;
127 end Reset;
729f263 @malaise Reset status on open instead of computing with potentially wrong list.
authored
128
3feaeed @malaise Compute pos as standalone
authored
129 -- Compute status
892cdbb @malaise Automatic relook Ada95.
authored
130 procedure Compute (First_Item_Id : in Positive) is
9f28a0d @malaise *** empty log message ***
authored
131 begin
892cdbb @malaise Automatic relook Ada95.
authored
132 if not Opened then
133 raise Not_Opened;
9f28a0d @malaise *** empty log message ***
authored
134 end if;
892cdbb @malaise Automatic relook Ada95.
authored
135 if Line_List_Mng.Is_Empty (Line_List) then
136 Reset;
9f28a0d @malaise *** empty log message ***
authored
137 return;
138 end if;
3feaeed @malaise Compute pos as standalone
authored
139
892cdbb @malaise Automatic relook Ada95.
authored
140 if Status.Id_Selected > Line_List_Mng.List_Length (Line_List) then
141 raise Line_List_Mng.Not_In_List;
9f28a0d @malaise *** empty log message ***
authored
142 end if;
729f263 @malaise Reset status on open instead of computing with potentially wrong list.
authored
143 -- top + height - 1 <= length => can display HEIGHT items
892cdbb @malaise Automatic relook Ada95.
authored
144 if Line_List_Mng.List_Length (Line_List) - First_Item_Id >=
145 Af_Dscr.Fields(Lfn).Height then
9f28a0d @malaise *** empty log message ***
authored
146 -- Can display HEIGHT items
892cdbb @malaise Automatic relook Ada95.
authored
147 Status.Nb_Rows := Af_Dscr.Fields(Lfn).Height;
148 Status.Id_Top := First_Item_Id;
149 elsif Line_List_Mng.List_Length (Line_List) <
150 Af_Dscr.Fields(Lfn).Height then
9f28a0d @malaise *** empty log message ***
authored
151 -- Cannot display LIST length items whatever first
892cdbb @malaise Automatic relook Ada95.
authored
152 Status.Nb_Rows := Line_List_Mng.List_Length (Line_List);
153 Status.Id_Top := 1;
729f263 @malaise Reset status on open instead of computing with potentially wrong list.
authored
154 else
155 -- Can display HEIGHT items but not with this first.
9f28a0d @malaise *** empty log message ***
authored
156 -- Set top to display last page
892cdbb @malaise Automatic relook Ada95.
authored
157 Status.Nb_Rows := Af_Dscr.Fields(Lfn).Height;
158 Status.Id_Top := Line_List_Mng.List_Length (Line_List)
159 - Af_Dscr.Fields(Lfn).Height + 1;
9f28a0d @malaise *** empty log message ***
authored
160 end if;
892cdbb @malaise Automatic relook Ada95.
authored
161 Status.Id_Bottom := Status.Id_Top + Status.Nb_Rows - 1;
9f28a0d @malaise *** empty log message ***
authored
162 -- Select by default
892cdbb @malaise Automatic relook Ada95.
authored
163 if Status.Id_Selected = 0 then
164 Status.Id_Selected := Status.Id_Top;
9f28a0d @malaise *** empty log message ***
authored
165 end if;
3feaeed @malaise Compute pos as standalone
authored
166 exception
167 when others =>
892cdbb @malaise Automatic relook Ada95.
authored
168 raise Afpx_Internal_Error;
169 end Compute;
3feaeed @malaise Compute pos as standalone
authored
170
171 -- Display the list, starting from FIRST_ITEM
892cdbb @malaise Automatic relook Ada95.
authored
172 procedure Display (First_Item_Id : in Positive) is
173 Item : Line_Rec;
3feaeed @malaise Compute pos as standalone
authored
174 begin
175 -- Set status
892cdbb @malaise Automatic relook Ada95.
authored
176 Compute (First_Item_Id);
3feaeed @malaise Compute pos as standalone
authored
177
892cdbb @malaise Automatic relook Ada95.
authored
178 if Line_List_Mng.Is_Empty (Line_List) then
179 Set_Colors;
180 Con_Io.Clear (List_Window);
3feaeed @malaise Compute pos as standalone
authored
181 return;
182 end if;
9f28a0d @malaise *** empty log message ***
authored
183
184 -- Display list
892cdbb @malaise Automatic relook Ada95.
authored
185 Move (Status.Id_Top);
186 for I in 1 .. Status.Nb_Rows loop
187 Get_Current_Item (Item);
188 if not Af_Dscr.Fields(Lfn).Isprotected
189 and then Status.Id_Top + I - 1 = Status.Id_Selected then
190 Put (I - 1, Af_Ptg.Selected, Item);
9f28a0d @malaise *** empty log message ***
authored
191 else
892cdbb @malaise Automatic relook Ada95.
authored
192 Put (I - 1, Af_Ptg.Normal, Item);
9f28a0d @malaise *** empty log message ***
authored
193 end if;
194 end loop;
892cdbb @malaise Automatic relook Ada95.
authored
195 Move (Status.Id_Selected);
9f28a0d @malaise *** empty log message ***
authored
196
c4041e4 @malaise The refresh list is fixed. No more clear of list.
authored
197 -- Display empty end of list (if any)
892cdbb @malaise Automatic relook Ada95.
authored
198 for I in Status.Nb_Rows + 1 .. Af_Dscr.Fields(Lfn).Height loop
199 Clear (I - 1);
c4041e4 @malaise The refresh list is fixed. No more clear of list.
authored
200 end loop;
201
202
9f28a0d @malaise *** empty log message ***
authored
203 exception
204 when others =>
892cdbb @malaise Automatic relook Ada95.
authored
205 raise Afpx_Internal_Error;
206 end Display;
9f28a0d @malaise *** empty log message ***
authored
207
208 -- Actions on the list
209 -- type ACTION_LIST is (UP, DOWN, PAGE_UP, PAGE_DOWN);
210
211 -- Update the list due to an action
892cdbb @malaise Automatic relook Ada95.
authored
212 procedure Update (Action : in List_Action_List) is
213 First_Item_Id : Natural;
9f28a0d @malaise *** empty log message ***
authored
214 begin
892cdbb @malaise Automatic relook Ada95.
authored
215 if not Opened then
216 raise Not_Opened;
9f28a0d @malaise *** empty log message ***
authored
217 end if;
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
218 -- Update may be called before 1st PTG
892cdbb @malaise Automatic relook Ada95.
authored
219 if Status.Id_Selected = 0 then
220 Compute (1);
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
221 end if;
02270e0 @malaise Update raises Internal_Error when list has been modified
authored
222 -- List is empty
892cdbb @malaise Automatic relook Ada95.
authored
223 if Line_List_Mng.Is_Empty (Line_List) then
9f28a0d @malaise *** empty log message ***
authored
224 return;
225 end if;
226
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
227 -- Update selection, cause current may have changed
19ad4fc @malaise Define LIST_FIELD_NO and LFN
authored
228 -- called by user
892cdbb @malaise Automatic relook Ada95.
authored
229 Af_List.Set_Selected (Line_List_Mng.Get_Position(Line_List));
19ad4fc @malaise Define LIST_FIELD_NO and LFN
authored
230
02270e0 @malaise Update raises Internal_Error when list has been modified
authored
231 -- Recompute cause list may have changed
892cdbb @malaise Automatic relook Ada95.
authored
232 Compute (Status.Id_Top);
02270e0 @malaise Update raises Internal_Error when list has been modified
authored
233
234 -- Nothing to scroll
892cdbb @malaise Automatic relook Ada95.
authored
235 if Status.Nb_Rows /= Af_Dscr.Fields(Lfn).Height then
02270e0 @malaise Update raises Internal_Error when list has been modified
authored
236 return;
237 end if;
238
892cdbb @malaise Automatic relook Ada95.
authored
239 case Action is
240 when Up =>
9f28a0d @malaise *** empty log message ***
authored
241 -- Scroll 1 row down
892cdbb @malaise Automatic relook Ada95.
authored
242 if Status.Id_Top /= 1 then
243 First_Item_Id := Status.Id_Top - 1;
244 Display (First_Item_Id);
9f28a0d @malaise *** empty log message ***
authored
245 end if;
892cdbb @malaise Automatic relook Ada95.
authored
246 when Down =>
9f28a0d @malaise *** empty log message ***
authored
247 -- Scroll 1 row down
892cdbb @malaise Automatic relook Ada95.
authored
248 if Status.Id_Bottom /= Line_List_Mng.List_Length (Line_List) then
249 First_Item_Id := Status.Id_Top + 1;
250 Display (First_Item_Id);
9f28a0d @malaise *** empty log message ***
authored
251 end if;
892cdbb @malaise Automatic relook Ada95.
authored
252 when Page_Down =>
9f28a0d @malaise *** empty log message ***
authored
253 -- Display next page
254 -- Bottom + height < length => Bottom + height exists
892cdbb @malaise Automatic relook Ada95.
authored
255 if Line_List_Mng.List_Length (Line_List) - Status.Id_Bottom >
256 Af_Dscr.Fields(Lfn).Height then
257 First_Item_Id := Status.Id_Top + Af_Dscr.Fields(Lfn).Height;
258 elsif Status.Id_Bottom /= Line_List_Mng.List_Length (Line_List) then
9f28a0d @malaise *** empty log message ***
authored
259 -- End at last item
892cdbb @malaise Automatic relook Ada95.
authored
260 First_Item_Id := Line_List_Mng.List_Length (Line_List)
261 - Af_Dscr.Fields(Lfn).Height + 1;
9f28a0d @malaise *** empty log message ***
authored
262 else
263 -- Already at bottom of list
264 return;
265 end if;
892cdbb @malaise Automatic relook Ada95.
authored
266 Display (First_Item_Id);
267 when Page_Up =>
9f28a0d @malaise *** empty log message ***
authored
268 -- Display previous page
269 -- top - height > 1 => top - height exists
892cdbb @malaise Automatic relook Ada95.
authored
270 if Status.Id_Top > Af_Dscr.Fields(Lfn).Height + 1 then
271 First_Item_Id := Status.Id_Top - Af_Dscr.Fields(Lfn).Height;
272 elsif Status.Id_Top /= 1 then
9f28a0d @malaise *** empty log message ***
authored
273 -- Start at first item
892cdbb @malaise Automatic relook Ada95.
authored
274 First_Item_Id := 1;
9f28a0d @malaise *** empty log message ***
authored
275 else
276 -- Already at top of list
277 return;
278 end if;
892cdbb @malaise Automatic relook Ada95.
authored
279 Display (First_Item_Id);
280 when Top =>
04e0b7f @malaise List top/bottom.
authored
281 -- Move to top of list
892cdbb @malaise Automatic relook Ada95.
authored
282 if Status.Id_Top = 1 then
04e0b7f @malaise List top/bottom.
authored
283 -- Already at top of list
284 return;
285 end if;
892cdbb @malaise Automatic relook Ada95.
authored
286 First_Item_Id := 1;
287 Display (First_Item_Id);
288 when Bottom =>
04e0b7f @malaise List top/bottom.
authored
289 -- Move to bottom of list
892cdbb @malaise Automatic relook Ada95.
authored
290 if Status.Id_Bottom = Line_List_Mng.List_Length (Line_List) then
04e0b7f @malaise List top/bottom.
authored
291 -- Already at bottom of list
292 return;
293 end if;
892cdbb @malaise Automatic relook Ada95.
authored
294 First_Item_Id := Line_List_Mng.List_Length (Line_List)
295 - Af_Dscr.Fields(Lfn).Height + 1;
296 Display (First_Item_Id);
297 when Center =>
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
298 -- Center current LIST item in window (do ower best)
299 declare
300 -- List length
892cdbb @malaise Automatic relook Ada95.
authored
301 Len : constant Positive := Line_List_Mng.List_Length (Line_List);
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
302 -- Current position in list
892cdbb @malaise Automatic relook Ada95.
authored
303 Pos : constant Positive
304 := Line_List_Mng.Get_Position (Line_List);
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
305 -- Row in window to put it
892cdbb @malaise Automatic relook Ada95.
authored
306 Height : constant Positive := Af_Dscr.Fields(Lfn).Height;
307 Midrow : constant Natural := Height / 2;
308 Lastrow : constant Natural := Height - 1;
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
309 begin
892cdbb @malaise Automatic relook Ada95.
authored
310 if Pos - 1 < Midrow then
311 Update(Top);
312 elsif Len - Pos < Lastrow - Midrow then
313 Update(Bottom);
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
314 else
892cdbb @malaise Automatic relook Ada95.
authored
315 First_Item_Id := Pos - Midrow;
316 Display (First_Item_Id);
c19bd0b @malaise Allow UPDATE to be called before first PTG.
authored
317 end if;
318 end;
319
9f28a0d @malaise *** empty log message ***
authored
320 end case;
321 exception
322 when others =>
892cdbb @malaise Automatic relook Ada95.
authored
323 raise Afpx_Internal_Error;
324 end Update;
9f28a0d @malaise *** empty log message ***
authored
325
326 -- Set the current item (selected_color) of the lis
892cdbb @malaise Automatic relook Ada95.
authored
327 procedure Set_Selected (Item_Id : in Positive) is
9f28a0d @malaise *** empty log message ***
authored
328 begin
892cdbb @malaise Automatic relook Ada95.
authored
329 if not Opened then
330 raise Not_Opened;
9f28a0d @malaise *** empty log message ***
authored
331 end if;
892cdbb @malaise Automatic relook Ada95.
authored
332 if Item_Id > Line_List_Mng.List_Length (Line_List) then
333 raise Line_List_Mng.Not_In_List;
9f28a0d @malaise *** empty log message ***
authored
334 end if;
892cdbb @malaise Automatic relook Ada95.
authored
335 Status.Id_Selected := Item_Id;
336 end Set_Selected;
9f28a0d @malaise *** empty log message ***
authored
337
338 -- Status of the list
892cdbb @malaise Automatic relook Ada95.
authored
339 function Get_Status return Status_Rec is
9f28a0d @malaise *** empty log message ***
authored
340 begin
892cdbb @malaise Automatic relook Ada95.
authored
341 return Status;
342 end Get_Status;
9f28a0d @malaise *** empty log message ***
authored
343
892cdbb @malaise Automatic relook Ada95.
authored
344 procedure Set_Current is
9f28a0d @malaise *** empty log message ***
authored
345 begin
892cdbb @malaise Automatic relook Ada95.
authored
346 if not Opened then
347 raise Not_Opened;
9f28a0d @malaise *** empty log message ***
authored
348 end if;
892cdbb @malaise Automatic relook Ada95.
authored
349 if Line_List_Mng.Is_Empty (Line_List) then
9f28a0d @malaise *** empty log message ***
authored
350 return;
351 end if;
892cdbb @malaise Automatic relook Ada95.
authored
352 Move (Status.Id_Selected);
9f28a0d @malaise *** empty log message ***
authored
353 exception
354 when others =>
892cdbb @malaise Automatic relook Ada95.
authored
355 raise Afpx_Internal_Error;
356 end Set_Current;
9f28a0d @malaise *** empty log message ***
authored
357
358 -- Is an ID, a row displayed
892cdbb @malaise Automatic relook Ada95.
authored
359 function Id_Displayed (Id : Positive) return Boolean is
9f28a0d @malaise *** empty log message ***
authored
360 begin
892cdbb @malaise Automatic relook Ada95.
authored
361 if not Opened then
362 raise Not_Opened;
9f28a0d @malaise *** empty log message ***
authored
363 end if;
892cdbb @malaise Automatic relook Ada95.
authored
364 return Id >= Status.Id_Top and then Id <= Status.Id_Bottom;
365 end Id_Displayed;
9f28a0d @malaise *** empty log message ***
authored
366
892cdbb @malaise Automatic relook Ada95.
authored
367 function Row_Displayed (Row : Con_Io.Row_Range) return Boolean is
9f28a0d @malaise *** empty log message ***
authored
368 begin
892cdbb @malaise Automatic relook Ada95.
authored
369 if not Opened then
370 raise Not_Opened;
9f28a0d @malaise *** empty log message ***
authored
371 end if;
892cdbb @malaise Automatic relook Ada95.
authored
372 return Row < Status.Nb_Rows;
373 end Row_Displayed;
9f28a0d @malaise *** empty log message ***
authored
374
375 -- ROW <-> Item ID
892cdbb @malaise Automatic relook Ada95.
authored
376 function To_Row (Id : Positive) return Con_Io.Row_Range is
9f28a0d @malaise *** empty log message ***
authored
377 begin
892cdbb @malaise Automatic relook Ada95.
authored
378 if not Id_Displayed (Id) then
379 raise Afpx_Internal_Error;
9f28a0d @malaise *** empty log message ***
authored
380 end if;
892cdbb @malaise Automatic relook Ada95.
authored
381 return Id - Status.Id_Top;
382 end To_Row;
9f28a0d @malaise *** empty log message ***
authored
383
892cdbb @malaise Automatic relook Ada95.
authored
384 function To_Id (Row : Con_Io.Row_Range) return Positive is
9f28a0d @malaise *** empty log message ***
authored
385 begin
892cdbb @malaise Automatic relook Ada95.
authored
386 if not Row_Displayed (Row) then
387 raise Afpx_Internal_Error;
9f28a0d @malaise *** empty log message ***
authored
388 end if;
892cdbb @malaise Automatic relook Ada95.
authored
389 return Row + Status.Id_Top;
390 end To_Id;
9f28a0d @malaise *** empty log message ***
authored
391
892cdbb @malaise Automatic relook Ada95.
authored
392 end Af_List;
Something went wrong with that request. Please try again.