1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding --
5 -- Terminal_Interface.Curses.Text_IO.Aux --
11 -- The ncurses Ada95 binding is copyrighted 1996 by --
12 -- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de --
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. --
22 -- This binding comes AS IS with no warranty, implied or expressed. --
23 ------------------------------------------------------------------------------
26 ------------------------------------------------------------------------------
27 package body Terminal_Interface.Curses.Text_IO.Aux is
33 Signal : in Boolean := True;
34 Ljust : in Boolean := False)
44 procedure Output (From, To : Field);
46 procedure Output (From, To : Field)
54 -- LRM A10.6 (7) says this
58 pragma Assert (Len <= W);
59 Get_Size (Win, LC, CC);
60 if Column_Count (Len) > CC then
67 if Len < W and then not Ljust then
69 Filler : constant String (1 .. (W - Len))
75 Get_Cursor_Position (Win, Y, X);
76 if (X + Column_Position (Len)) > CC then
79 Put (Win, Buf (From .. To));
80 if Len < W and then Ljust then
82 Filler : constant String (1 .. (W - Len))
93 pragma Assert (Win /= Null_Window);
96 for I in 1 .. Buf'Length loop
97 exit when Buf (L) = ' ';
102 else -- input buffer is not left justified
104 for I in 1 .. Buf'Length loop
105 exit when Buf (L) = ' ';
108 Len := Buf'Length - L;
109 Output (L + 1, Buf'Length);
113 end Terminal_Interface.Curses.Text_IO.Aux;