2 define(`HTMLNAME',`terminal_interface-curses-forms__ads.htm')dnl
4 ------------------------------------------------------------------------------
6 -- GNAT ncurses Binding --
8 -- Terminal_Interface.Curses.Form --
12 ------------------------------------------------------------------------------
13 -- Copyright 2020 Thomas E. Dickey --
14 -- Copyright 1998-2009,2014 Free Software Foundation, Inc. --
16 -- Permission is hereby granted, free of charge, to any person obtaining a --
17 -- copy of this software and associated documentation files (the --
18 -- "Software"), to deal in the Software without restriction, including --
19 -- without limitation the rights to use, copy, modify, merge, publish, --
20 -- distribute, distribute with modifications, sublicense, and/or sell --
21 -- copies of the Software, and to permit persons to whom the Software is --
22 -- furnished to do so, subject to the following conditions: --
24 -- The above copyright notice and this permission notice shall be included --
25 -- in all copies or substantial portions of the Software. --
27 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
28 -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
29 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
30 -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
31 -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
32 -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
33 -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
35 -- Except as contained in this notice, the name(s) of the above copyright --
36 -- holders shall not be used in advertising or otherwise to promote the --
37 -- sale, use or other dealings in this Software without prior written --
39 ------------------------------------------------------------------------------
40 -- Author: Juergen Pfeifer, 1996
43 -- $Date: 2020/02/02 23:34:34 $
44 -- Binding Version 01.00
45 ------------------------------------------------------------------------------
47 with Ada.Characters.Latin_1;
49 package Terminal_Interface.Curses.Forms is
50 pragma Preelaborate (Terminal_Interface.Curses.Forms);
51 pragma Linker_Options ("-lform" & Curses_Constants.DFT_ARG_SUFFIX);
53 Space : Character renames Ada.Characters.Latin_1.Space;
55 type Field is private;
58 Null_Field : constant Field;
59 Null_Form : constant Form;
61 type Field_Justification is (None,
66 type Field_Option_Set is
79 pragma Convention (C_Pass_By_Copy, Field_Option_Set);
81 for Field_Option_Set use
83 Visible at 0 range Curses_Constants.O_VISIBLE_First
84 .. Curses_Constants.O_VISIBLE_Last;
85 Active at 0 range Curses_Constants.O_ACTIVE_First
86 .. Curses_Constants.O_ACTIVE_Last;
87 Public at 0 range Curses_Constants.O_PUBLIC_First
88 .. Curses_Constants.O_PUBLIC_Last;
89 Edit at 0 range Curses_Constants.O_EDIT_First
90 .. Curses_Constants.O_EDIT_Last;
91 Wrap at 0 range Curses_Constants.O_WRAP_First
92 .. Curses_Constants.O_WRAP_Last;
93 Blank at 0 range Curses_Constants.O_BLANK_First
94 .. Curses_Constants.O_BLANK_Last;
95 Auto_Skip at 0 range Curses_Constants.O_AUTOSKIP_First
96 .. Curses_Constants.O_AUTOSKIP_Last;
97 Null_Ok at 0 range Curses_Constants.O_NULLOK_First
98 .. Curses_Constants.O_NULLOK_Last;
99 Pass_Ok at 0 range Curses_Constants.O_PASSOK_First
100 .. Curses_Constants.O_PASSOK_Last;
101 Static at 0 range Curses_Constants.O_STATIC_First
102 .. Curses_Constants.O_STATIC_Last;
104 pragma Warnings (Off);
105 for Field_Option_Set'Size use Curses_Constants.Field_Options_Size;
106 pragma Warnings (On);
108 function Default_Field_Options return Field_Option_Set;
109 -- The initial defaults for the field options.
110 pragma Inline (Default_Field_Options);
112 type Form_Option_Set is
114 NL_Overload : Boolean;
115 BS_Overload : Boolean;
117 pragma Convention (C_Pass_By_Copy, Form_Option_Set);
119 for Form_Option_Set use
121 NL_Overload at 0 range Curses_Constants.O_NL_OVERLOAD_First
122 .. Curses_Constants.O_NL_OVERLOAD_Last;
123 BS_Overload at 0 range Curses_Constants.O_BS_OVERLOAD_First
124 .. Curses_Constants.O_BS_OVERLOAD_Last;
126 pragma Warnings (Off);
127 for Form_Option_Set'Size use Curses_Constants.Field_Options_Size;
128 pragma Warnings (On);
130 function Default_Form_Options return Form_Option_Set;
131 -- The initial defaults for the form options.
132 pragma Inline (Default_Form_Options);
134 type Buffer_Number is new Natural;
136 type Field_Array is array (Positive range <>) of aliased Field;
137 pragma Convention (C, Field_Array);
139 type Field_Array_Access is access Field_Array;
141 procedure Free (FA : in out Field_Array_Access;
142 Free_Fields : Boolean := False);
143 -- Release the memory for an allocated field array
144 -- If Free_Fields is True, call Delete() for all the fields in
147 subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57);
149 -- The prefix F_ stands for "Form Request"
150 F_Next_Page : constant Form_Request_Code := Key_Max + 1;
151 F_Previous_Page : constant Form_Request_Code := Key_Max + 2;
152 F_First_Page : constant Form_Request_Code := Key_Max + 3;
153 F_Last_Page : constant Form_Request_Code := Key_Max + 4;
155 F_Next_Field : constant Form_Request_Code := Key_Max + 5;
156 F_Previous_Field : constant Form_Request_Code := Key_Max + 6;
157 F_First_Field : constant Form_Request_Code := Key_Max + 7;
158 F_Last_Field : constant Form_Request_Code := Key_Max + 8;
159 F_Sorted_Next_Field : constant Form_Request_Code := Key_Max + 9;
160 F_Sorted_Previous_Field : constant Form_Request_Code := Key_Max + 10;
161 F_Sorted_First_Field : constant Form_Request_Code := Key_Max + 11;
162 F_Sorted_Last_Field : constant Form_Request_Code := Key_Max + 12;
163 F_Left_Field : constant Form_Request_Code := Key_Max + 13;
164 F_Right_Field : constant Form_Request_Code := Key_Max + 14;
165 F_Up_Field : constant Form_Request_Code := Key_Max + 15;
166 F_Down_Field : constant Form_Request_Code := Key_Max + 16;
168 F_Next_Char : constant Form_Request_Code := Key_Max + 17;
169 F_Previous_Char : constant Form_Request_Code := Key_Max + 18;
170 F_Next_Line : constant Form_Request_Code := Key_Max + 19;
171 F_Previous_Line : constant Form_Request_Code := Key_Max + 20;
172 F_Next_Word : constant Form_Request_Code := Key_Max + 21;
173 F_Previous_Word : constant Form_Request_Code := Key_Max + 22;
174 F_Begin_Field : constant Form_Request_Code := Key_Max + 23;
175 F_End_Field : constant Form_Request_Code := Key_Max + 24;
176 F_Begin_Line : constant Form_Request_Code := Key_Max + 25;
177 F_End_Line : constant Form_Request_Code := Key_Max + 26;
178 F_Left_Char : constant Form_Request_Code := Key_Max + 27;
179 F_Right_Char : constant Form_Request_Code := Key_Max + 28;
180 F_Up_Char : constant Form_Request_Code := Key_Max + 29;
181 F_Down_Char : constant Form_Request_Code := Key_Max + 30;
183 F_New_Line : constant Form_Request_Code := Key_Max + 31;
184 F_Insert_Char : constant Form_Request_Code := Key_Max + 32;
185 F_Insert_Line : constant Form_Request_Code := Key_Max + 33;
186 F_Delete_Char : constant Form_Request_Code := Key_Max + 34;
187 F_Delete_Previous : constant Form_Request_Code := Key_Max + 35;
188 F_Delete_Line : constant Form_Request_Code := Key_Max + 36;
189 F_Delete_Word : constant Form_Request_Code := Key_Max + 37;
190 F_Clear_EOL : constant Form_Request_Code := Key_Max + 38;
191 F_Clear_EOF : constant Form_Request_Code := Key_Max + 39;
192 F_Clear_Field : constant Form_Request_Code := Key_Max + 40;
193 F_Overlay_Mode : constant Form_Request_Code := Key_Max + 41;
194 F_Insert_Mode : constant Form_Request_Code := Key_Max + 42;
196 -- Vertical Scrolling
197 F_ScrollForward_Line : constant Form_Request_Code := Key_Max + 43;
198 F_ScrollBackward_Line : constant Form_Request_Code := Key_Max + 44;
199 F_ScrollForward_Page : constant Form_Request_Code := Key_Max + 45;
200 F_ScrollBackward_Page : constant Form_Request_Code := Key_Max + 46;
201 F_ScrollForward_HalfPage : constant Form_Request_Code := Key_Max + 47;
202 F_ScrollBackward_HalfPage : constant Form_Request_Code := Key_Max + 48;
204 -- Horizontal Scrolling
205 F_HScrollForward_Char : constant Form_Request_Code := Key_Max + 49;
206 F_HScrollBackward_Char : constant Form_Request_Code := Key_Max + 50;
207 F_HScrollForward_Line : constant Form_Request_Code := Key_Max + 51;
208 F_HScrollBackward_Line : constant Form_Request_Code := Key_Max + 52;
209 F_HScrollForward_HalfLine : constant Form_Request_Code := Key_Max + 53;
210 F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54;
212 F_Validate_Field : constant Form_Request_Code := Key_Max + 55;
213 F_Next_Choice : constant Form_Request_Code := Key_Max + 56;
214 F_Previous_Choice : constant Form_Request_Code := Key_Max + 57;
216 -- For those who like the old 'C' style request names
217 REQ_NEXT_PAGE : Form_Request_Code renames F_Next_Page;
218 REQ_PREV_PAGE : Form_Request_Code renames F_Previous_Page;
219 REQ_FIRST_PAGE : Form_Request_Code renames F_First_Page;
220 REQ_LAST_PAGE : Form_Request_Code renames F_Last_Page;
222 REQ_NEXT_FIELD : Form_Request_Code renames F_Next_Field;
223 REQ_PREV_FIELD : Form_Request_Code renames F_Previous_Field;
224 REQ_FIRST_FIELD : Form_Request_Code renames F_First_Field;
225 REQ_LAST_FIELD : Form_Request_Code renames F_Last_Field;
226 REQ_SNEXT_FIELD : Form_Request_Code renames F_Sorted_Next_Field;
227 REQ_SPREV_FIELD : Form_Request_Code renames F_Sorted_Previous_Field;
228 REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field;
229 REQ_SLAST_FIELD : Form_Request_Code renames F_Sorted_Last_Field;
230 REQ_LEFT_FIELD : Form_Request_Code renames F_Left_Field;
231 REQ_RIGHT_FIELD : Form_Request_Code renames F_Right_Field;
232 REQ_UP_FIELD : Form_Request_Code renames F_Up_Field;
233 REQ_DOWN_FIELD : Form_Request_Code renames F_Down_Field;
235 REQ_NEXT_CHAR : Form_Request_Code renames F_Next_Char;
236 REQ_PREV_CHAR : Form_Request_Code renames F_Previous_Char;
237 REQ_NEXT_LINE : Form_Request_Code renames F_Next_Line;
238 REQ_PREV_LINE : Form_Request_Code renames F_Previous_Line;
239 REQ_NEXT_WORD : Form_Request_Code renames F_Next_Word;
240 REQ_PREV_WORD : Form_Request_Code renames F_Previous_Word;
241 REQ_BEG_FIELD : Form_Request_Code renames F_Begin_Field;
242 REQ_END_FIELD : Form_Request_Code renames F_End_Field;
243 REQ_BEG_LINE : Form_Request_Code renames F_Begin_Line;
244 REQ_END_LINE : Form_Request_Code renames F_End_Line;
245 REQ_LEFT_CHAR : Form_Request_Code renames F_Left_Char;
246 REQ_RIGHT_CHAR : Form_Request_Code renames F_Right_Char;
247 REQ_UP_CHAR : Form_Request_Code renames F_Up_Char;
248 REQ_DOWN_CHAR : Form_Request_Code renames F_Down_Char;
250 REQ_NEW_LINE : Form_Request_Code renames F_New_Line;
251 REQ_INS_CHAR : Form_Request_Code renames F_Insert_Char;
252 REQ_INS_LINE : Form_Request_Code renames F_Insert_Line;
253 REQ_DEL_CHAR : Form_Request_Code renames F_Delete_Char;
254 REQ_DEL_PREV : Form_Request_Code renames F_Delete_Previous;
255 REQ_DEL_LINE : Form_Request_Code renames F_Delete_Line;
256 REQ_DEL_WORD : Form_Request_Code renames F_Delete_Word;
257 REQ_CLR_EOL : Form_Request_Code renames F_Clear_EOL;
258 REQ_CLR_EOF : Form_Request_Code renames F_Clear_EOF;
259 REQ_CLR_FIELD : Form_Request_Code renames F_Clear_Field;
260 REQ_OVL_MODE : Form_Request_Code renames F_Overlay_Mode;
261 REQ_INS_MODE : Form_Request_Code renames F_Insert_Mode;
263 REQ_SCR_FLINE : Form_Request_Code renames F_ScrollForward_Line;
264 REQ_SCR_BLINE : Form_Request_Code renames F_ScrollBackward_Line;
265 REQ_SCR_FPAGE : Form_Request_Code renames F_ScrollForward_Page;
266 REQ_SCR_BPAGE : Form_Request_Code renames F_ScrollBackward_Page;
267 REQ_SCR_FHPAGE : Form_Request_Code renames F_ScrollForward_HalfPage;
268 REQ_SCR_BHPAGE : Form_Request_Code renames F_ScrollBackward_HalfPage;
270 REQ_SCR_FCHAR : Form_Request_Code renames F_HScrollForward_Char;
271 REQ_SCR_BCHAR : Form_Request_Code renames F_HScrollBackward_Char;
272 REQ_SCR_HFLINE : Form_Request_Code renames F_HScrollForward_Line;
273 REQ_SCR_HBLINE : Form_Request_Code renames F_HScrollBackward_Line;
274 REQ_SCR_HFHALF : Form_Request_Code renames F_HScrollForward_HalfLine;
275 REQ_SCR_HBHALF : Form_Request_Code renames F_HScrollBackward_HalfLine;
277 REQ_VALIDATION : Form_Request_Code renames F_Validate_Field;
278 REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice;
279 REQ_PREV_CHOICE : Form_Request_Code renames F_Previous_Choice;
281 procedure Request_Name (Key : Form_Request_Code;
284 function Request_Name (Key : Form_Request_Code) return String;
286 pragma Inline (Request_Name);
291 Form_Exception : exception;
293 -- MANPAGE(`form_field_new.3x')
295 -- ANCHOR(`new_field()',`Create')
296 function Create (Height : Line_Count;
297 Width : Column_Count;
299 Left : Column_Position;
300 Off_Screen : Natural := 0;
301 More_Buffers : Buffer_Number := Buffer_Number'First)
304 -- An overloaded Create is defined later. Pragma Inline appears there.
306 -- ANCHOR(`new_field()',`New_Field')
307 function New_Field (Height : Line_Count;
308 Width : Column_Count;
310 Left : Column_Position;
311 Off_Screen : Natural := 0;
312 More_Buffers : Buffer_Number := Buffer_Number'First)
313 return Field renames Create;
315 pragma Inline (New_Field);
317 -- ANCHOR(`free_field()',`Delete')
318 procedure Delete (Fld : in out Field);
320 -- Reset Fld to Null_Field
321 -- An overloaded Delete is defined later. Pragma Inline appears there.
323 -- ANCHOR(`dup_field()',`Duplicate')
324 function Duplicate (Fld : Field;
326 Left : Column_Position) return Field;
328 pragma Inline (Duplicate);
330 -- ANCHOR(`link_field()',`Link')
331 function Link (Fld : Field;
333 Left : Column_Position) return Field;
335 pragma Inline (Link);
337 -- MANPAGE(`form_field_just.3x')
339 -- ANCHOR(`set_field_just()',`Set_Justification')
340 procedure Set_Justification (Fld : Field;
341 Just : Field_Justification := None);
343 pragma Inline (Set_Justification);
345 -- ANCHOR(`field_just()',`Get_Justification')
346 function Get_Justification (Fld : Field) return Field_Justification;
348 pragma Inline (Get_Justification);
350 -- MANPAGE(`form_field_buffer.3x')
352 -- ANCHOR(`set_field_buffer()',`Set_Buffer')
355 Buffer : Buffer_Number := Buffer_Number'First;
360 -- ANCHOR(`field_buffer()',`Get_Buffer')
363 Buffer : Buffer_Number := Buffer_Number'First;
369 Buffer : Buffer_Number := Buffer_Number'First) return String;
371 -- Same but as function
372 pragma Inline (Get_Buffer);
374 -- ANCHOR(`set_field_status()',`Set_Status')
375 procedure Set_Status (Fld : Field;
376 Status : Boolean := True);
378 pragma Inline (Set_Status);
380 -- ANCHOR(`field_status()',`Changed')
381 function Changed (Fld : Field) return Boolean;
383 pragma Inline (Changed);
385 -- ANCHOR(`set_field_max()',`Set_Maximum_Size')
386 procedure Set_Maximum_Size (Fld : Field;
389 pragma Inline (Set_Maximum_Size);
391 -- MANPAGE(`form_field_opts.3x')
393 -- ANCHOR(`set_field_opts()',`Set_Options')
394 procedure Set_Options (Fld : Field;
395 Options : Field_Option_Set);
397 -- An overloaded version is defined later. Pragma Inline appears there
399 -- ANCHOR(`field_opts_on()',`Switch_Options')
400 procedure Switch_Options (Fld : Field;
401 Options : Field_Option_Set;
402 On : Boolean := True);
404 -- ALIAS(`field_opts_off()')
405 -- An overloaded version is defined later. Pragma Inline appears there
407 -- ANCHOR(`field_opts()',`Get_Options')
408 procedure Get_Options (Fld : Field;
409 Options : out Field_Option_Set);
412 -- ANCHOR(`field_opts()',`Get_Options')
413 function Get_Options (Fld : Field := Null_Field)
414 return Field_Option_Set;
416 -- An overloaded version is defined later. Pragma Inline appears there
418 -- MANPAGE(`form_field_attributes.3x')
420 -- ANCHOR(`set_field_fore()',`Set_Foreground')
421 procedure Set_Foreground
423 Fore : Character_Attribute_Set := Normal_Video;
424 Color : Color_Pair := Color_Pair'First);
426 pragma Inline (Set_Foreground);
428 -- ANCHOR(`field_fore()',`Foreground')
429 procedure Foreground (Fld : Field;
430 Fore : out Character_Attribute_Set);
433 -- ANCHOR(`field_fore()',`Foreground')
434 procedure Foreground (Fld : Field;
435 Fore : out Character_Attribute_Set;
436 Color : out Color_Pair);
438 pragma Inline (Foreground);
440 -- ANCHOR(`set_field_back()',`Set_Background')
441 procedure Set_Background
443 Back : Character_Attribute_Set := Normal_Video;
444 Color : Color_Pair := Color_Pair'First);
446 pragma Inline (Set_Background);
448 -- ANCHOR(`field_back()',`Background')
449 procedure Background (Fld : Field;
450 Back : out Character_Attribute_Set);
453 -- ANCHOR(`field_back()',`Background')
454 procedure Background (Fld : Field;
455 Back : out Character_Attribute_Set;
456 Color : out Color_Pair);
458 pragma Inline (Background);
460 -- ANCHOR(`set_field_pad()',`Set_Pad_Character')
461 procedure Set_Pad_Character (Fld : Field;
462 Pad : Character := Space);
464 pragma Inline (Set_Pad_Character);
466 -- ANCHOR(`field_pad()',`Pad_Character')
467 procedure Pad_Character (Fld : Field;
468 Pad : out Character);
470 pragma Inline (Pad_Character);
472 -- MANPAGE(`form_field_info.3x')
474 -- ANCHOR(`field_info()',`Info')
475 procedure Info (Fld : Field;
476 Lines : out Line_Count;
477 Columns : out Column_Count;
478 First_Row : out Line_Position;
479 First_Column : out Column_Position;
480 Off_Screen : out Natural;
481 Additional_Buffers : out Buffer_Number);
483 pragma Inline (Info);
485 -- ANCHOR(`dynamic_field_info()',`Dynamic_Info')
486 procedure Dynamic_Info (Fld : Field;
487 Lines : out Line_Count;
488 Columns : out Column_Count;
491 pragma Inline (Dynamic_Info);
493 -- MANPAGE(`form_win.3x')
495 -- ANCHOR(`set_form_win()',`Set_Window')
496 procedure Set_Window (Frm : Form;
499 pragma Inline (Set_Window);
501 -- ANCHOR(`form_win()',`Get_Window')
502 function Get_Window (Frm : Form) return Window;
504 pragma Inline (Get_Window);
506 -- ANCHOR(`set_form_sub()',`Set_Sub_Window')
507 procedure Set_Sub_Window (Frm : Form;
510 pragma Inline (Set_Sub_Window);
512 -- ANCHOR(`form_sub()',`Get_Sub_Window')
513 function Get_Sub_Window (Frm : Form) return Window;
515 pragma Inline (Get_Sub_Window);
517 -- ANCHOR(`scale_form()',`Scale')
518 procedure Scale (Frm : Form;
519 Lines : out Line_Count;
520 Columns : out Column_Count);
522 pragma Inline (Scale);
524 -- MANPAGE(`form_hook.3x')
526 type Form_Hook_Function is access procedure (Frm : Form);
527 pragma Convention (C, Form_Hook_Function);
529 -- ANCHOR(`set_field_init()',`Set_Field_Init_Hook')
530 procedure Set_Field_Init_Hook (Frm : Form;
531 Proc : Form_Hook_Function);
533 pragma Inline (Set_Field_Init_Hook);
535 -- ANCHOR(`set_field_term()',`Set_Field_Term_Hook')
536 procedure Set_Field_Term_Hook (Frm : Form;
537 Proc : Form_Hook_Function);
539 pragma Inline (Set_Field_Term_Hook);
541 -- ANCHOR(`set_form_init()',`Set_Form_Init_Hook')
542 procedure Set_Form_Init_Hook (Frm : Form;
543 Proc : Form_Hook_Function);
545 pragma Inline (Set_Form_Init_Hook);
547 -- ANCHOR(`set_form_term()',`Set_Form_Term_Hook')
548 procedure Set_Form_Term_Hook (Frm : Form;
549 Proc : Form_Hook_Function);
551 pragma Inline (Set_Form_Term_Hook);
553 -- ANCHOR(`field_init()',`Get_Field_Init_Hook')
554 function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function;
556 pragma Import (C, Get_Field_Init_Hook, "field_init");
558 -- ANCHOR(`field_term()',`Get_Field_Term_Hook')
559 function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function;
561 pragma Import (C, Get_Field_Term_Hook, "field_term");
563 -- ANCHOR(`form_init()',`Get_Form_Init_Hook')
564 function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function;
566 pragma Import (C, Get_Form_Init_Hook, "form_init");
568 -- ANCHOR(`form_term()',`Get_Form_Term_Hook')
569 function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function;
571 pragma Import (C, Get_Form_Term_Hook, "form_term");
573 -- MANPAGE(`form_field.3x')
575 -- ANCHOR(`set_form_fields()',`Redefine')
576 procedure Redefine (Frm : Form;
577 Flds : Field_Array_Access);
579 pragma Inline (Redefine);
581 -- ANCHOR(`set_form_fields()',`Set_Fields')
582 procedure Set_Fields (Frm : Form;
583 Flds : Field_Array_Access) renames Redefine;
585 -- pragma Inline (Set_Fields);
587 -- ANCHOR(`form_fields()',`Fields')
588 function Fields (Frm : Form;
589 Index : Positive) return Field;
591 pragma Inline (Fields);
593 -- ANCHOR(`field_count()',`Field_Count')
594 function Field_Count (Frm : Form) return Natural;
596 pragma Inline (Field_Count);
598 -- ANCHOR(`move_field()',`Move')
599 procedure Move (Fld : Field;
600 Line : Line_Position;
601 Column : Column_Position);
603 pragma Inline (Move);
605 -- MANPAGE(`form_new.3x')
607 -- ANCHOR(`new_form()',`Create')
608 function Create (Fields : Field_Array_Access) return Form;
610 pragma Inline (Create);
612 -- ANCHOR(`new_form()',`New_Form')
613 function New_Form (Fields : Field_Array_Access) return Form
616 -- pragma Inline (New_Form);
618 -- ANCHOR(`free_form()',`Delete')
619 procedure Delete (Frm : in out Form);
621 -- Reset Frm to Null_Form
622 pragma Inline (Delete);
624 -- MANPAGE(`form_opts.3x')
626 -- ANCHOR(`set_form_opts()',`Set_Options')
627 procedure Set_Options (Frm : Form;
628 Options : Form_Option_Set);
630 pragma Inline (Set_Options);
632 -- ANCHOR(`form_opts_on()',`Switch_Options')
633 procedure Switch_Options (Frm : Form;
634 Options : Form_Option_Set;
635 On : Boolean := True);
637 -- ALIAS(`form_opts_off()')
638 pragma Inline (Switch_Options);
640 -- ANCHOR(`form_opts()',`Get_Options')
641 procedure Get_Options (Frm : Form;
642 Options : out Form_Option_Set);
645 -- ANCHOR(`form_opts()',`Get_Options')
646 function Get_Options (Frm : Form := Null_Form) return Form_Option_Set;
648 pragma Inline (Get_Options);
650 -- MANPAGE(`form_post.3x')
652 -- ANCHOR(`post_form()',`Post')
653 procedure Post (Frm : Form;
654 Post : Boolean := True);
656 -- ALIAS(`unpost_form()')
657 pragma Inline (Post);
659 -- MANPAGE(`form_cursor.3x')
661 -- ANCHOR(`pos_form_cursor()',`Position_Cursor')
662 procedure Position_Cursor (Frm : Form);
664 pragma Inline (Position_Cursor);
666 -- MANPAGE(`form_data.3x')
668 -- ANCHOR(`data_ahead()',`Data_Ahead')
669 function Data_Ahead (Frm : Form) return Boolean;
671 pragma Inline (Data_Ahead);
673 -- ANCHOR(`data_behind()',`Data_Behind')
674 function Data_Behind (Frm : Form) return Boolean;
676 pragma Inline (Data_Behind);
678 -- MANPAGE(`form_driver.3x')
680 type Driver_Result is (Form_Ok,
685 -- ANCHOR(`form_driver()',`Driver')
686 function Driver (Frm : Form;
687 Key : Key_Code) return Driver_Result;
689 -- Driver not inlined
691 -- MANPAGE(`form_page.3x')
693 type Page_Number is new Natural;
695 -- ANCHOR(`set_current_field()',`Set_Current')
696 procedure Set_Current (Frm : Form;
699 pragma Inline (Set_Current);
701 -- ANCHOR(`current_field()',`Current')
702 function Current (Frm : Form) return Field;
704 pragma Inline (Current);
706 -- ANCHOR(`set_form_page()',`Set_Page')
707 procedure Set_Page (Frm : Form;
708 Page : Page_Number := Page_Number'First);
710 pragma Inline (Set_Page);
712 -- ANCHOR(`form_page()',`Page')
713 function Page (Frm : Form) return Page_Number;
715 pragma Inline (Page);
717 -- ANCHOR(`field_index()',`Get_Index')
718 function Get_Index (Fld : Field) return Positive;
720 -- Please note that in this binding we start the numbering of fields
721 -- with 1. So this is number is one more than you get from the low
723 pragma Inline (Get_Index);
725 -- MANPAGE(`form_new_page.3x')
727 -- ANCHOR(`set_new_page()',`Set_New_Page')
728 procedure Set_New_Page (Fld : Field;
729 New_Page : Boolean := True);
731 pragma Inline (Set_New_Page);
733 -- ANCHOR(`new_page()',`Is_New_Page')
734 function Is_New_Page (Fld : Field) return Boolean;
736 pragma Inline (Is_New_Page);
738 -- MANPAGE(`form_requestname.3x')
739 -- Not Implemented: form_request_name, form_request_by_name
741 ------------------------------------------------------------------------------
743 type Field is new System.Storage_Elements.Integer_Address;
744 type Form is new System.Storage_Elements.Integer_Address;
746 Null_Field : constant Field := 0;
747 Null_Form : constant Form := 0;
749 end Terminal_Interface.Curses.Forms;