aboutsummaryrefslogtreecommitdiff
path: root/Ada95/samples
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2011-04-30 10:59:17 +0000
committerEd Schouten <ed@FreeBSD.org>2011-04-30 10:59:17 +0000
commite07762606a5bf651a501cb095c98cba90e4a8fe2 (patch)
treecfae23e686b177255a6fb3304d166f1ce5cd7ca1 /Ada95/samples
parent0294a182a1629b1d854b84906e73487d6cb75fba (diff)
downloadsrc-e07762606a5bf651a501cb095c98cba90e4a8fe2.tar.gz
src-e07762606a5bf651a501cb095c98cba90e4a8fe2.zip
Import ncurses 5.9.vendor/ncurses/5.9-20110405
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=221245 svn path=/vendor/ncurses/5.9-20110405/; revision=221246; tag=vendor/ncurses/5.9-20110405
Diffstat (limited to 'Ada95/samples')
-rw-r--r--Ada95/samples/Makefile.in42
-rw-r--r--Ada95/samples/explain.txt30
-rw-r--r--Ada95/samples/ncurses2-acs_and_scroll.adb128
-rw-r--r--Ada95/samples/ncurses2-demo_forms.adb32
-rw-r--r--Ada95/samples/ncurses2-demo_pad.adb10
-rw-r--r--Ada95/samples/ncurses2-demo_panels.adb8
-rw-r--r--Ada95/samples/ncurses2-getopt.adb10
-rw-r--r--Ada95/samples/ncurses2-menu_test.adb16
-rw-r--r--Ada95/samples/ncurses2-overlap_test.adb8
-rw-r--r--Ada95/samples/ncurses2-slk_test.adb8
-rw-r--r--Ada95/samples/ncurses2-trace_set.adb14
-rw-r--r--Ada95/samples/sample-curses_demo.adb12
-rw-r--r--Ada95/samples/sample-explanation.adb78
-rw-r--r--Ada95/samples/sample-form_demo-aux.ads6
-rw-r--r--Ada95/samples/sample-form_demo.adb16
-rw-r--r--Ada95/samples/sample-function_key_setting.adb30
-rw-r--r--Ada95/samples/sample-function_key_setting.ads6
-rw-r--r--Ada95/samples/sample-header_handler.adb10
-rw-r--r--Ada95/samples/sample-helpers.adb8
-rw-r--r--Ada95/samples/sample-helpers.ads6
-rw-r--r--Ada95/samples/sample-keyboard_handler.adb14
-rw-r--r--Ada95/samples/sample-menu_demo-aux.ads6
-rw-r--r--Ada95/samples/sample-menu_demo.adb14
-rw-r--r--Ada95/samples/sample-text_io_demo.adb24
-rw-r--r--Ada95/samples/sample.adb10
25 files changed, 303 insertions, 243 deletions
diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in
index 3d1554c72111..aa839ffbaf68 100644
--- a/Ada95/samples/Makefile.in
+++ b/Ada95/samples/Makefile.in
@@ -1,5 +1,5 @@
##############################################################################
-# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@@ -28,7 +28,7 @@
#
# Author: Juergen Pfeifer, 1996
#
-# $Id: Makefile.in,v 1.40 2010/11/27 21:45:27 tom Exp $
+# $Id: Makefile.in,v 1.46 2011/03/28 23:45:08 tom Exp $
#
.SUFFIXES:
@@ -41,6 +41,8 @@ x = @PROG_EXT@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
+bindir = @bindir@
+datadir = @datadir@
libdir = @libdir@
includedir = @includedir@
@@ -74,6 +76,13 @@ LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
RANLIB = @RANLIB@
################################################################################
+BINDIR = $(DESTDIR)$(bindir)
+DATADIR = $(DESTDIR)$(datadir)
+LIBDIR = $(DESTDIR)$(libdir)
+
+MY_DATADIR = $(DATADIR)/AdaCurses
+
+################################################################################
ada_srcdir=../src
LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS)
@@ -88,11 +97,11 @@ ALIB = @cf_ada_package@
ABASE = $(ALIB)-curses
CARGS =-cargs $(ADAFLAGS)
-LARGS =-largs @TEST_ARG2@ $(LD_FLAGS) -L../lib -lAdaCurses @TEST_LIBS2@
+LARGS =-largs -L../lib -lAdaCurses @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@
-PROGS = tour rain ncurses
+PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x
-all :: tour$x rain$x ncurses$x
+all :: $(PROGS)
@echo made $@
sources :
@@ -107,15 +116,28 @@ uninstall \
uninstall.libs ::
@echo made $@
+install.examples :: $(BINDIR) $(PROGS)
+ $(INSTALL) $(PROGS) $(BINDIR)
+
+install.examples :: $(MY_DATADIR)
+ $(INSTALL_DATA) explain.txt $(MY_DATADIR)
+
+uninstall.examples ::
+ -cd $(BINDIR) && rm -f $(PROGS)
+ -rmdir $(BINDIR)
+ -rm -f $(MY_DATADIR)/explain.txt
+ -rmdir $(MY_DATADIR)
+
+$(BINDIR) \
+$(MY_DATADIR) :
+ mkdir -p $@
+
ncurses$x :
$(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS)
-tour$x : explain.msg
+tour$x :
$(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS)
-explain.msg: $(srcdir)/explain.txt
- cp $(srcdir)/explain.txt $@
-
rain$x :
$(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS)
@@ -124,7 +146,7 @@ mostlyclean:
clean :: mostlyclean
rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \
- explain.msg trace screendump b~*.ad[bs]
+ trace screendump b~*.ad[bs]
distclean :: clean
rm -f Makefile
diff --git a/Ada95/samples/explain.txt b/Ada95/samples/explain.txt
index 570f617bf926..be2cba154ee2 100644
--- a/Ada95/samples/explain.txt
+++ b/Ada95/samples/explain.txt
@@ -54,13 +54,13 @@ In a menu you can use the following Keys in the whole application:
#HELP
#HELPKEYS
You may scroll with the Cursor Up/Down Keys.
-You may leave the help with the Function Key labelled 'Quit'.
+You may leave the help with the Function Key labeled 'Quit'.
#INHELP
You are already in the help system.
-You may leave the help with the Function Key labelled 'Quit'.
+You may leave the help with the Function Key labeled 'Quit'.
#MAIN
This is the main menu of the sample program for the ncurses Ada95
-binding. The main intention of the demo is not to demonstate or
+binding. The main intention of the demo is not to demonstrate or
test all the features of ncurses and it's subsystems, but to provide
to you some sample code how to use the binding with Ada95.
@@ -86,23 +86,23 @@ descriptions for the items, a marker and a padding character between
the item name and the description.
#MENU01
This is a demo of the some of the menu layout options. One of them
-is the spacing functionality. Just press the Key labelled "Flip" to
+is the spacing functionality. Just press the Key labeled "Flip" to
flip between the non-spaced and a spaced version of the menu. Please
note that this functionality is unique for ncurses and is not found
in the SVr4 menu implementation.
-This is a menu that sometimes doesn't fit into it's window and
+This is a menu that sometimes does not fit into it's window and
therefore it becomes a scroll menu.
You can also see here very nicely the pattern matching functionality
of menus. Type for example a 'J' and you will be positioned to the
next item after the current starting with a 'J'. Any more characters
you type in make the pattern more specific. With CTRL-A and CTRL-Z
-(for more details press the Key labelled "Keys") you can browse
+(for more details press the Key labeled "Keys") you can browse
through all the items matching the pattern.
You may change the format of the menu. Just press one of the keys
-labelled "4x1", "4x2" or "4x3" to get a menu with that many rows
+labeled "4x1", "4x2" or "4x3" to get a menu with that many rows
and columns.
With the Keys "O-Row" or "O-Col" (they occupy the same label and
@@ -121,7 +121,7 @@ With the Keys "+Desc" or "-Desc" (they occupy the same label and
switch on selection) you can change whether or not the descriptions
for each item should be displayed. Please not that this key is
not visible in the "4x3" layout mode, because in this case the
-menu wouldn't fit on a typicall 80x24 screen.
+menu would not fit on a typical 80x24 screen.
With the Keys "Disab" or "Enab" (they occupy the same label and
switch on selection) you can dis- or enable the selectability of
@@ -131,13 +131,13 @@ You may press "Flip" to see the effect of ncurses unique menu-spacing.
The Keys "4x1", "4x2" and "4x3" will change the format of the menu.
Please note that this is a scrolling menu. You may also play with the
pattern matching functionality or try to change the format of the menu.
-For more details press the Key labelled "Help".
+For more details press the Key labeled "Help".
#FORM00
This is a demo of the forms package.
#FORM-PAD00
Please note that this demo is far from being complete. It really shows
only a small part of the functionality of the forms package. Let's hope
-the next version will have a richer demo (You wan't to contribute ?).
+the next version will have a richer demo (You want to contribute ?).
#NOTIMPL
Sorry this functionality of the demo is not implemented at the moment.
Remember this is a freeware project, so I can use only my very rare
@@ -149,13 +149,13 @@ functionality.
#CURSES-PAD00
Please note that this demo is far from being complete. It really shows
only a small part of the functionality of the curses package. Let's hope
-the next version will have a richer demo (You wan't to contribute ?).
+the next version will have a richer demo (You want to contribute ?).
#MOUSEKEYS
In this demo you may use this keys:
- - Key labelled "Help" to get a help
- - Key labelled "Keys" is what you are reading now
- - Key labelled "Quit" to leave the demo
+ - Key labeled "Help" to get a help
+ - Key labeled "Keys" is what you are reading now
+ - Key labeled "Quit" to leave the demo
You may click the mouse buttons at any location at the screen and look
at the protocol window !
@@ -179,7 +179,7 @@ sourcecode.
You may press one of the three well known standard keys of this demo.
#ATTRIB-PAD00
Again this is a more than simple demo and just here to give you the
-sourcecode. Feel free to contribute more.
+source code. Feel free to contribute more.
#TEXTIO
#TEXTIOKEYS
#TEXTIO-PAD00
diff --git a/Ada95/samples/ncurses2-acs_and_scroll.adb b/Ada95/samples/ncurses2-acs_and_scroll.adb
index 5d965983b84e..00e9afc26078 100644
--- a/Ada95/samples/ncurses2-acs_and_scroll.adb
+++ b/Ada95/samples/ncurses2-acs_and_scroll.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000-2008,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.9 $
--- $Date: 2009/12/26 17:38:58 $
+-- $Revision: 1.11 $
+-- $Date: 2011/03/23 00:33:00 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Windows and scrolling tester.
@@ -345,7 +345,7 @@ procedure ncurses2.acs_and_scroll is
return;
when KEY_UP =>
i := i + si - 1;
- -- same as i := i - 1 because of Modulus arithetic,
+ -- same as i := i - 1 because of Modulus arithmetic,
-- on Line_Position, which is a Natural
-- the C version uses this form too, interestingly.
when KEY_DOWN =>
@@ -452,19 +452,19 @@ procedure ncurses2.acs_and_scroll is
function delete_framed (fp : FrameA; showit : Boolean) return FrameA is
np : FrameA;
begin
- fp.last.next := fp.next;
- fp.next.last := fp.last;
+ fp.all.last.all.next := fp.all.next;
+ fp.all.next.all.last := fp.all.last;
if showit then
- Erase (fp.wind);
- Refresh (fp.wind);
+ Erase (fp.all.wind);
+ Refresh (fp.all.wind);
end if;
- Delete (fp.wind);
+ Delete (fp.all.wind);
- if fp = fp.next then
+ if fp = fp.all.next then
np := null;
else
- np := fp.next;
+ np := fp.all.next;
end if;
-- TODO free(fp);
return np;
@@ -494,64 +494,64 @@ begin
False, False,
Null_Window);
begin
- neww.wind := getwindow;
- if neww.wind = Null_Window then
+ neww.all.wind := getwindow;
+ if neww.all.wind = Null_Window then
exit;
-- was goto breakout; ha ha ha
else
if current = null then
- neww.next := neww;
- neww.last := neww;
+ neww.all.next := neww;
+ neww.all.last := neww;
else
- neww.next := current.next;
- neww.last := current;
- neww.last.next := neww;
- neww.next.last := neww;
+ neww.all.next := current.all.next;
+ neww.all.last := current;
+ neww.all.last.all.next := neww;
+ neww.all.next.all.last := neww;
end if;
current := neww;
- Set_KeyPad_Mode (current.wind, True);
- current.do_keypad := HaveKeyPad (current.wind);
- current.do_scroll := HaveScroll (current.wind);
+ Set_KeyPad_Mode (current.all.wind, True);
+ current.all.do_keypad := HaveKeyPad (current.all.wind);
+ current.all.do_scroll := HaveScroll (current.all.wind);
end if;
end;
when Character'Pos ('N') mod 16#20# => -- Ctrl('N')
if current /= null then
- current := current.next;
+ current := current.all.next;
end if;
when Character'Pos ('P') mod 16#20# => -- Ctrl('P')
if current /= null then
- current := current.last;
+ current := current.all.last;
end if;
when Character'Pos ('F') mod 16#20# => -- Ctrl('F')
- if current /= null and then HaveScroll (current.wind) then
- Scroll (current.wind, 1);
+ if current /= null and then HaveScroll (current.all.wind) then
+ Scroll (current.all.wind, 1);
end if;
when Character'Pos ('B') mod 16#20# => -- Ctrl('B')
- if current /= null and then HaveScroll (current.wind) then
+ if current /= null and then HaveScroll (current.all.wind) then
-- The C version of Scroll may return ERR which is ignored
-- we need to avoid the exception
-- with the 'and HaveScroll(current.wind)'
- Scroll (current.wind, -1);
+ Scroll (current.all.wind, -1);
end if;
when Character'Pos ('K') mod 16#20# => -- Ctrl('K')
if current /= null then
- current.do_keypad := not current.do_keypad;
- Set_KeyPad_Mode (current.wind, current.do_keypad);
+ current.all.do_keypad := not current.all.do_keypad;
+ Set_KeyPad_Mode (current.all.wind, current.all.do_keypad);
end if;
when Character'Pos ('S') mod 16#20# => -- Ctrl('S')
if current /= null then
- current.do_scroll := not current.do_scroll;
- Allow_Scrolling (current.wind, current.do_scroll);
+ current.all.do_scroll := not current.all.do_scroll;
+ Allow_Scrolling (current.all.wind, current.all.do_scroll);
end if;
when Character'Pos ('W') mod 16#20# => -- Ctrl('W')
- if current /= current.next then
+ if current /= current.all.next then
Create (f, Name => dumpfile); -- TODO error checking
if not Is_Open (f) then
raise Curses_Exception;
end if;
- Put_Window (current.wind, f);
+ Put_Window (current.all.wind, f);
Close (f);
current := delete_framed (current, True);
end if;
@@ -563,15 +563,15 @@ begin
Open (f, Mode => In_File, Name => dumpfile);
neww := new Frame'(null, null, False, False, Null_Window);
- neww.next := current.next;
- neww.last := current;
- neww.last.next := neww;
- neww.next.last := neww;
+ neww.all.next := current.all.next;
+ neww.all.last := current;
+ neww.all.last.all.next := neww;
+ neww.all.next.all.last := neww;
- neww.wind := Get_Window (f);
+ neww.all.wind := Get_Window (f);
Close (f);
- Refresh (neww.wind);
+ Refresh (neww.all.wind);
end;
when Character'Pos ('X') mod 16#20# => -- Ctrl('X')
if current /= null then
@@ -587,7 +587,7 @@ begin
"to mark new corner");
Refresh;
- Get_Window_Position (current.wind, ul.y, ul.x);
+ Get_Window_Position (current.all.wind, ul.y, ul.x);
selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2,
tmp, tmpbool);
@@ -595,43 +595,43 @@ begin
-- the C version had a goto. I refuse gotos.
Beep;
else
- Get_Size (current.wind, lr.y, lr.x);
+ Get_Size (current.all.wind, lr.y, lr.x);
lr.y := lr.y + ul.y - 1;
lr.x := lr.x + ul.x - 1;
Outerbox (ul, lr, False);
Refresh_Without_Update;
- Get_Size (current.wind, my, mx);
+ Get_Size (current.all.wind, my, mx);
if my > tmp.y - ul.y then
- Get_Cursor_Position (current.wind, lr.y, lr.x);
- Move_Cursor (current.wind, tmp.y - ul.y + 1, 0);
- Clear_To_End_Of_Screen (current.wind);
- Move_Cursor (current.wind, lr.y, lr.x);
+ Get_Cursor_Position (current.all.wind, lr.y, lr.x);
+ Move_Cursor (current.all.wind, tmp.y - ul.y + 1, 0);
+ Clear_To_End_Of_Screen (current.all.wind);
+ Move_Cursor (current.all.wind, lr.y, lr.x);
end if;
if mx > tmp.x - ul.x then
for i in 0 .. my - 1 loop
- Move_Cursor (current.wind, i, tmp.x - ul.x + 1);
- Clear_To_End_Of_Line (current.wind);
+ Move_Cursor (current.all.wind, i, tmp.x - ul.x + 1);
+ Clear_To_End_Of_Line (current.all.wind);
end loop;
end if;
- Refresh_Without_Update (current.wind);
+ Refresh_Without_Update (current.all.wind);
lr := tmp;
-- The C version passes invalid args to resize
-- which returns an ERR. For Ada we avoid the exception.
if lr.y /= ul.y and lr.x /= ul.x then
- Resize (current.wind, lr.y - ul.y + 0,
+ Resize (current.all.wind, lr.y - ul.y + 0,
lr.x - ul.x + 0);
end if;
- Get_Window_Position (current.wind, ul.y, ul.x);
- Get_Size (current.wind, lr.y, lr.x);
+ Get_Window_Position (current.all.wind, ul.y, ul.x);
+ Get_Size (current.all.wind, lr.y, lr.x);
lr.y := lr.y + ul.y - 1;
lr.x := lr.x + ul.x - 1;
Outerbox (ul, lr, True);
Refresh_Without_Update;
- Refresh_Without_Update (current.wind);
+ Refresh_Without_Update (current.all.wind);
Move_Cursor (Line => 0, Column => 0);
Clear_To_End_Of_Line;
Update_Screen;
@@ -647,30 +647,30 @@ begin
Refresh;
end;
when Key_Cursor_Up =>
- newwin_move (current.wind, -1, 0);
+ newwin_move (current.all.wind, -1, 0);
when Key_Cursor_Down =>
- newwin_move (current.wind, 1, 0);
+ newwin_move (current.all.wind, 1, 0);
when Key_Cursor_Left =>
- newwin_move (current.wind, 0, -1);
+ newwin_move (current.all.wind, 0, -1);
when Key_Cursor_Right =>
- newwin_move (current.wind, 0, 1);
+ newwin_move (current.all.wind, 0, 1);
when Key_Backspace | Key_Delete_Char =>
declare
y : Line_Position;
x : Column_Position;
tmp : Line_Position;
begin
- Get_Cursor_Position (current.wind, y, x);
+ Get_Cursor_Position (current.all.wind, y, x);
-- x := x - 1;
-- I got tricked by the -1 = Max_Natural - 1 result
-- y := y - 1;
if not (x = 0 and y = 0) then
if x = 0 then
y := y - 1;
- Get_Size (current.wind, tmp, x);
+ Get_Size (current.all.wind, tmp, x);
end if;
x := x - 1;
- Delete_Character (current.wind, y, x);
+ Delete_Character (current.all.wind, y, x);
end if;
end;
when others =>
@@ -678,7 +678,7 @@ begin
if current /= null then
declare
begin
- Add (current.wind, Ch => Code_To_Char (c));
+ Add (current.all.wind, Ch => Code_To_Char (c));
exception
when Curses_Exception => null;
-- this happens if we are at the
@@ -688,9 +688,9 @@ begin
Beep;
end if;
end case;
- newwin_report (current.wind);
+ newwin_report (current.all.wind);
if current /= null then
- usescr := current.wind;
+ usescr := current.all.wind;
else
usescr := Standard_Window;
end if;
diff --git a/Ada95/samples/ncurses2-demo_forms.adb b/Ada95/samples/ncurses2-demo_forms.adb
index 7137aa0b1e45..1afbb88bf3ff 100644
--- a/Ada95/samples/ncurses2-demo_forms.adb
+++ b/Ada95/samples/ncurses2-demo_forms.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2006,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.5 $
--- $Date: 2006/06/25 14:24:40 $
+-- $Revision: 1.6 $
+-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -451,19 +451,19 @@ begin
Refresh;
-- describe the form
- f (1) := make_label (0, 15, "Sample Form");
- f (2) := make_label (2, 0, "Last Name");
- f (3) := make_field (3, 0, 1, 18, False);
- f (4) := make_label (2, 20, "First Name");
- f (5) := make_field (3, 20, 1, 12, False);
- f (6) := make_label (2, 34, "Middle Name");
- f (7) := make_field (3, 34, 1, 12, False);
- f (8) := make_label (5, 0, "Comments");
- f (9) := make_field (6, 0, 4, 46, False);
- f (10) := make_label (5, 20, "Password:");
- f (11) := make_field (5, 30, 1, 9, True);
- secure := f (11);
- f (12) := Null_Field;
+ f.all (1) := make_label (0, 15, "Sample Form");
+ f.all (2) := make_label (2, 0, "Last Name");
+ f.all (3) := make_field (3, 0, 1, 18, False);
+ f.all (4) := make_label (2, 20, "First Name");
+ f.all (5) := make_field (3, 20, 1, 12, False);
+ f.all (6) := make_label (2, 34, "Middle Name");
+ f.all (7) := make_field (3, 34, 1, 12, False);
+ f.all (8) := make_label (5, 0, "Comments");
+ f.all (9) := make_field (6, 0, 4, 46, False);
+ f.all (10) := make_label (5, 20, "Password:");
+ f.all (11) := make_field (5, 30, 1, 9, True);
+ secure := f.all (11);
+ f.all (12) := Null_Field;
myform := New_Form (f);
diff --git a/Ada95/samples/ncurses2-demo_pad.adb b/Ada95/samples/ncurses2-demo_pad.adb
index 862b8b70da29..b1b72aec0b60 100644
--- a/Ada95/samples/ncurses2-demo_pad.adb
+++ b/Ada95/samples/ncurses2-demo_pad.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.7 $
--- $Date: 2008/07/26 18:47:06 $
+-- $Revision: 1.8 $
+-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -121,8 +121,8 @@ procedure ncurses2.demo_pad is
retval.seconds := 0;
retval.microseconds := 0;
else
- retval.seconds := Integer (t.tv_sec);
- retval.microseconds := Integer (t.tv_usec);
+ retval.seconds := Integer (t.all.tv_sec);
+ retval.microseconds := Integer (t.all.tv_usec);
end if;
return retval;
end gettime;
diff --git a/Ada95/samples/ncurses2-demo_panels.adb b/Ada95/samples/ncurses2-demo_panels.adb
index d2558ed47309..9693e1a13ba3 100644
--- a/Ada95/samples/ncurses2-demo_panels.adb
+++ b/Ada95/samples/ncurses2-demo_panels.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000-2004,2008 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.6 $
--- $Date: 2008/08/30 23:35:01 $
+-- $Revision: 1.7 $
+-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -139,7 +139,7 @@ procedure ncurses2.demo_panels (nap_mseci : Integer) is
procedure fill_panel (pan : Panel) is
win : constant Window := Panel_Window (pan);
- num : constant Character := Get_User_Data (pan) (2);
+ num : constant Character := Get_User_Data (pan).all (2);
tmp6 : String (1 .. 6) := "-panx-";
maxy : Line_Count;
maxx : Column_Count;
diff --git a/Ada95/samples/ncurses2-getopt.adb b/Ada95/samples/ncurses2-getopt.adb
index 238c43919eac..29f1fee8281a 100644
--- a/Ada95/samples/ncurses2-getopt.adb
+++ b/Ada95/samples/ncurses2-getopt.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000-2004,2008 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.7 $
--- $Date: 2008/07/26 18:46:44 $
+-- $Revision: 1.8 $
+-- $Date: 2011/03/19 12:09:51 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- A simplified version of the GNU getopt function
@@ -56,7 +56,7 @@ package body ncurses2.getopt is
-- also the user is not allowed to modify argv or argc
-- Doing so is Erroneous execution.
- -- longoptions are not handled.
+ -- long options are not handled.
procedure Qgetopt (retval : out Integer;
argc : Integer;
@@ -67,7 +67,7 @@ package body ncurses2.getopt is
-- ignored for ncurses, must be initialized to 1 by
-- the caller
Optarg : out stringa
- -- a garbage colector would be useful here.
+ -- a garbage collector would be useful here.
) is
package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200);
diff --git a/Ada95/samples/ncurses2-menu_test.adb b/Ada95/samples/ncurses2-menu_test.adb
index a4c4807b2812..bce9782372a4 100644
--- a/Ada95/samples/ncurses2-menu_test.adb
+++ b/Ada95/samples/ncurses2-menu_test.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2006,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.6 $
--- $Date: 2006/06/25 14:24:40 $
+-- $Revision: 1.8 $
+-- $Date: 2011/03/23 00:39:28 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -46,10 +46,10 @@ with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
procedure ncurses2.menu_test is
- function menu_virtualize (c : Key_Code) return Menu_Request_Code;
+ function menu_virtualize (c : Key_Code) return Key_Code;
procedure xAdd (l : Line_Position; c : Column_Position; s : String);
- function menu_virtualize (c : Key_Code) return Menu_Request_Code is
+ function menu_virtualize (c : Key_Code) return Key_Code is
begin
case c is
when Character'Pos (newl) | Key_Exit =>
@@ -110,7 +110,7 @@ procedure ncurses2.menu_test is
c1 : Key_Code;
c : Driver_Result;
- r : Menu_Request_Code;
+ r : Key_Code;
begin
tmp := Start_Mouse;
xAdd (0, 0, "This is the menu test:");
@@ -121,9 +121,9 @@ begin
Refresh;
for i in animals'Range loop
- items_a (i) := New_Item (animals (i).all);
+ items_a.all (i) := New_Item (animals (i).all);
end loop;
- items_a (animals'Last + 1) := Null_Item;
+ items_a.all (animals'Last + 1) := Null_Item;
m := New_Menu (items_a);
diff --git a/Ada95/samples/ncurses2-overlap_test.adb b/Ada95/samples/ncurses2-overlap_test.adb
index 37e8d4c2eb5a..ddf8a9a31f64 100644
--- a/Ada95/samples/ncurses2-overlap_test.adb
+++ b/Ada95/samples/ncurses2-overlap_test.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000,2004 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2004,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.4 $
--- $Date: 2004/08/21 21:37:00 $
+-- $Revision: 1.5 $
+-- $Date: 2011/03/19 12:07:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -101,7 +101,7 @@ begin
Move_Cursor (Line => 18, Column => 0);
Add (Str => "a = refresh A, then B, then doupdate. b = refresh B, " &
- "then A, then doupdaute");
+ "then A, then doupdate");
Add (Ch => newl);
Add (Str => "c = fill window A with letter A. d = fill window B " &
"with letter B.");
diff --git a/Ada95/samples/ncurses2-slk_test.adb b/Ada95/samples/ncurses2-slk_test.adb
index 256becf92dac..aa368ba5f9ce 100644
--- a/Ada95/samples/ncurses2-slk_test.adb
+++ b/Ada95/samples/ncurses2-slk_test.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000-2006,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.8 $
--- $Date: 2009/12/26 17:38:58 $
+-- $Revision: 1.9 $
+-- $Date: 2011/03/19 12:03:08 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -161,7 +161,7 @@ begin
when 'x' | 'q' =>
exit;
-- the C version needed a goto, ha ha
- -- breaks exit the case not the loop because fall-throuh
+ -- breaks exit the case not the loop because fall-through
-- happens in C!
when others =>
Beep;
diff --git a/Ada95/samples/ncurses2-trace_set.adb b/Ada95/samples/ncurses2-trace_set.adb
index 1e2716e1e25c..7537afe407ee 100644
--- a/Ada95/samples/ncurses2-trace_set.adb
+++ b/Ada95/samples/ncurses2-trace_set.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.3 $
--- $Date: 2008/07/26 18:46:18 $
+-- $Revision: 1.5 $
+-- $Date: 2011/03/23 00:40:33 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -50,14 +50,14 @@ with Ada.Strings.Bounded;
procedure ncurses2.trace_set is
- function menu_virtualize (c : Key_Code) return Menu_Request_Code;
+ function menu_virtualize (c : Key_Code) return Key_Code;
function subset (super, sub : Trace_Attribute_Set) return Boolean;
function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set;
function trace_num (tlevel : Trace_Attribute_Set) return String;
function tracetrace (tlevel : Trace_Attribute_Set) return String;
function run_trace_menu (m : Menu; count : Integer) return Boolean;
- function menu_virtualize (c : Key_Code) return Menu_Request_Code is
+ function menu_virtualize (c : Key_Code) return Key_Code is
begin
case c is
when Character'Pos (newl) | Key_Exit =>
@@ -416,9 +416,9 @@ begin
Refresh;
for n in t_tbl'Range loop
- items_a (n) := New_Item (t_tbl (n).name.all);
+ items_a.all (n) := New_Item (t_tbl (n).name.all);
end loop;
- items_a (t_tbl'Last + 1) := Null_Item;
+ items_a.all (t_tbl'Last + 1) := Null_Item;
m := New_Menu (items_a);
diff --git a/Ada95/samples/sample-curses_demo.adb b/Ada95/samples/sample-curses_demo.adb
index 700da7684be1..4dd96a721d2a 100644
--- a/Ada95/samples/sample-curses_demo.adb
+++ b/Ada95/samples/sample-curses_demo.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998,2004 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2004,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.15 $
--- $Date: 2004/08/21 21:37:00 $
+-- $Revision: 1.17 $
+-- $Date: 2011/03/23 00:29:04 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -61,7 +61,7 @@ package body Sample.Curses_Demo is
type User_Data_Access is access all User_Data;
package PUD is new Panels.User_Data (User_Data, User_Data_Access);
-- We use above instantiation of the generic User_Data package to
- -- demonstrate and test the use of the user data maechanism.
+ -- demonstrate and test the use of the user data mechanism.
procedure Demo
is
@@ -122,9 +122,9 @@ package body Sample.Curses_Demo is
declare
O : Item_Option_Set;
begin
- Get_Options (Itm (2), O);
+ Get_Options (Itm.all (2), O);
O.Selectable := False;
- Set_Options (Itm (2), O);
+ Set_Options (Itm.all (2), O);
end;
end if;
diff --git a/Ada95/samples/sample-explanation.adb b/Ada95/samples/sample-explanation.adb
index 3129dfd76a74..5587099b242a 100644
--- a/Ada95/samples/sample-explanation.adb
+++ b/Ada95/samples/sample-explanation.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.21 $
--- $Date: 2009/12/26 17:38:58 $
+-- $Revision: 1.26 $
+-- $Date: 2011/03/26 22:33:29 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Poor mans help system. This scans a sequential file for key lines and
@@ -58,7 +58,7 @@ package body Sample.Explanation is
Help_Keys : constant String := "HELPKEYS";
In_Help : constant String := "INHELP";
- File_Name : constant String := "explain.msg";
+ File_Name : constant String := "explain.txt";
F : File_Type;
type Help_Line;
@@ -86,6 +86,8 @@ package body Sample.Explanation is
function Search (Key : String) return Help_Line_Access;
procedure Release_Help (Root : in out Help_Line_Access);
+ function Check_File (Name : String) return Boolean;
+
procedure Explain (Key : String)
is
begin
@@ -126,7 +128,7 @@ package body Sample.Explanation is
Add (W, Key);
Add (W, " not found.");
Add (W, Character'Val (10));
- Add (W, "Press the Function key labelled 'Quit' key to continue.");
+ Add (W, "Press the Function key labeled 'Quit' key to continue.");
end Unknown_Key;
procedure Redo
@@ -135,9 +137,9 @@ package body Sample.Explanation is
begin
if Top_Line /= null then
for L in 0 .. (Height - 1) loop
- Add (W, L, 0, H.Line.all);
- exit when H.Next = null;
- H := H.Next;
+ Add (W, L, 0, H.all.Line.all);
+ exit when H.all.Next = null;
+ H := H.all.Next;
end loop;
else
Unknown_Key;
@@ -181,12 +183,12 @@ package body Sample.Explanation is
L : Line_Position := 0;
begin
loop
- Add (W, L, 0, C.Line.all);
+ Add (W, L, 0, C.all.Line.all);
L := L + 1;
- exit when C.Next = null or else L = Height;
- C := C.Next;
+ exit when C.all.Next = null or else L = Height;
+ C := C.all.Next;
end loop;
- if C.Next /= null then
+ if C.all.Next /= null then
pragma Assert (L = Height);
More := True;
else
@@ -248,20 +250,20 @@ package body Sample.Explanation is
if K in Special_Key_Code'Range then
case K is
when Key_Cursor_Down =>
- if Current.Next /= null then
+ if Current.all.Next /= null then
Move_Cursor (W, Height - 1, 0);
Scroll (W, 1);
- Current := Current.Next;
- Top_Line := Top_Line.Next;
- Add (W, Current.Line.all);
+ Current := Current.all.Next;
+ Top_Line := Top_Line.all.Next;
+ Add (W, Current.all.Line.all);
end if;
when Key_Cursor_Up =>
- if Top_Line.Prev /= null then
+ if Top_Line.all.Prev /= null then
Move_Cursor (W, 0, 0);
Scroll (W, -1);
- Top_Line := Top_Line.Prev;
- Current := Current.Prev;
- Add (W, Top_Line.Line.all);
+ Top_Line := Top_Line.all.Prev;
+ Current := Current.all.Prev;
+ Add (W, Top_Line.all.Line.all);
end if;
when QUIT_CODE => exit;
when others => null;
@@ -330,8 +332,8 @@ package body Sample.Explanation is
Release_Help (Root);
Root := Current;
else
- Tail.Next := Current;
- Current.Prev := Tail;
+ Tail.all.Next := Current;
+ Current.all.Prev := Tail;
end if;
Tail := Current;
end loop;
@@ -347,8 +349,8 @@ package body Sample.Explanation is
begin
loop
exit when Root = null;
- Next := Root.Next;
- Release_String (Root.Line);
+ Next := Root.all.Next;
+ Release_String (Root.all.Line);
Release_Help_Line (Root);
Root := Next;
end loop;
@@ -371,7 +373,7 @@ package body Sample.Explanation is
begin
if H /= null then
loop
- T := T.Next;
+ T := T.all.Next;
exit when T = null;
N := N + 1;
end loop;
@@ -391,9 +393,9 @@ package body Sample.Explanation is
P := New_Panel (W);
T := H;
loop
- Add (W, L + 1, 1, T.Line.all, Integer (Columns - 2));
+ Add (W, L + 1, 1, T.all.Line.all, Integer (Columns - 2));
L := L + 1;
- T := T.Next;
+ T := T.all.Next;
exit when T = null;
end loop;
T := H;
@@ -403,6 +405,26 @@ package body Sample.Explanation is
end if;
end Notepad;
+ function Check_File (Name : String) return Boolean is
+ The_File : File_Type;
+ begin
+ Open (The_File, In_File, Name);
+ Close (The_File);
+ return True;
+ exception
+ when Name_Error =>
+ return False;
+ end Check_File;
+
begin
- Open (F, In_File, File_Name);
+ if Check_File ("/usr/share/AdaCurses/" & File_Name) then
+ Open (F, In_File, "/usr/share/AdaCurses/" & File_Name);
+ elsif Check_File (File_Name) then
+ Open (F, In_File, File_Name);
+ else
+ Put_Line (Standard_Error,
+ "The file explain.txt was not found in the current directory."
+ );
+ raise Name_Error;
+ end if;
end Sample.Explanation;
diff --git a/Ada95/samples/sample-form_demo-aux.ads b/Ada95/samples/sample-form_demo-aux.ads
index 57e5bc1a2aca..7e7f7cd21e39 100644
--- a/Ada95/samples/sample-form_demo-aux.ads
+++ b/Ada95/samples/sample-form_demo-aux.ads
@@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.10 $
+-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -49,7 +49,7 @@ package Sample.Form_Demo.Aux is
C : out Column_Count;
Y : out Line_Position;
X : out Column_Position);
- -- Calculate the geometry for a panel beeing able to be used to display
+ -- Calculate the geometry for a panel being able to be used to display
-- the menu.
function Create (F : Form;
diff --git a/Ada95/samples/sample-form_demo.adb b/Ada95/samples/sample-form_demo.adb
index e26a5d98a2be..ed84526feae2 100644
--- a/Ada95/samples/sample-form_demo.adb
+++ b/Ada95/samples/sample-form_demo.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2006,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.15 $
--- $Date: 2006/06/25 14:30:22 $
+-- $Revision: 1.16 $
+-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -108,16 +108,16 @@ package body Sample.Form_Demo is
Notepad ("FORM-PAD00");
Default_Labels;
- Set_Field_Type (FA (6), Enum_Field);
- Set_Field_Type (FA (7), I_F);
- Set_Field_Type (FA (8), Mft);
+ Set_Field_Type (FA.all (6), Enum_Field);
+ Set_Field_Type (FA.all (7), I_F);
+ Set_Field_Type (FA.all (8), Mft);
F1 := new User_Data'(Data => 4711);
- Fld_U.Set_User_Data (FA (1), F1);
+ Fld_U.Set_User_Data (FA.all (1), F1);
Fh.Drive_Me (Frm);
- Fld_U.Get_User_Data (FA (1), F2);
+ Fld_U.Get_User_Data (FA.all (1), F2);
pragma Assert (F1 = F2);
pragma Assert (F1.Data = F2.Data);
diff --git a/Ada95/samples/sample-function_key_setting.adb b/Ada95/samples/sample-function_key_setting.adb
index 0ce3a224c684..4ff70be7bb8a 100644
--- a/Ada95/samples/sample-function_key_setting.adb
+++ b/Ada95/samples/sample-function_key_setting.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.14 $
--- $Date: 2009/12/26 17:38:58 $
+-- $Revision: 1.15 $
+-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
@@ -88,18 +88,18 @@ package body Sample.Function_Key_Setting is
begin
-- Store the current labels in the environment
for I in 1 .. Number_Of_Keys loop
- Get_Soft_Label_Key (I, P.Labels (I));
+ Get_Soft_Label_Key (I, P.all.Labels (I));
if Reset then
Set_Soft_Label_Key (I, " ");
end if;
end loop;
- P.Prev := Top_Of_Stack;
+ P.all.Prev := Top_Of_Stack;
-- now store active help context and notepad
- P.Help := Active_Context;
- P.Notepad := Active_Notepad;
+ P.all.Help := Active_Context;
+ P.all.Notepad := Active_Notepad;
-- The notepad must now vanish and the new notepad is empty.
- if P.Notepad /= Null_Panel then
- Hide (P.Notepad);
+ if P.all.Notepad /= Null_Panel then
+ Hide (P.all.Notepad);
Update_Panels;
end if;
Active_Notepad := Null_Panel;
@@ -119,14 +119,14 @@ package body Sample.Function_Key_Setting is
raise Function_Key_Stack_Error;
else
for I in 1 .. Number_Of_Keys loop
- Set_Soft_Label_Key (I, P.Labels (I), Justification);
+ Set_Soft_Label_Key (I, P.all.Labels (I), Justification);
end loop;
pragma Assert (Active_Context /= null);
Release_String (Active_Context);
- Active_Context := P.Help;
+ Active_Context := P.all.Help;
Refresh_Soft_Label_Keys_Without_Update;
- Notepad_To_Context (P.Notepad);
- Top_Of_Stack := P.Prev;
+ Notepad_To_Context (P.all.Notepad);
+ Top_Of_Stack := P.all.Prev;
Release_Environment (P);
end if;
end Pop_Environment;
@@ -150,10 +150,10 @@ package body Sample.Function_Key_Setting is
else
loop
exit when P = null;
- if P.Help.all = Key then
+ if P.all.Help.all = Key then
return True;
else
- P := P.Prev;
+ P := P.all.Prev;
end if;
end loop;
return False;
diff --git a/Ada95/samples/sample-function_key_setting.ads b/Ada95/samples/sample-function_key_setting.ads
index 77699136e7e6..4188158f05c9 100644
--- a/Ada95/samples/sample-function_key_setting.ads
+++ b/Ada95/samples/sample-function_key_setting.ads
@@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.10 $
+-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -62,7 +62,7 @@ package Sample.Function_Key_Setting is
-- Initialize the environment
function Context return String;
- -- Return the current context identitfier
+ -- Return the current context identifier
function Find_Context (Key : String) return Boolean;
-- Look for a context, return true if it is in the stack,
diff --git a/Ada95/samples/sample-header_handler.adb b/Ada95/samples/sample-header_handler.adb
index 189118d04021..ad60caf4b0cb 100644
--- a/Ada95/samples/sample-header_handler.adb
+++ b/Ada95/samples/sample-header_handler.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,14 +35,16 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.17 $
--- $Date: 2009/12/26 17:38:58 $
+-- $Revision: 1.19 $
+-- $Date: 2011/03/22 23:54:38 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Calendar; use Ada.Calendar;
with Terminal_Interface.Curses.Text_IO.Integer_IO;
with Sample.Manifest; use Sample.Manifest;
+pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO);
+
-- This package handles the painting of the header line of the screen.
--
package body Sample.Header_Handler is
@@ -169,7 +171,7 @@ package body Sample.Header_Handler is
Pos := Columns - Column_Position (Title'Length);
Add (Win, 0, Pos / 2, Title);
-- In this phase we must not allow a physical update, because
- -- ncurses isnīt properly initialized at this point.
+ -- ncurses is not properly initialized at this point.
Internal_Update_Header_Window (False);
return 0;
else
diff --git a/Ada95/samples/sample-helpers.adb b/Ada95/samples/sample-helpers.adb
index e19464c40801..ceef268134a5 100644
--- a/Ada95/samples/sample-helpers.adb
+++ b/Ada95/samples/sample-helpers.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,13 +35,13 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.13 $
--- $Date: 2009/12/26 17:38:58 $
+-- $Revision: 1.14 $
+-- $Date: 2011/03/19 12:13:21 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Sample.Explanation; use Sample.Explanation;
--- This package contains some conveniant helper routines used throughout
+-- This package contains some convenient helper routines used throughout
-- this example.
--
package body Sample.Helpers is
diff --git a/Ada95/samples/sample-helpers.ads b/Ada95/samples/sample-helpers.ads
index f9bec6a5591e..28e89bb5707c 100644
--- a/Ada95/samples/sample-helpers.ads
+++ b/Ada95/samples/sample-helpers.ads
@@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,12 +35,12 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.10 $
+-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
--- This package contains some conveniant helper routines used throughout
+-- This package contains some convenient helper routines used throughout
-- this example.
--
package Sample.Helpers is
diff --git a/Ada95/samples/sample-keyboard_handler.adb b/Ada95/samples/sample-keyboard_handler.adb
index fdac054d2984..1d3f20c74b4f 100644
--- a/Ada95/samples/sample-keyboard_handler.adb
+++ b/Ada95/samples/sample-keyboard_handler.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2006,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.14 $
--- $Date: 2006/06/25 14:30:22 $
+-- $Revision: 1.16 $
+-- $Date: 2011/03/23 00:34:24 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Strings; use Ada.Strings;
@@ -111,7 +111,7 @@ package body Sample.Keyboard_Handler is
Buffer : String (1 .. Positive (Columns - 11));
Cmdc : String (1 .. 8);
begin
- Get_Buffer (Fld => FA (2), Str => Buffer);
+ Get_Buffer (Fld => FA.all (2), Str => Buffer);
Trim (Buffer, Left);
if Buffer (1) /= ' ' then
Cmdc := To_Upper (Buffer (Cmdc'Range));
@@ -157,8 +157,8 @@ package body Sample.Keyboard_Handler is
end if;
end loop;
Enum_Field := Create (Enum_Info, True);
- Set_Field_Type (FA (2), Enum_Field);
- Set_Background (FA (2), Normal_Video);
+ Set_Field_Type (FA.all (2), Enum_Field);
+ Set_Background (FA.all (2), Normal_Video);
Fh.Drive_Me (Frm, Lines - 3, 0);
Delete (Frm);
@@ -174,7 +174,7 @@ package body Sample.Keyboard_Handler is
Set_Timeout_Mode (Win, Delayed, 30000);
loop
K := Get_Keystroke (Win);
- if K = Key_None then -- a timeout occured
+ if K = Key_None then -- a timeout occurred
Update_Header_Window;
elsif K = 3 and then not In_Command then -- CTRL-C
K := Command;
diff --git a/Ada95/samples/sample-menu_demo-aux.ads b/Ada95/samples/sample-menu_demo-aux.ads
index 50eea900cc99..e82aedf995b0 100644
--- a/Ada95/samples/sample-menu_demo-aux.ads
+++ b/Ada95/samples/sample-menu_demo-aux.ads
@@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.10 $
+-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -49,7 +49,7 @@ package Sample.Menu_Demo.Aux is
C : out Column_Count;
Y : out Line_Position;
X : out Column_Position);
- -- Calculate the geometry for a panel beeing able to be used to display
+ -- Calculate the geometry for a panel being able to be used to display
-- the menu.
function Create (M : Menu;
diff --git a/Ada95/samples/sample-menu_demo.adb b/Ada95/samples/sample-menu_demo.adb
index 38646748713f..80cd94b1d4e5 100644
--- a/Ada95/samples/sample-menu_demo.adb
+++ b/Ada95/samples/sample-menu_demo.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.18 $
--- $Date: 2008/07/26 18:48:30 $
+-- $Revision: 1.19 $
+-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -154,7 +154,7 @@ package body Sample.Menu_Demo is
O : Item_Option_Set;
begin
for J in I'Range loop
- Get_Options (I (J), O);
+ Get_Options (I.all (J), O);
O.Selectable := True;
if Hide_Long then
case J is
@@ -163,7 +163,7 @@ package body Sample.Menu_Demo is
when others => null;
end case;
end if;
- Set_Options (I (J), O);
+ Set_Options (I.all (J), O);
end loop;
end;
return False;
@@ -378,14 +378,14 @@ package body Sample.Menu_Demo is
Set_Pad_Character (M, '|');
MUD.Set_User_Data (M, U1);
- IUD.Set_User_Data (Itm (1), U3);
+ IUD.Set_User_Data (Itm.all (1), U3);
Mh.Drive_Me (M);
MUD.Get_User_Data (M, U2);
pragma Assert (U1 = U2 and U1.all = 4711);
- IUD.Get_User_Data (Itm (1), U4);
+ IUD.Get_User_Data (Itm.all (1), U4);
pragma Assert (U3 = U4 and U3.all = 4712);
Pop_Environment;
diff --git a/Ada95/samples/sample-text_io_demo.adb b/Ada95/samples/sample-text_io_demo.adb
index 0b385c45907f..a458a37cdbd9 100644
--- a/Ada95/samples/sample-text_io_demo.adb
+++ b/Ada95/samples/sample-text_io_demo.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2006,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,18 +35,24 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.16 $
--- $Date: 2006/06/25 14:30:22 $
+-- $Revision: 1.17 $
+-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Numerics.Generic_Elementary_Functions;
+
with Ada.Numerics.Complex_Types;
use Ada.Numerics.Complex_Types;
-with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
+with Terminal_Interface.Curses;
+use Terminal_Interface.Curses;
+
+with Terminal_Interface.Curses.Panels;
+use Terminal_Interface.Curses.Panels;
+
with Terminal_Interface.Curses.Text_IO;
use Terminal_Interface.Curses.Text_IO;
+
with Terminal_Interface.Curses.Text_IO.Integer_IO;
with Terminal_Interface.Curses.Text_IO.Float_IO;
with Terminal_Interface.Curses.Text_IO.Enumeration_IO;
@@ -60,6 +66,14 @@ with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
with Sample.Explanation; use Sample.Explanation;
+pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Complex_IO);
+pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Decimal_IO);
+pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Enumeration_IO);
+pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Fixed_IO);
+pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Float_IO);
+pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO);
+pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Modular_IO);
+
package body Sample.Text_IO_Demo is
type Weekday is (Sunday,
diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb
index 648036f74a0b..9b3759f0c53a 100644
--- a/Ada95/samples/sample.adb
+++ b/Ada95/samples/sample.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998,2008 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.17 $
--- $Date: 2008/09/27 14:42:40 $
+-- $Revision: 1.18 $
+-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Text_IO;
@@ -143,7 +143,7 @@ package body Sample is
Ud.Set_User_Data (M, D1);
I1 := new User_Data'(Data => 1174);
- Id.Set_User_Data (I (1), I1);
+ Id.Set_User_Data (I.all (1), I1);
Set_Spacing (Men => M, Row => 2);
@@ -156,7 +156,7 @@ package body Sample is
pragma Assert (D1 = D2);
pragma Assert (D1.Data = D2.Data);
- Id.Get_User_Data (I (1), I2);
+ Id.Get_User_Data (I.all (1), I2);
pragma Assert (I1 = I2);
pragma Assert (I1.Data = I2.Data);