]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/html/menu_driver.3x.html
ncurses 4.2
[ncurses.git] / Ada95 / html / menu_driver.3x.html
1 <HTML>
2 <BODY BGCOLOR="#99ccbb" TEXT="#000000" LINK="#4060b0" VLINK="#000080" ALINK="#ff4040">
3 <PRE>
4        <STRONG>menu_driver</STRONG> - command-processing loop of the menu system
5
6
7 </PRE>
8 <H2>SYNOPSIS</H2><PRE>
9        <STRONG>#include</STRONG> <STRONG>&lt;menu.h&gt;</STRONG>
10        int menu_driver(MENU *menu, int c);
11
12
13 </PRE>
14 <H2>DESCRIPTION</H2><PRE>
15        Once a menu has been posted (displayed), you should funnel
16        input events to it through <STRONG>menu_driver</STRONG>.  This routine  has
17        two  major input cases; either the input is a menu naviga-
18        tion request or it's a  printable  ASCII  character.   The
19        menu driver requests are as follows:
20
21        REQ_LEFT_ITEM
22             Move left to an item.
23
24        REQ_RIGHT_ITEM
25             Move right to an item.
26
27        REQ_UP_ITEM
28             Move up to an item.
29
30        REQ_DOWN_ITEM
31             Move down to an item.
32
33        REQ_SCR_ULINE
34             Scroll up a line.
35
36        REQ_SCR_DLINE
37             Scroll down a line.
38
39        REQ_SCR_DPAGE
40             Scroll down a page.
41
42        REQ_SCR_UPAGE
43             Scroll up a page.
44
45        REQ_FIRST_ITEM
46             Move to the first item.
47
48        REQ_LAST_ITEM
49             Move to the last item.
50
51        REQ_NEXT_ITEM
52             Move to the next item.
53
54        REQ_PREV_ITEM
55             Move to the previous item.
56
57        REQ_TOGGLE_ITEM
58             Select/deselect an item.
59
60             Clear the menu pattern buffer.
61
62        REQ_BACK_PATTERN
63             Delete   the  previous  character  from  the  pattern
64             buffer.
65
66        REQ_NEXT_MATCH
67             Move to the next item matching the pattern match.
68
69        REQ_PREV_MATCH
70             Move to the previous item matching the pattern match.
71
72        If the second argument is a printable ASCII character, the
73        code appends it to the pattern buffer and attempts to move
74        to the next item matching the new pattern.  If there is no
75        such match, <STRONG>menu_driver</STRONG> returns <STRONG>E_NO_MATCH</STRONG> and deletes the
76        appended character from the buffer.
77
78        If  the  second  argument  is one of the above pre-defined
79        requests, the corresponding action is performed.
80
81        If the second argument is neither printable ASCII nor  one
82        of  the above pre-defined menu requests, the drive assumes
83        it  is  an  application-specific   command   and   returns
84        <STRONG>E_UNKNOWN_COMMAND</STRONG>.  Application-defined commands should be
85        defined relative to  <STRONG>MAX_COMMAND</STRONG>,  the  maximum  value  of
86        these pre-defined requests.
87
88
89 </PRE>
90 <H2>RETURN VALUE</H2><PRE>
91        <STRONG>menu_driver</STRONG> return one of the following error codes:
92
93        <STRONG>E_OK</STRONG> The routine succeeded.
94
95        <STRONG>E_SYSTEM_ERROR</STRONG>
96             System error occurred (see <STRONG>errno</STRONG>).
97
98        <STRONG>E_BAD_ARGUMENT</STRONG>
99             Routine  detected  an incorrect or out-of-range argu-
100             ment.
101
102        <STRONG>E_BAD_STATE</STRONG>
103             Routine was called from an initialization or termina-
104             tion function.
105
106        <STRONG>E_NOT_POSTED</STRONG>
107             The menu has not been posted.
108
109        <STRONG>E_UNKNOWN_COMMAND</STRONG>
110             The menu driver code saw an unknown request code.
111
112        <STRONG>E_NO_MATCH</STRONG>
113             Character failed to match.
114             The menu driver could not process the request.
115
116
117 </PRE>
118 <H2>SEE ALSO</H2><PRE>
119        <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG>, <STRONG><A HREF="menu.3x.html">menu(3X)</A></STRONG>.
120
121
122 </PRE>
123 <H2>NOTES</H2><PRE>
124        The header file <STRONG>&lt;menu.h&gt;</STRONG> automatically includes the header
125        files <STRONG>&lt;curses.h&gt;</STRONG>.
126
127
128 </PRE>
129 <H2>PORTABILITY</H2><PRE>
130        These routines emulate the System V  menu  library.   They
131        were not supported on Version 7 or BSD versions.
132
133
134 </PRE>
135 <H2>AUTHORS</H2><PRE>
136        Juergen  Pfeifer.   Manual  pages  and  adaptation for new
137        curses by Eric S. Raymond.
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174 </PRE>
175 </BODY>
176 </HTML>