1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding Samples --
5 -- Sample.Function_Key_Setting --
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 -- This package implements a simple stack of function key label environments.
32 package Sample.Function_Key_Setting is
34 procedure Push_Environment (Key : in String;
35 Reset : in Boolean := True);
36 -- Push the definition of the current function keys on an internal
37 -- stack. If the reset flag is true, all labels are reset while
38 -- pushed, so the new environment can assume a tabula rasa.
39 -- The Key defines the new Help Context associated with the new
40 -- Environment. This saves also the currently active Notepad.
42 procedure Pop_Environment;
43 -- Pop the Definitions from the stack and make them the current ones.
44 -- This also restores the Help context and the previous Notepad.
46 procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style;
47 Just : Label_Justification := Left);
48 -- Initialize the environment
50 function Context return String;
51 -- Return the current context identitfier
53 function Find_Context (Key : String) return Boolean;
54 -- Look for a context, return true if it is in the stack,
57 procedure Notepad_To_Context (Pan : in Panel);
58 -- Add a panel representing a notepad to the current context.
60 Function_Key_Stack_Error : exception;
62 procedure Default_Labels;
63 -- Set the default labels used in all environments
65 function Notepad_Window return Window;
66 -- Return the current notepad window or Null_Window if there is none.
68 end Sample.Function_Key_Setting;