ncurses 5.3
[ncurses.git] / doc / html / ada / terminal_interface-curses-panels__adb.htm
1 <HTML><HEAD><TITLE>terminal_interface-curses-panels.adb</TITLE></HEAD>
2 <BODY>
3 <HR><DIV ALIGN="center"><H1> File : terminal_interface-curses-panels.adb </H1></DIV><HR>
4 <PRE>
5 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
6 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
7 <FONT COLOR=green><EM>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</EM></FONT>
8 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
9 <FONT COLOR=green><EM>--                      Terminal_Interface.Curses.Panels                    --</EM></FONT>
10 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
11 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
12 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
13 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
14 <FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
15 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
16 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
17 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
18 <FONT COLOR=green><EM>-- "Software"), to deal in the Software without restriction, including      --</EM></FONT>
19 <FONT COLOR=green><EM>-- without limitation the rights to use, copy, modify, merge, publish,      --</EM></FONT>
20 <FONT COLOR=green><EM>-- distribute, distribute with modifications, sublicense, and/or sell       --</EM></FONT>
21 <FONT COLOR=green><EM>-- copies of the Software, and to permit persons to whom the Software is    --</EM></FONT>
22 <FONT COLOR=green><EM>-- furnished to do so, subject to the following conditions:                 --</EM></FONT>
23 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
24 <FONT COLOR=green><EM>-- The above copyright notice and this permission notice shall be included  --</EM></FONT>
25 <FONT COLOR=green><EM>-- in all copies or substantial portions of the Software.                   --</EM></FONT>
26 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
27 <FONT COLOR=green><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</EM></FONT>
28 <FONT COLOR=green><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</EM></FONT>
29 <FONT COLOR=green><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</EM></FONT>
30 <FONT COLOR=green><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</EM></FONT>
31 <FONT COLOR=green><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</EM></FONT>
32 <FONT COLOR=green><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</EM></FONT>
33 <FONT COLOR=green><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</EM></FONT>
34 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
35 <FONT COLOR=green><EM>-- Except as contained in this notice, the name(s) of the above copyright   --</EM></FONT>
36 <FONT COLOR=green><EM>-- holders shall not be used in advertising or otherwise to promote the     --</EM></FONT>
37 <FONT COLOR=green><EM>-- sale, use or other dealings in this Software without prior written       --</EM></FONT>
38 <FONT COLOR=green><EM>-- authorization.                                                           --</EM></FONT>
39 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
40 <FONT COLOR=green><EM>--  Author:  <A HREF="http://www.familiepfeifer.de/juergen">J&uuml;rgen Pfeifer</A>, 1996</EM></FONT>
41 <FONT COLOR=green><EM>--  Contact: <A HREF="http://www.familiepfeifer.de/Contact.aspx?Lang=en">www.familiepfeifer.de/Contact.aspx?Lang=en</A></EM></FONT>
42 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
43 <FONT COLOR=green><EM>--  @Revision: 1.9 @</EM></FONT>
44 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
45 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
46 <b>with</b> <A HREF="terminal_interface__ads.htm#42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#51_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#51_35">Aux</A>;
47 <b>with</b> <A HREF="interfac__ads.htm#23_9">Interfaces</A>.C;
48
49 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#49_28">Curses</A>.<A HREF="terminal_interface-curses-panels__ads.htm#44_35">Panels</A><FONT COLOR=red><A NAME="45_40"></A></FONT> <b>is</b>
50
51    <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#23_9">Interfaces</A>.C.int;
52
53    <b>function</b> <A HREF="terminal_interface-curses-panels__ads.htm#67_13">Create</A><FONT COLOR=red><A NAME="49_13"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#67_21">Win</A> : <A HREF="terminal_interface-curses__ads.htm#57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>
54    <b>is</b>
55       <b>function</b> <FONT COLOR=red><A NAME="51_16">Newpanel</A></FONT> (<FONT COLOR=red><A NAME="51_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>;
56       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#51_16">Newpanel</A>, "new_panel");
57
58       <FONT COLOR=red><A NAME="54_7">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>;
59    <b>begin</b>
60       <A HREF="terminal_interface-curses-panels__adb.htm#54_7">Pan</A> := <A HREF="terminal_interface-curses-panels__adb.htm#51_16">Newpanel</A> (<A HREF="terminal_interface-curses-panels__ads.htm#67_21">Win</A>);
61       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#54_7">Pan</A> = <A HREF="terminal_interface-curses-panels__ads.htm#54_4">Null_Panel</A> <b>then</b>
62          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
63       <b>end</b> <b>if</b>;
64       <b>return</b> <A HREF="terminal_interface-curses-panels__adb.htm#54_7">Pan</A>;
65    <b>end</b> Create;
66
67    <b>procedure</b> <A HREF="terminal_interface-curses-panels__ads.htm#77_14">Bottom</A><FONT COLOR=red><A NAME="63_14"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#77_22">Pan</A> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>)
68    <b>is</b>
69       <b>function</b> <FONT COLOR=red><A NAME="65_16">Bottompanel</A></FONT> (<FONT COLOR=red><A NAME="65_29">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
70       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#65_16">Bottompanel</A>, "bottom_panel");
71    <b>begin</b>
72       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#65_16">Bottompanel</A> (<A HREF="terminal_interface-curses-panels__ads.htm#77_22">Pan</A>) = <A HREF="terminal_interface-curses-aux__ads.htm#73_4">Curses_Err</A> <b>then</b>
73          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
74       <b>end</b> <b>if</b>;
75    <b>end</b> Bottom;
76
77    <b>procedure</b> <A HREF="terminal_interface-curses-panels__ads.htm#82_14">Top</A><FONT COLOR=red><A NAME="73_14"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#82_19">Pan</A> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>)
78    <b>is</b>
79       <b>function</b> <FONT COLOR=red><A NAME="75_16">Toppanel</A></FONT> (<FONT COLOR=red><A NAME="75_26">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
80       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#75_16">Toppanel</A>, "top_panel");
81    <b>begin</b>
82       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#75_16">Toppanel</A> (<A HREF="terminal_interface-curses-panels__ads.htm#82_19">Pan</A>) = <A HREF="terminal_interface-curses-aux__ads.htm#73_4">Curses_Err</A> <b>then</b>
83          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
84       <b>end</b> <b>if</b>;
85    <b>end</b> Top;
86
87    <b>procedure</b> <A HREF="terminal_interface-curses-panels__ads.htm#87_14">Show</A><FONT COLOR=red><A NAME="83_14"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#87_20">Pan</A> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>)
88    <b>is</b>
89       <b>function</b> <FONT COLOR=red><A NAME="85_16">Showpanel</A></FONT> (<FONT COLOR=red><A NAME="85_27">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
90       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#85_16">Showpanel</A>, "show_panel");
91    <b>begin</b>
92       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#85_16">Showpanel</A> (<A HREF="terminal_interface-curses-panels__ads.htm#87_20">Pan</A>) = <A HREF="terminal_interface-curses-aux__ads.htm#73_4">Curses_Err</A> <b>then</b>
93          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
94       <b>end</b> <b>if</b>;
95    <b>end</b> Show;
96
97    <b>procedure</b> <A HREF="terminal_interface-curses-panels__ads.htm#97_14">Hide</A><FONT COLOR=red><A NAME="93_14"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#97_20">Pan</A> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>)
98    <b>is</b>
99       <b>function</b> <FONT COLOR=red><A NAME="95_16">Hidepanel</A></FONT> (<FONT COLOR=red><A NAME="95_27">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
100       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#95_16">Hidepanel</A>, "hide_panel");
101    <b>begin</b>
102       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#95_16">Hidepanel</A> (<A HREF="terminal_interface-curses-panels__ads.htm#97_20">Pan</A>) = <A HREF="terminal_interface-curses-aux__ads.htm#73_4">Curses_Err</A> <b>then</b>
103          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
104       <b>end</b> <b>if</b>;
105    <b>end</b> Hide;
106
107    <b>function</b> <A HREF="terminal_interface-curses-panels__ads.htm#102_13">Get_Window</A><FONT COLOR=red><A NAME="103_13"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#102_25">Pan</A> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#57_9">Window</A>
108    <b>is</b>
109       <b>function</b> <FONT COLOR=red><A NAME="105_16">Panel_Win</A></FONT> (<FONT COLOR=red><A NAME="105_27">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#57_9">Window</A>;
110       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#105_16">Panel_Win</A>, "panel_window");
111
112       <FONT COLOR=red><A NAME="108_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#57_9">Window</A> := <A HREF="terminal_interface-curses-panels__adb.htm#105_16">Panel_Win</A> (<A HREF="terminal_interface-curses-panels__ads.htm#102_25">Pan</A>);
113    <b>begin</b>
114       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#108_7">Win</A> = <A HREF="terminal_interface-curses__ads.htm#58_4">Null_Window</A> <b>then</b>
115          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
116       <b>end</b> <b>if</b>;
117       <b>return</b> <A HREF="terminal_interface-curses-panels__adb.htm#108_7">Win</A>;
118    <b>end</b> Get_Window;
119
120    <b>procedure</b> <A HREF="terminal_interface-curses-panels__ads.htm#111_14">Replace</A><FONT COLOR=red><A NAME="116_14"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#111_23">Pan</A> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>;
121                       <A HREF="terminal_interface-curses-panels__ads.htm#112_23">Win</A> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#57_9">Window</A>)
122    <b>is</b>
123       <b>function</b> <FONT COLOR=red><A NAME="119_16">Replace_Pan</A></FONT> (<FONT COLOR=red><A NAME="119_29">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>;
124                             <FONT COLOR=red><A NAME="120_29">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
125       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#119_16">Replace_Pan</A>, "replace_panel");
126    <b>begin</b>
127       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#119_16">Replace_Pan</A> (<A HREF="terminal_interface-curses-panels__ads.htm#111_23">Pan</A>, <A HREF="terminal_interface-curses-panels__ads.htm#112_23">Win</A>) = <A HREF="terminal_interface-curses-aux__ads.htm#73_4">Curses_Err</A> <b>then</b>
128          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
129       <b>end</b> <b>if</b>;
130    <b>end</b> Replace;
131
132    <b>procedure</b> <A HREF="terminal_interface-curses-panels__ads.htm#117_14">Move</A><FONT COLOR=red><A NAME="128_14"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#117_20">Pan</A>    : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>;
133                    <A HREF="terminal_interface-curses-panels__ads.htm#118_20">Line</A>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#60_9">Line_Position</A>;
134                    <A HREF="terminal_interface-curses-panels__ads.htm#119_20">Column</A> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#61_9">Column_Position</A>)
135    <b>is</b>
136       <b>function</b> <FONT COLOR=red><A NAME="132_16">Move</A></FONT> (<FONT COLOR=red><A NAME="132_22">Pan</A></FONT>    : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>;
137                      <FONT COLOR=red><A NAME="133_22">Line</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
138                      <FONT COLOR=red><A NAME="134_22">Column</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
139       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#132_16">Move</A>, "move_panel");
140    <b>begin</b>
141       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#132_16">Move</A> (<A HREF="terminal_interface-curses-panels__ads.htm#117_20">Pan</A>, <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A> (<A HREF="terminal_interface-curses-panels__ads.htm#118_20">Line</A>), <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A> (<A HREF="terminal_interface-curses-panels__ads.htm#119_20">Column</A>)) = <A HREF="terminal_interface-curses-aux__ads.htm#73_4">Curses_Err</A> <b>then</b>
142          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
143       <b>end</b> <b>if</b>;
144    <b>end</b> Move;
145
146    <b>function</b> <A HREF="terminal_interface-curses-panels__ads.htm#124_13">Is_Hidden</A><FONT COLOR=red><A NAME="142_13"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#124_24">Pan</A> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> Boolean
147    <b>is</b>
148       <b>function</b> <FONT COLOR=red><A NAME="144_16">Panel_Hidden</A></FONT> (<FONT COLOR=red><A NAME="144_30">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
149       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#144_16">Panel_Hidden</A>, "panel_hidden");
150    <b>begin</b>
151       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#144_16">Panel_Hidden</A> (<A HREF="terminal_interface-curses-panels__ads.htm#124_24">Pan</A>) = <A HREF="terminal_interface-curses-aux__ads.htm#76_4">Curses_False</A> <b>then</b>
152          <b>return</b> False;
153       <b>else</b>
154          <b>return</b> True;
155       <b>end</b> <b>if</b>;
156    <b>end</b> Is_Hidden;
157
158    <b>procedure</b> <A HREF="terminal_interface-curses-panels__ads.htm#139_14">Delete</A><FONT COLOR=red><A NAME="154_14"></A></FONT> (<A HREF="terminal_interface-curses-panels__ads.htm#139_22">Pan</A> : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>)
159    <b>is</b>
160       <b>function</b> <FONT COLOR=red><A NAME="156_16">Del_Panel</A></FONT> (<FONT COLOR=red><A NAME="156_27">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#56_12">C_Int</A>;
161       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-panels__adb.htm#156_16">Del_Panel</A>, "del_panel");
162    <b>begin</b>
163       <b>if</b> <A HREF="terminal_interface-curses-panels__adb.htm#156_16">Del_Panel</A> (<A HREF="terminal_interface-curses-panels__ads.htm#139_22">Pan</A>) = <A HREF="terminal_interface-curses-aux__ads.htm#73_4">Curses_Err</A> <b>then</b>
164          <b>raise</b> <A HREF="terminal_interface-curses-panels__ads.htm#60_4">Panel_Exception</A>;
165       <b>end</b> <b>if</b>;
166       <A HREF="terminal_interface-curses-panels__ads.htm#139_22">Pan</A> := <A HREF="terminal_interface-curses-panels__ads.htm#54_4">Null_Panel</A>;
167    <b>end</b> Delete;
168
169 <b>end</b> Terminal_Interface.Curses.Panels;
170 </PRE></BODY></HTML>