]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb
ncurses 4.1
[ncurses.git] / Ada95 / ada_include / terminal_interface-curses-text_io-fixed_io.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                           GNAT ncurses Binding                           --
4 --                                                                          --
5 --                Terminal_Interface.Curses.Text_IO.Fixed_IO                --
6 --                                                                          --
7 --                                 B O D Y                                  --
8 --                                                                          --
9 --  Version 00.92                                                           --
10 --                                                                          --
11 --  The ncurses Ada95 binding is copyrighted 1996 by                        --
12 --  Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                     --
13 --                                                                          --
14 --  Permission is hereby granted to reproduce and distribute this           --
15 --  binding by any means and for any fee, whether alone or as part          --
16 --  of a larger distribution, in source or in binary form, PROVIDED         --
17 --  this notice is included with any such distribution, and is not          --
18 --  removed from any of its header files. Mention of ncurses and the        --
19 --  author of this binding in any applications linked with it is            --
20 --  highly appreciated.                                                     --
21 --                                                                          --
22 --  This binding comes AS IS with no warranty, implied or expressed.        --
23 ------------------------------------------------------------------------------
24 --  Version Control:
25 --  $Revision: 1.3 $
26 ------------------------------------------------------------------------------
27 with Ada.Text_IO;
28 with Terminal_Interface.Curses.Text_IO.Aux;
29
30 package body Terminal_Interface.Curses.Text_IO.Fixed_IO is
31
32    package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
33    package FIXIO is new Ada.Text_IO.Fixed_IO (Num);
34
35    procedure Put
36      (Win  : in Window;
37       Item : in Num;
38       Fore : in Field := Default_Fore;
39       Aft  : in Field := Default_Aft;
40       Exp  : in Field := Default_Exp)
41    is
42       Buf : String (1 .. Field'Last);
43       Len : Field := Fore + 1 + Aft;
44    begin
45       if Exp > 0 then
46          Len := Len + 1 + Exp;
47       end if;
48       FIXIO.Put (Buf, Item, Aft, Exp);
49       Aux.Put_Buf (Win, Buf, Len, False);
50    end Put;
51
52    procedure Put
53      (Item  : in Num;
54       Fore : in Field := Default_Fore;
55       Aft  : in Field := Default_Aft;
56       Exp  : in Field := Default_Exp) is
57    begin
58       Put (Get_Window, Item, Fore, Aft, Exp);
59    end Put;
60
61 end Terminal_Interface.Curses.Text_IO.Fixed_IO;