2 define(`HTMLNAME',`terminal_interface-curses-forms__ads.htm')dnl
4 ------------------------------------------------------------------------------
6 -- GNAT ncurses Binding --
8 -- Terminal_Interface.Curses.Form --
12 ------------------------------------------------------------------------------
13 -- Copyright (c) 1998-2009,2014 Free Software Foundation, Inc. --
15 -- Permission is hereby granted, free of charge, to any person obtaining a --
16 -- copy of this software and associated documentation files (the --
17 -- "Software"), to deal in the Software without restriction, including --
18 -- without limitation the rights to use, copy, modify, merge, publish, --
19 -- distribute, distribute with modifications, sublicense, and/or sell --
20 -- copies of the Software, and to permit persons to whom the Software is --
21 -- furnished to do so, subject to the following conditions: --
23 -- The above copyright notice and this permission notice shall be included --
24 -- in all copies or substantial portions of the Software. --
26 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
27 -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
28 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
29 -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
30 -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
31 -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
32 -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
34 -- Except as contained in this notice, the name(s) of the above copyright --
35 -- holders shall not be used in advertising or otherwise to promote the --
36 -- sale, use or other dealings in this Software without prior written --
38 ------------------------------------------------------------------------------
39 -- Author: Juergen Pfeifer, 1996
42 -- $Date: 2014/05/24 21:31:57 $
43 -- Binding Version 01.00
44 ------------------------------------------------------------------------------
46 with Ada.Characters.Latin_1;
48 package Terminal_Interface.Curses.Forms is
49 pragma Preelaborate (Terminal_Interface.Curses.Forms);
50 pragma Linker_Options ("-lform" & Curses_Constants.DFT_ARG_SUFFIX);
52 Space : Character renames Ada.Characters.Latin_1.Space;
54 type Field is private;
57 Null_Field : constant Field;
58 Null_Form : constant Form;
60 type Field_Justification is (None,
65 type Field_Option_Set is
78 pragma Convention (C_Pass_By_Copy, Field_Option_Set);
80 for Field_Option_Set use
82 Visible at 0 range Curses_Constants.O_VISIBLE_First
83 .. Curses_Constants.O_VISIBLE_Last;
84 Active at 0 range Curses_Constants.O_ACTIVE_First
85 .. Curses_Constants.O_ACTIVE_Last;
86 Public at 0 range Curses_Constants.O_PUBLIC_First
87 .. Curses_Constants.O_PUBLIC_Last;
88 Edit at 0 range Curses_Constants.O_EDIT_First
89 .. Curses_Constants.O_EDIT_Last;
90 Wrap at 0 range Curses_Constants.O_WRAP_First
91 .. Curses_Constants.O_WRAP_Last;
92 Blank at 0 range Curses_Constants.O_BLANK_First
93 .. Curses_Constants.O_BLANK_Last;
94 Auto_Skip at 0 range Curses_Constants.O_AUTOSKIP_First
95 .. Curses_Constants.O_AUTOSKIP_Last;
96 Null_Ok at 0 range Curses_Constants.O_NULLOK_First
97 .. Curses_Constants.O_NULLOK_Last;
98 Pass_Ok at 0 range Curses_Constants.O_PASSOK_First
99 .. Curses_Constants.O_PASSOK_Last;
100 Static at 0 range Curses_Constants.O_STATIC_First
101 .. Curses_Constants.O_STATIC_Last;
103 pragma Warnings (Off);
104 for Field_Option_Set'Size use Curses_Constants.Field_Options_Size;
105 pragma Warnings (On);
107 function Default_Field_Options return Field_Option_Set;
108 -- The initial defaults for the field options.
109 pragma Inline (Default_Field_Options);
111 type Form_Option_Set is
113 NL_Overload : Boolean;
114 BS_Overload : Boolean;
116 pragma Convention (C_Pass_By_Copy, Form_Option_Set);
118 for Form_Option_Set use
120 NL_Overload at 0 range Curses_Constants.O_NL_OVERLOAD_First
121 .. Curses_Constants.O_NL_OVERLOAD_Last;
122 BS_Overload at 0 range Curses_Constants.O_BS_OVERLOAD_First
123 .. Curses_Constants.O_BS_OVERLOAD_Last;
125 pragma Warnings (Off);
126 for Form_Option_Set'Size use Curses_Constants.Field_Options_Size;
127 pragma Warnings (On);
129 function Default_Form_Options return Form_Option_Set;
130 -- The initial defaults for the form options.
131 pragma Inline (Default_Form_Options);
133 type Buffer_Number is new Natural;
135 type Field_Array is array (Positive range <>) of aliased Field;
136 pragma Convention (C, Field_Array);
138 type Field_Array_Access is access Field_Array;
140 procedure Free (FA : in out Field_Array_Access;
141 Free_Fields : Boolean := False);
142 -- Release the memory for an allocated field array
143 -- If Free_Fields is True, call Delete() for all the fields in
146 subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57);
148 -- The prefix F_ stands for "Form Request"
149 F_Next_Page : constant Form_Request_Code := Key_Max + 1;
150 F_Previous_Page : constant Form_Request_Code := Key_Max + 2;
151 F_First_Page : constant Form_Request_Code := Key_Max + 3;
152 F_Last_Page : constant Form_Request_Code := Key_Max + 4;
154 F_Next_Field : constant Form_Request_Code := Key_Max + 5;
155 F_Previous_Field : constant Form_Request_Code := Key_Max + 6;
156 F_First_Field : constant Form_Request_Code := Key_Max + 7;
157 F_Last_Field : constant Form_Request_Code := Key_Max + 8;
158 F_Sorted_Next_Field : constant Form_Request_Code := Key_Max + 9;
159 F_Sorted_Previous_Field : constant Form_Request_Code := Key_Max + 10;
160 F_Sorted_First_Field : constant Form_Request_Code := Key_Max + 11;
161 F_Sorted_Last_Field : constant Form_Request_Code := Key_Max + 12;
162 F_Left_Field : constant Form_Request_Code := Key_Max + 13;
163 F_Right_Field : constant Form_Request_Code := Key_Max + 14;
164 F_Up_Field : constant Form_Request_Code := Key_Max + 15;
165 F_Down_Field : constant Form_Request_Code := Key_Max + 16;
167 F_Next_Char : constant Form_Request_Code := Key_Max + 17;
168 F_Previous_Char : constant Form_Request_Code := Key_Max + 18;
169 F_Next_Line : constant Form_Request_Code := Key_Max + 19;
170 F_Previous_Line : constant Form_Request_Code := Key_Max + 20;
171 F_Next_Word : constant Form_Request_Code := Key_Max + 21;
172 F_Previous_Word : constant Form_Request_Code := Key_Max + 22;
173 F_Begin_Field : constant Form_Request_Code := Key_Max + 23;
174 F_End_Field : constant Form_Request_Code := Key_Max + 24;
175 F_Begin_Line : constant Form_Request_Code := Key_Max + 25;
176 F_End_Line : constant Form_Request_Code := Key_Max + 26;
177 F_Left_Char : constant Form_Request_Code := Key_Max + 27;
178 F_Right_Char : constant Form_Request_Code := Key_Max + 28;
179 F_Up_Char : constant Form_Request_Code := Key_Max + 29;
180 F_Down_Char : constant Form_Request_Code := Key_Max + 30;
182 F_New_Line : constant Form_Request_Code := Key_Max + 31;
183 F_Insert_Char : constant Form_Request_Code := Key_Max + 32;
184 F_Insert_Line : constant Form_Request_Code := Key_Max + 33;
185 F_Delete_Char : constant Form_Request_Code := Key_Max + 34;
186 F_Delete_Previous : constant Form_Request_Code := Key_Max + 35;
187 F_Delete_Line : constant Form_Request_Code := Key_Max + 36;
188 F_Delete_Word : constant Form_Request_Code := Key_Max + 37;
189 F_Clear_EOL : constant Form_Request_Code := Key_Max + 38;
190 F_Clear_EOF : constant Form_Request_Code := Key_Max + 39;
191 F_Clear_Field : constant Form_Request_Code := Key_Max + 40;
192 F_Overlay_Mode : constant Form_Request_Code := Key_Max + 41;
193 F_Insert_Mode : constant Form_Request_Code := Key_Max + 42;
195 -- Vertical Scrolling
196 F_ScrollForward_Line : constant Form_Request_Code := Key_Max + 43;
197 F_ScrollBackward_Line : constant Form_Request_Code := Key_Max + 44;
198 F_ScrollForward_Page : constant Form_Request_Code := Key_Max + 45;
199 F_ScrollBackward_Page : constant Form_Request_Code := Key_Max + 46;
200 F_ScrollForward_HalfPage : constant Form_Request_Code := Key_Max + 47;
201 F_ScrollBackward_HalfPage : constant Form_Request_Code := Key_Max + 48;
203 -- Horizontal Scrolling
204 F_HScrollForward_Char : constant Form_Request_Code := Key_Max + 49;
205 F_HScrollBackward_Char : constant Form_Request_Code := Key_Max + 50;
206 F_HScrollForward_Line : constant Form_Request_Code := Key_Max + 51;
207 F_HScrollBackward_Line : constant Form_Request_Code := Key_Max + 52;
208 F_HScrollForward_HalfLine : constant Form_Request_Code := Key_Max + 53;
209 F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54;
211 F_Validate_Field : constant Form_Request_Code := Key_Max + 55;
212 F_Next_Choice : constant Form_Request_Code := Key_Max + 56;
213 F_Previous_Choice : constant Form_Request_Code := Key_Max + 57;
215 -- For those who like the old 'C' style request names
216 REQ_NEXT_PAGE : Form_Request_Code renames F_Next_Page;
217 REQ_PREV_PAGE : Form_Request_Code renames F_Previous_Page;
218 REQ_FIRST_PAGE : Form_Request_Code renames F_First_Page;
219 REQ_LAST_PAGE : Form_Request_Code renames F_Last_Page;
221 REQ_NEXT_FIELD : Form_Request_Code renames F_Next_Field;
222 REQ_PREV_FIELD : Form_Request_Code renames F_Previous_Field;
223 REQ_FIRST_FIELD : Form_Request_Code renames F_First_Field;
224 REQ_LAST_FIELD : Form_Request_Code renames F_Last_Field;
225 REQ_SNEXT_FIELD : Form_Request_Code renames F_Sorted_Next_Field;
226 REQ_SPREV_FIELD : Form_Request_Code renames F_Sorted_Previous_Field;
227 REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field;
228 REQ_SLAST_FIELD : Form_Request_Code renames F_Sorted_Last_Field;
229 REQ_LEFT_FIELD : Form_Request_Code renames F_Left_Field;
230 REQ_RIGHT_FIELD : Form_Request_Code renames F_Right_Field;
231 REQ_UP_FIELD : Form_Request_Code renames F_Up_Field;
232 REQ_DOWN_FIELD : Form_Request_Code renames F_Down_Field;
234 REQ_NEXT_CHAR : Form_Request_Code renames F_Next_Char;
235 REQ_PREV_CHAR : Form_Request_Code renames F_Previous_Char;
236 REQ_NEXT_LINE : Form_Request_Code renames F_Next_Line;
237 REQ_PREV_LINE : Form_Request_Code renames F_Previous_Line;
238 REQ_NEXT_WORD : Form_Request_Code renames F_Next_Word;
239 REQ_PREV_WORD : Form_Request_Code renames F_Previous_Word;
240 REQ_BEG_FIELD : Form_Request_Code renames F_Begin_Field;
241 REQ_END_FIELD : Form_Request_Code renames F_End_Field;
242 REQ_BEG_LINE : Form_Request_Code renames F_Begin_Line;
243 REQ_END_LINE : Form_Request_Code renames F_End_Line;
244 REQ_LEFT_CHAR : Form_Request_Code renames F_Left_Char;
245 REQ_RIGHT_CHAR : Form_Request_Code renames F_Right_Char;
246 REQ_UP_CHAR : Form_Request_Code renames F_Up_Char;
247 REQ_DOWN_CHAR : Form_Request_Code renames F_Down_Char;
249 REQ_NEW_LINE : Form_Request_Code renames F_New_Line;
250 REQ_INS_CHAR : Form_Request_Code renames F_Insert_Char;
251 REQ_INS_LINE : Form_Request_Code renames F_Insert_Line;
252 REQ_DEL_CHAR : Form_Request_Code renames F_Delete_Char;
253 REQ_DEL_PREV : Form_Request_Code renames F_Delete_Previous;
254 REQ_DEL_LINE : Form_Request_Code renames F_Delete_Line;
255 REQ_DEL_WORD : Form_Request_Code renames F_Delete_Word;
256 REQ_CLR_EOL : Form_Request_Code renames F_Clear_EOL;
257 REQ_CLR_EOF : Form_Request_Code renames F_Clear_EOF;
258 REQ_CLR_FIELD : Form_Request_Code renames F_Clear_Field;
259 REQ_OVL_MODE : Form_Request_Code renames F_Overlay_Mode;
260 REQ_INS_MODE : Form_Request_Code renames F_Insert_Mode;
262 REQ_SCR_FLINE : Form_Request_Code renames F_ScrollForward_Line;
263 REQ_SCR_BLINE : Form_Request_Code renames F_ScrollBackward_Line;
264 REQ_SCR_FPAGE : Form_Request_Code renames F_ScrollForward_Page;
265 REQ_SCR_BPAGE : Form_Request_Code renames F_ScrollBackward_Page;
266 REQ_SCR_FHPAGE : Form_Request_Code renames F_ScrollForward_HalfPage;
267 REQ_SCR_BHPAGE : Form_Request_Code renames F_ScrollBackward_HalfPage;
269 REQ_SCR_FCHAR : Form_Request_Code renames F_HScrollForward_Char;
270 REQ_SCR_BCHAR : Form_Request_Code renames F_HScrollBackward_Char;
271 REQ_SCR_HFLINE : Form_Request_Code renames F_HScrollForward_Line;
272 REQ_SCR_HBLINE : Form_Request_Code renames F_HScrollBackward_Line;
273 REQ_SCR_HFHALF : Form_Request_Code renames F_HScrollForward_HalfLine;
274 REQ_SCR_HBHALF : Form_Request_Code renames F_HScrollBackward_HalfLine;
276 REQ_VALIDATION : Form_Request_Code renames F_Validate_Field;
277 REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice;
278 REQ_PREV_CHOICE : Form_Request_Code renames F_Previous_Choice;
280 procedure Request_Name (Key : Form_Request_Code;
283 function Request_Name (Key : Form_Request_Code) return String;
285 pragma Inline (Request_Name);
290 Form_Exception : exception;
292 -- MANPAGE(`form_field_new.3x')
294 -- ANCHOR(`new_field()',`Create')
295 function Create (Height : Line_Count;
296 Width : Column_Count;
298 Left : Column_Position;
299 Off_Screen : Natural := 0;
300 More_Buffers : Buffer_Number := Buffer_Number'First)
303 -- An overloaded Create is defined later. Pragma Inline appears there.
305 -- ANCHOR(`new_field()',`New_Field')
306 function New_Field (Height : Line_Count;
307 Width : Column_Count;
309 Left : Column_Position;
310 Off_Screen : Natural := 0;
311 More_Buffers : Buffer_Number := Buffer_Number'First)
312 return Field renames Create;
314 pragma Inline (New_Field);
316 -- ANCHOR(`free_field()',`Delete')
317 procedure Delete (Fld : in out Field);
319 -- Reset Fld to Null_Field
320 -- An overloaded Delete is defined later. Pragma Inline appears there.
322 -- ANCHOR(`dup_field()',`Duplicate')
323 function Duplicate (Fld : Field;
325 Left : Column_Position) return Field;
327 pragma Inline (Duplicate);
329 -- ANCHOR(`link_field()',`Link')
330 function Link (Fld : Field;
332 Left : Column_Position) return Field;
334 pragma Inline (Link);
336 -- MANPAGE(`form_field_just.3x')
338 -- ANCHOR(`set_field_just()',`Set_Justification')
339 procedure Set_Justification (Fld : Field;
340 Just : Field_Justification := None);
342 pragma Inline (Set_Justification);
344 -- ANCHOR(`field_just()',`Get_Justification')
345 function Get_Justification (Fld : Field) return Field_Justification;
347 pragma Inline (Get_Justification);
349 -- MANPAGE(`form_field_buffer.3x')
351 -- ANCHOR(`set_field_buffer()',`Set_Buffer')
354 Buffer : Buffer_Number := Buffer_Number'First;
359 -- ANCHOR(`field_buffer()',`Get_Buffer')
362 Buffer : Buffer_Number := Buffer_Number'First;
368 Buffer : Buffer_Number := Buffer_Number'First) return String;
370 -- Same but as function
371 pragma Inline (Get_Buffer);
373 -- ANCHOR(`set_field_status()',`Set_Status')
374 procedure Set_Status (Fld : Field;
375 Status : Boolean := True);
377 pragma Inline (Set_Status);
379 -- ANCHOR(`field_status()',`Changed')
380 function Changed (Fld : Field) return Boolean;
382 pragma Inline (Changed);
384 -- ANCHOR(`set_field_max()',`Set_Maximum_Size')
385 procedure Set_Maximum_Size (Fld : Field;
388 pragma Inline (Set_Maximum_Size);
390 -- MANPAGE(`form_field_opts.3x')
392 -- ANCHOR(`set_field_opts()',`Set_Options')
393 procedure Set_Options (Fld : Field;
394 Options : Field_Option_Set);
396 -- An overloaded version is defined later. Pragma Inline appears there
398 -- ANCHOR(`field_opts_on()',`Switch_Options')
399 procedure Switch_Options (Fld : Field;
400 Options : Field_Option_Set;
401 On : Boolean := True);
403 -- ALIAS(`field_opts_off()')
404 -- An overloaded version is defined later. Pragma Inline appears there
406 -- ANCHOR(`field_opts()',`Get_Options')
407 procedure Get_Options (Fld : Field;
408 Options : out Field_Option_Set);
411 -- ANCHOR(`field_opts()',`Get_Options')
412 function Get_Options (Fld : Field := Null_Field)
413 return Field_Option_Set;
415 -- An overloaded version is defined later. Pragma Inline appears there
417 -- MANPAGE(`form_field_attributes.3x')
419 -- ANCHOR(`set_field_fore()',`Set_Foreground')
420 procedure Set_Foreground
422 Fore : Character_Attribute_Set := Normal_Video;
423 Color : Color_Pair := Color_Pair'First);
425 pragma Inline (Set_Foreground);
427 -- ANCHOR(`field_fore()',`Foreground')
428 procedure Foreground (Fld : Field;
429 Fore : out Character_Attribute_Set);
432 -- ANCHOR(`field_fore()',`Foreground')
433 procedure Foreground (Fld : Field;
434 Fore : out Character_Attribute_Set;
435 Color : out Color_Pair);
437 pragma Inline (Foreground);
439 -- ANCHOR(`set_field_back()',`Set_Background')
440 procedure Set_Background
442 Back : Character_Attribute_Set := Normal_Video;
443 Color : Color_Pair := Color_Pair'First);
445 pragma Inline (Set_Background);
447 -- ANCHOR(`field_back()',`Background')
448 procedure Background (Fld : Field;
449 Back : out Character_Attribute_Set);
452 -- ANCHOR(`field_back()',`Background')
453 procedure Background (Fld : Field;
454 Back : out Character_Attribute_Set;
455 Color : out Color_Pair);
457 pragma Inline (Background);
459 -- ANCHOR(`set_field_pad()',`Set_Pad_Character')
460 procedure Set_Pad_Character (Fld : Field;
461 Pad : Character := Space);
463 pragma Inline (Set_Pad_Character);
465 -- ANCHOR(`field_pad()',`Pad_Character')
466 procedure Pad_Character (Fld : Field;
467 Pad : out Character);
469 pragma Inline (Pad_Character);
471 -- MANPAGE(`form_field_info.3x')
473 -- ANCHOR(`field_info()',`Info')
474 procedure Info (Fld : Field;
475 Lines : out Line_Count;
476 Columns : out Column_Count;
477 First_Row : out Line_Position;
478 First_Column : out Column_Position;
479 Off_Screen : out Natural;
480 Additional_Buffers : out Buffer_Number);
482 pragma Inline (Info);
484 -- ANCHOR(`dynamic_field_info()',`Dynamic_Info')
485 procedure Dynamic_Info (Fld : Field;
486 Lines : out Line_Count;
487 Columns : out Column_Count;
490 pragma Inline (Dynamic_Info);
492 -- MANPAGE(`form_win.3x')
494 -- ANCHOR(`set_form_win()',`Set_Window')
495 procedure Set_Window (Frm : Form;
498 pragma Inline (Set_Window);
500 -- ANCHOR(`form_win()',`Get_Window')
501 function Get_Window (Frm : Form) return Window;
503 pragma Inline (Get_Window);
505 -- ANCHOR(`set_form_sub()',`Set_Sub_Window')
506 procedure Set_Sub_Window (Frm : Form;
509 pragma Inline (Set_Sub_Window);
511 -- ANCHOR(`form_sub()',`Get_Sub_Window')
512 function Get_Sub_Window (Frm : Form) return Window;
514 pragma Inline (Get_Sub_Window);
516 -- ANCHOR(`scale_form()',`Scale')
517 procedure Scale (Frm : Form;
518 Lines : out Line_Count;
519 Columns : out Column_Count);
521 pragma Inline (Scale);
523 -- MANPAGE(`form_hook.3x')
525 type Form_Hook_Function is access procedure (Frm : Form);
526 pragma Convention (C, Form_Hook_Function);
528 -- ANCHOR(`set_field_init()',`Set_Field_Init_Hook')
529 procedure Set_Field_Init_Hook (Frm : Form;
530 Proc : Form_Hook_Function);
532 pragma Inline (Set_Field_Init_Hook);
534 -- ANCHOR(`set_field_term()',`Set_Field_Term_Hook')
535 procedure Set_Field_Term_Hook (Frm : Form;
536 Proc : Form_Hook_Function);
538 pragma Inline (Set_Field_Term_Hook);
540 -- ANCHOR(`set_form_init()',`Set_Form_Init_Hook')
541 procedure Set_Form_Init_Hook (Frm : Form;
542 Proc : Form_Hook_Function);
544 pragma Inline (Set_Form_Init_Hook);
546 -- ANCHOR(`set_form_term()',`Set_Form_Term_Hook')
547 procedure Set_Form_Term_Hook (Frm : Form;
548 Proc : Form_Hook_Function);
550 pragma Inline (Set_Form_Term_Hook);
552 -- ANCHOR(`field_init()',`Get_Field_Init_Hook')
553 function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function;
555 pragma Import (C, Get_Field_Init_Hook, "field_init");
557 -- ANCHOR(`field_term()',`Get_Field_Term_Hook')
558 function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function;
560 pragma Import (C, Get_Field_Term_Hook, "field_term");
562 -- ANCHOR(`form_init()',`Get_Form_Init_Hook')
563 function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function;
565 pragma Import (C, Get_Form_Init_Hook, "form_init");
567 -- ANCHOR(`form_term()',`Get_Form_Term_Hook')
568 function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function;
570 pragma Import (C, Get_Form_Term_Hook, "form_term");
572 -- MANPAGE(`form_field.3x')
574 -- ANCHOR(`set_form_fields()',`Redefine')
575 procedure Redefine (Frm : Form;
576 Flds : Field_Array_Access);
578 pragma Inline (Redefine);
580 -- ANCHOR(`set_form_fields()',`Set_Fields')
581 procedure Set_Fields (Frm : Form;
582 Flds : Field_Array_Access) renames Redefine;
584 -- pragma Inline (Set_Fields);
586 -- ANCHOR(`form_fields()',`Fields')
587 function Fields (Frm : Form;
588 Index : Positive) return Field;
590 pragma Inline (Fields);
592 -- ANCHOR(`field_count()',`Field_Count')
593 function Field_Count (Frm : Form) return Natural;
595 pragma Inline (Field_Count);
597 -- ANCHOR(`move_field()',`Move')
598 procedure Move (Fld : Field;
599 Line : Line_Position;
600 Column : Column_Position);
602 pragma Inline (Move);
604 -- MANPAGE(`form_new.3x')
606 -- ANCHOR(`new_form()',`Create')
607 function Create (Fields : Field_Array_Access) return Form;
609 pragma Inline (Create);
611 -- ANCHOR(`new_form()',`New_Form')
612 function New_Form (Fields : Field_Array_Access) return Form
615 -- pragma Inline (New_Form);
617 -- ANCHOR(`free_form()',`Delete')
618 procedure Delete (Frm : in out Form);
620 -- Reset Frm to Null_Form
621 pragma Inline (Delete);
623 -- MANPAGE(`form_opts.3x')
625 -- ANCHOR(`set_form_opts()',`Set_Options')
626 procedure Set_Options (Frm : Form;
627 Options : Form_Option_Set);
629 pragma Inline (Set_Options);
631 -- ANCHOR(`form_opts_on()',`Switch_Options')
632 procedure Switch_Options (Frm : Form;
633 Options : Form_Option_Set;
634 On : Boolean := True);
636 -- ALIAS(`form_opts_off()')
637 pragma Inline (Switch_Options);
639 -- ANCHOR(`form_opts()',`Get_Options')
640 procedure Get_Options (Frm : Form;
641 Options : out Form_Option_Set);
644 -- ANCHOR(`form_opts()',`Get_Options')
645 function Get_Options (Frm : Form := Null_Form) return Form_Option_Set;
647 pragma Inline (Get_Options);
649 -- MANPAGE(`form_post.3x')
651 -- ANCHOR(`post_form()',`Post')
652 procedure Post (Frm : Form;
653 Post : Boolean := True);
655 -- ALIAS(`unpost_form()')
656 pragma Inline (Post);
658 -- MANPAGE(`form_cursor.3x')
660 -- ANCHOR(`pos_form_cursor()',`Position_Cursor')
661 procedure Position_Cursor (Frm : Form);
663 pragma Inline (Position_Cursor);
665 -- MANPAGE(`form_data.3x')
667 -- ANCHOR(`data_ahead()',`Data_Ahead')
668 function Data_Ahead (Frm : Form) return Boolean;
670 pragma Inline (Data_Ahead);
672 -- ANCHOR(`data_behind()',`Data_Behind')
673 function Data_Behind (Frm : Form) return Boolean;
675 pragma Inline (Data_Behind);
677 -- MANPAGE(`form_driver.3x')
679 type Driver_Result is (Form_Ok,
684 -- ANCHOR(`form_driver()',`Driver')
685 function Driver (Frm : Form;
686 Key : Key_Code) return Driver_Result;
688 -- Driver not inlined
690 -- MANPAGE(`form_page.3x')
692 type Page_Number is new Natural;
694 -- ANCHOR(`set_current_field()',`Set_Current')
695 procedure Set_Current (Frm : Form;
698 pragma Inline (Set_Current);
700 -- ANCHOR(`current_field()',`Current')
701 function Current (Frm : Form) return Field;
703 pragma Inline (Current);
705 -- ANCHOR(`set_form_page()',`Set_Page')
706 procedure Set_Page (Frm : Form;
707 Page : Page_Number := Page_Number'First);
709 pragma Inline (Set_Page);
711 -- ANCHOR(`form_page()',`Page')
712 function Page (Frm : Form) return Page_Number;
714 pragma Inline (Page);
716 -- ANCHOR(`field_index()',`Get_Index')
717 function Get_Index (Fld : Field) return Positive;
719 -- Please note that in this binding we start the numbering of fields
720 -- with 1. So this is number is one more than you get from the low
722 pragma Inline (Get_Index);
724 -- MANPAGE(`form_new_page.3x')
726 -- ANCHOR(`set_new_page()',`Set_New_Page')
727 procedure Set_New_Page (Fld : Field;
728 New_Page : Boolean := True);
730 pragma Inline (Set_New_Page);
732 -- ANCHOR(`new_page()',`Is_New_Page')
733 function Is_New_Page (Fld : Field) return Boolean;
735 pragma Inline (Is_New_Page);
737 -- MANPAGE(`form_requestname.3x')
738 -- Not Implemented: form_request_name, form_request_by_name
740 ------------------------------------------------------------------------------
742 type Field is new System.Storage_Elements.Integer_Address;
743 type Form is new System.Storage_Elements.Integer_Address;
745 Null_Field : constant Field := 0;
746 Null_Form : constant Form := 0;
748 end Terminal_Interface.Curses.Forms;