1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding --
5 -- Terminal_Interface.Curses.Text_IO.Enumeration_IO --
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 ------------------------------------------------------------------------------
28 with Ada.Characters.Handling; use Ada.Characters.Handling;
29 with Terminal_Interface.Curses.Text_IO.Aux;
31 package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is
33 package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
34 package EIO is new Ada.Text_IO.Enumeration_IO (Enum);
39 Width : in Field := Default_Width;
40 Set : in Type_Set := Default_Setting)
42 Buf : String (1 .. Field'Last);
43 Tset : Ada.Text_IO.Type_Set;
45 if Set /= Mixed_Case then
46 Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set));
48 Tset := Ada.Text_IO.Lower_Case;
50 EIO.Put (Buf, Item, Tset);
51 if Set = Mixed_Case then
52 Buf (Buf'First) := To_Upper (Buf (Buf'First));
54 Aux.Put_Buf (Win, Buf, Width, True, True);
59 Width : in Field := Default_Width;
60 Set : in Type_Set := Default_Setting)
63 Put (Get_Window, Item, Width, Set);
66 end Terminal_Interface.Curses.Text_IO.Enumeration_IO;