1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding Samples --
5 -- Sample.Curses_Demo.Attributes --
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 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
28 with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
30 with Sample.Manifest; use Sample.Manifest;
31 with Sample.Helpers; use Sample.Helpers;
32 with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
33 with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
34 with Sample.Header_Handler; use Sample.Header_Handler;
35 with Sample.Explanation; use Sample.Explanation;
37 with Sample.Menu_Demo.Handler;
38 with Sample.Curses_Demo.Mouse;
40 package body Sample.Curses_Demo.Attributes is
44 P : Panel := Create (Standard_Window);
52 Push_Environment ("ATTRIBDEMO");
54 Notepad ("ATTRIB-PAD00");
56 Set_Character_Attributes (Attr => (others => False));
57 Add (Line => 1, Column => Columns / 2 - 10,
58 Str => "This is NORMAL");
60 Set_Character_Attributes (Attr => (Stand_Out => True,
62 Add (Line => 2, Column => Columns / 2 - 10,
63 Str => "This is Stand_Out");
65 Set_Character_Attributes (Attr => (Under_Line => True,
67 Add (Line => 3, Column => Columns / 2 - 10,
68 Str => "This is Under_Line");
70 Set_Character_Attributes (Attr => (Reverse_Video => True,
72 Add (Line => 4, Column => Columns / 2 - 10,
73 Str => "This is Reverse_Video");
75 Set_Character_Attributes (Attr => (Blink => True,
77 Add (Line => 5, Column => Columns / 2 - 10,
78 Str => "This is Blink");
80 Set_Character_Attributes (Attr => (Dim_Character => True,
82 Add (Line => 6, Column => Columns / 2 - 10,
83 Str => "This is Dim_Character");
85 Set_Character_Attributes (Attr => (Bold_Character => True,
87 Add (Line => 7, Column => Columns / 2 - 10,
88 Str => "This is Bold_Character");
90 Refresh_Without_Update;
91 Update_Panels; Update_Screen;
95 if K in Special_Key_Code'Range then
97 when QUIT_CODE => exit;
98 when HELP_CODE => Explain_Context;
99 when EXPLAIN_CODE => Explain ("ATTRIBKEYS");
107 Refresh_Without_Update;
109 Update_Panels; Update_Screen;
113 end Sample.Curses_Demo.Attributes;