summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libmenu/m_cursor.c71
-rw-r--r--lib/libmenu/m_driver.c579
-rw-r--r--lib/libmenu/menu.3tbl8
-rw-r--r--lib/libmenu/menu.priv.h14
-rw-r--r--lib/libmenu/menu_attribs.36
-rw-r--r--lib/libmenu/menu_cursor.34
-rw-r--r--lib/libmenu/menu_driver.332
-rw-r--r--lib/libmenu/menu_format.36
-rw-r--r--lib/libmenu/menu_hook.36
-rw-r--r--lib/libmenu/menu_items.34
-rw-r--r--lib/libmenu/menu_mark.36
-rw-r--r--lib/libmenu/menu_new.34
-rw-r--r--lib/libmenu/menu_opts.38
-rw-r--r--lib/libmenu/menu_pattern.34
-rw-r--r--lib/libmenu/menu_post.34
-rw-r--r--lib/libmenu/menu_requestname.34
-rw-r--r--lib/libmenu/menu_spacing.34
-rw-r--r--lib/libmenu/menu_userptr.34
-rw-r--r--lib/libmenu/menu_win.36
-rw-r--r--lib/libmenu/mitem_current.36
-rw-r--r--lib/libmenu/mitem_name.34
-rw-r--r--lib/libmenu/mitem_new.34
-rw-r--r--lib/libmenu/mitem_opts.36
-rw-r--r--lib/libmenu/mitem_userptr.34
-rw-r--r--lib/libmenu/mitem_visible.34
25 files changed, 470 insertions, 332 deletions
diff --git a/lib/libmenu/m_cursor.c b/lib/libmenu/m_cursor.c
index fe4257f5747..5fee9916d5d 100644
--- a/lib/libmenu/m_cursor.c
+++ b/lib/libmenu/m_cursor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m_cursor.c,v 1.4 1998/07/24 16:38:53 millert Exp $ */
+/* $OpenBSD: m_cursor.c,v 1.5 1999/01/22 03:45:06 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -39,53 +39,74 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_cursor.c,v 1.9 1998/02/11 12:13:50 tom Exp $")
+MODULE_ID("$From: m_cursor.c,v 1.11 1998/12/06 04:23:09 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
-| Function : pos_menu_cursor
-|
-| Description : Position logical cursor to current item in menu
+| Facility : libnmenu
+| Function : _nc_menu_cursor_pos
+|
+| Description : Return position of logical cursor to current item
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid menu
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
-int pos_menu_cursor(const MENU * menu)
+int _nc_menu_cursor_pos(const MENU* menu,
+ const ITEM* item,
+ int* pY, int* pX)
{
- if (!menu)
- RETURN(E_BAD_ARGUMENT);
+ if (!menu || !pX || !pY)
+ return(E_BAD_ARGUMENT);
else
{
- ITEM *item;
- int x, y;
- WINDOW *win, *sub;
-
+ if ((ITEM*)0 == item)
+ item = menu->curitem;
+ assert(item!=(ITEM*)0);
+
if ( !( menu->status & _POSTED ) )
- RETURN(E_NOT_POSTED);
-
- item = menu->curitem;
- assert(item);
-
- x = item->x * (menu->spc_cols + menu->itemlen);
- y = (item->y - menu->toprow) * menu->spc_rows;
+ return(E_NOT_POSTED);
+
+ *pX = item->x * (menu->spc_cols + menu->itemlen);
+ *pY = (item->y - menu->toprow) * menu->spc_rows;
+ }
+ return(E_OK);
+}
+
+/*---------------------------------------------------------------------------
+| Facility : libnmenu
+| Function : pos_menu_cursor
+|
+| Description : Position logical cursor to current item in menu
+|
+| Return Values : E_OK - success
+| E_BAD_ARGUMENT - invalid menu
+| E_NOT_POSTED - Menu is not posted
++--------------------------------------------------------------------------*/
+int pos_menu_cursor(const MENU * menu)
+{
+ WINDOW *win, *sub;
+ int x, y;
+ int err = _nc_menu_cursor_pos(menu,(ITEM*)0,&y,&x);
+
+ if (E_OK==err)
+ {
win = menu->userwin ? menu->userwin : stdscr;
sub = menu->usersub ? menu->usersub : win;
assert(win && sub);
-
+
if ((menu->opt & O_SHOWMATCH) && (menu->pindex > 0))
x += ( menu->pindex + menu->marklen - 1);
-
+
wmove(sub,y,x);
-
+
if ( win != sub )
{
wcursyncup(sub);
wsyncup(sub);
untouchwin(sub);
- }
+ }
}
- RETURN(E_OK);
+ RETURN(err);
}
/* m_cursor.c ends here */
diff --git a/lib/libmenu/m_driver.c b/lib/libmenu/m_driver.c
index 8d86f12d36f..1e6b599d7ac 100644
--- a/lib/libmenu/m_driver.c
+++ b/lib/libmenu/m_driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m_driver.c,v 1.4 1998/07/24 16:38:54 millert Exp $ */
+/* $OpenBSD: m_driver.c,v 1.5 1999/01/22 03:45:06 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_driver.c,v 1.10 1998/02/11 12:13:49 tom Exp $")
+MODULE_ID("$From: m_driver.c,v 1.15 1999/01/07 23:23:04 juergen Exp $")
/* Macros */
@@ -53,12 +53,12 @@ MODULE_ID("$From: m_driver.c,v 1.10 1998/02/11 12:13:49 tom Exp $")
(menu)->pattern[(menu)->pindex] = '\0'; }
/*---------------------------------------------------------------------------
-| Facility : libnmenu
-| Function : static bool Is_Sub_String(
+| Facility : libnmenu
+| Function : static bool Is_Sub_String(
| bool IgnoreCaseFlag,
| const char *part,
| const char *string)
-|
+|
| Description : Checks whether or not part is a substring of string.
|
| Return Values : TRUE - if it is a substring
@@ -89,12 +89,12 @@ static bool Is_Sub_String(
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int _nc_Match_Next_Character_In_Item_Name(
| MENU *menu,
| int ch,
| ITEM **item)
-|
+|
| Description : This internal routine is called for a menu positioned
| at an item with three different classes of characters:
| - a printable character; the character is added to
@@ -109,7 +109,7 @@ static bool Is_Sub_String(
| the item where the search starts. On return - if
| a match was found - it contains a pointer to the
| matching item.
-|
+|
| Return Values : E_OK - an item matching the pattern was found
| E_NO_MATCH - nothing found
+--------------------------------------------------------------------------*/
@@ -117,38 +117,38 @@ int _nc_Match_Next_Character_In_Item_Name(MENU *menu, int ch, ITEM **item)
{
bool found = FALSE, passed = FALSE;
int idx, last;
-
+
assert( menu && item && *item);
idx = (*item)->index;
-
+
if (ch && ch!=BS)
{
/* if we become to long, we need no further checking : there can't be
a match ! */
- if ((menu->pindex+1) > menu->namelen)
+ if ((menu->pindex+1) > menu->namelen)
RETURN(E_NO_MATCH);
-
+
Add_Character_To_Pattern(menu,ch);
/* we artificially position one item back, because in the do...while
loop we start with the next item. This means, that with a new
pattern search we always start the scan with the actual item. If
we do a NEXT_PATTERN oder PREV_PATTERN search, we start with the
one after or before the actual item. */
- if (--idx < 0)
+ if (--idx < 0)
idx = menu->nitems-1;
}
-
+
last = idx; /* this closes the cycle */
-
+
do{
if (ch==BS)
{ /* we have to go backward */
- if (--idx < 0)
+ if (--idx < 0)
idx = menu->nitems-1;
}
else
{ /* otherwise we always go forward */
- if (++idx >= menu->nitems)
+ if (++idx >= menu->nitems)
idx = 0;
}
if (Is_Sub_String((menu->opt & O_IGNORECASE) != 0,
@@ -157,9 +157,9 @@ int _nc_Match_Next_Character_In_Item_Name(MENU *menu, int ch, ITEM **item)
)
found = TRUE;
else
- passed = TRUE;
+ passed = TRUE;
} while (!found && (idx != last));
-
+
if (found)
{
if (!((idx==(*item)->index) && passed))
@@ -173,7 +173,7 @@ int _nc_Match_Next_Character_In_Item_Name(MENU *menu, int ch, ITEM **item)
If we searched with an expanded new pattern, we should never reach
this point, because if the expanded pattern matches also the actual
item we will find it in the first attempt (passed==FALSE) and we
- will never cycle through the whole item array.
+ will never cycle through the whole item array.
*/
assert( ch==0 || ch==BS );
}
@@ -184,14 +184,14 @@ int _nc_Match_Next_Character_In_Item_Name(MENU *menu, int ch, ITEM **item)
/* if we had no match with a new pattern, we have to restore it */
Remove_Character_From_Pattern(menu);
}
- }
+ }
RETURN(E_NO_MATCH);
-}
+}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int menu_driver(MENU *menu, int c)
-|
+|
| Description : Central dispatcher for the menu. Translates the logical
| request 'c' into a menu action.
|
@@ -211,238 +211,331 @@ int menu_driver(MENU * menu, int c)
int result = E_OK;
ITEM *item;
int my_top_row, rdiff;
-
+
if (!menu)
RETURN(E_BAD_ARGUMENT);
-
+
if ( menu->status & _IN_DRIVER )
RETURN(E_BAD_STATE);
if ( !( menu->status & _POSTED ) )
RETURN(E_NOT_POSTED);
-
- my_top_row = menu->toprow;
- item = menu->curitem;
- assert(item);
-
- if ((c > KEY_MAX) && (c<=MAX_MENU_COMMAND))
- {
- if (!((c==REQ_BACK_PATTERN)
- || (c==REQ_NEXT_MATCH) || (c==REQ_PREV_MATCH)))
- {
- assert( menu->pattern );
- Reset_Pattern(menu);
- }
-
- switch(c)
- {
- case REQ_LEFT_ITEM:
- /*=================*/
- NAVIGATE(left);
- break;
-
- case REQ_RIGHT_ITEM:
- /*==================*/
- NAVIGATE(right);
- break;
-
- case REQ_UP_ITEM:
- /*===============*/
- NAVIGATE(up);
- break;
-
- case REQ_DOWN_ITEM:
- /*=================*/
- NAVIGATE(down);
- break;
-
- case REQ_SCR_ULINE:
- /*=================*/
- if (my_top_row == 0)
- result = E_REQUEST_DENIED;
- else
- {
- --my_top_row;
- item = item->up;
- }
- break;
-
- case REQ_SCR_DLINE:
- /*=================*/
- my_top_row++;
- if ((menu->rows - menu->arows)>0)
- {
- /* only if the menu has less items than rows, we can deny the
- request. Otherwise the epilogue of this routine adjusts the
- top row if necessary */
- my_top_row--;
+
+ item = menu->curitem;
+
+ my_top_row = menu->toprow;
+ assert(item);
+
+ if ((c > KEY_MAX) && (c<=MAX_MENU_COMMAND))
+ {
+ if (!((c==REQ_BACK_PATTERN)
+ || (c==REQ_NEXT_MATCH) || (c==REQ_PREV_MATCH)))
+ {
+ assert( menu->pattern );
+ Reset_Pattern(menu);
+ }
+
+ switch(c)
+ {
+ case REQ_LEFT_ITEM:
+ /*=================*/
+ NAVIGATE(left);
+ break;
+
+ case REQ_RIGHT_ITEM:
+ /*==================*/
+ NAVIGATE(right);
+ break;
+
+ case REQ_UP_ITEM:
+ /*===============*/
+ NAVIGATE(up);
+ break;
+
+ case REQ_DOWN_ITEM:
+ /*=================*/
+ NAVIGATE(down);
+ break;
+
+ case REQ_SCR_ULINE:
+ /*=================*/
+ if (my_top_row == 0 || !(item->up))
result = E_REQUEST_DENIED;
- }
- else
- item = item->down;
- break;
-
- case REQ_SCR_DPAGE:
- /*=================*/
- rdiff = menu->rows - menu->arows - my_top_row;
- if (rdiff > menu->arows)
- rdiff = menu->arows;
- if (rdiff==0)
- result = E_REQUEST_DENIED;
- else
- {
- my_top_row += rdiff;
- while(rdiff-- > 0)
- item = item->down;
- }
- break;
-
- case REQ_SCR_UPAGE:
- /*=================*/
- rdiff = (menu->arows < my_top_row) ?
- menu->arows : my_top_row;
- if (rdiff==0)
- result = E_REQUEST_DENIED;
- else
- {
- my_top_row -= rdiff;
- while(rdiff--)
+ else
+ {
+ --my_top_row;
item = item->up;
- }
- break;
-
- case REQ_FIRST_ITEM:
- /*==================*/
- item = menu->items[0];
- break;
-
- case REQ_LAST_ITEM:
- /*=================*/
- item = menu->items[menu->nitems-1];
- break;
-
- case REQ_NEXT_ITEM:
- /*=================*/
- if ((item->index+1)>=menu->nitems)
- {
- if (menu->opt & O_NONCYCLIC)
+ }
+ break;
+
+ case REQ_SCR_DLINE:
+ /*=================*/
+ if ((my_top_row + menu->arows >= menu->rows) || !(item->down))
+ {
+ /* only if the menu has less items than rows, we can deny the
+ request. Otherwise the epilogue of this routine adjusts the
+ top row if necessary */
result = E_REQUEST_DENIED;
- else
- item = menu->items[0];
- }
- else
- item = menu->items[item->index + 1];
- break;
-
- case REQ_PREV_ITEM:
- /*=================*/
- if (item->index<=0)
- {
- if (menu->opt & O_NONCYCLIC)
+ }
+ else {
+ my_top_row++;
+ item = item->down;
+ }
+ break;
+
+ case REQ_SCR_DPAGE:
+ /*=================*/
+ rdiff = menu->rows - (menu->arows + my_top_row);
+ if (rdiff > menu->arows)
+ rdiff = menu->arows;
+ if (rdiff<=0)
+ result = E_REQUEST_DENIED;
+ else
+ {
+ my_top_row += rdiff;
+ while(rdiff-- > 0 && item!=(ITEM*)0)
+ item = item->down;
+ }
+ break;
+
+ case REQ_SCR_UPAGE:
+ /*=================*/
+ rdiff = (menu->arows < my_top_row) ? menu->arows : my_top_row;
+ if (rdiff<=0)
+ result = E_REQUEST_DENIED;
+ else
+ {
+ my_top_row -= rdiff;
+ while(rdiff-- && item!=(ITEM*)0)
+ item = item->up;
+ }
+ break;
+
+ case REQ_FIRST_ITEM:
+ /*==================*/
+ item = menu->items[0];
+ break;
+
+ case REQ_LAST_ITEM:
+ /*=================*/
+ item = menu->items[menu->nitems-1];
+ break;
+
+ case REQ_NEXT_ITEM:
+ /*=================*/
+ if ((item->index+1)>=menu->nitems)
+ {
+ if (menu->opt & O_NONCYCLIC)
+ result = E_REQUEST_DENIED;
+ else
+ item = menu->items[0];
+ }
+ else
+ item = menu->items[item->index + 1];
+ break;
+
+ case REQ_PREV_ITEM:
+ /*=================*/
+ if (item->index<=0)
+ {
+ if (menu->opt & O_NONCYCLIC)
+ result = E_REQUEST_DENIED;
+ else
+ item = menu->items[menu->nitems-1];
+ }
+ else
+ item = menu->items[item->index - 1];
+ break;
+
+ case REQ_TOGGLE_ITEM:
+ /*===================*/
+ if (menu->opt & O_ONEVALUE)
+ {
result = E_REQUEST_DENIED;
- else
- item = menu->items[menu->nitems-1];
- }
- else
- item = menu->items[item->index - 1];
- break;
-
- case REQ_TOGGLE_ITEM:
- /*===================*/
- if (menu->opt & O_ONEVALUE)
- {
+ }
+ else
+ {
+ if (menu->curitem->opt & O_SELECTABLE)
+ {
+ menu->curitem->value = !menu->curitem->value;
+ Move_And_Post_Item(menu,menu->curitem);
+ _nc_Show_Menu(menu);
+ }
+ else
+ result = E_NOT_SELECTABLE;
+ }
+ break;
+
+ case REQ_CLEAR_PATTERN:
+ /*=====================*/
+ /* already cleared in prologue */
+ break;
+
+ case REQ_BACK_PATTERN:
+ /*====================*/
+ if (menu->pindex>0)
+ {
+ assert(menu->pattern);
+ Remove_Character_From_Pattern(menu);
+ pos_menu_cursor( menu );
+ }
+ else
result = E_REQUEST_DENIED;
- }
- else
- {
- if (menu->curitem->opt & O_SELECTABLE)
- {
- menu->curitem->value = !menu->curitem->value;
- Move_And_Post_Item(menu,menu->curitem);
- _nc_Show_Menu(menu);
- }
- else
- result = E_NOT_SELECTABLE;
- }
- break;
-
- case REQ_CLEAR_PATTERN:
- /*=====================*/
- /* already cleared in prologue */
- break;
-
- case REQ_BACK_PATTERN:
- /*====================*/
- if (menu->pindex>0)
- {
- assert(menu->pattern);
- Remove_Character_From_Pattern(menu);
- pos_menu_cursor( menu );
- }
- else
- result = E_REQUEST_DENIED;
- break;
-
- case REQ_NEXT_MATCH:
- /*==================*/
- assert(menu->pattern);
- if (menu->pattern[0])
- result = _nc_Match_Next_Character_In_Item_Name(menu,0,&item);
- else
- {
- if ((item->index+1)<menu->nitems)
- item=menu->items[item->index+1];
- else
- {
- if (menu->opt & O_NONCYCLIC)
- result = E_REQUEST_DENIED;
- else
- item = menu->items[0];
- }
- }
- break;
-
- case REQ_PREV_MATCH:
- /*==================*/
- assert(menu->pattern);
- if (menu->pattern[0])
- result = _nc_Match_Next_Character_In_Item_Name(menu,BS,&item);
- else
- {
- if (item->index)
- item = menu->items[item->index-1];
- else
- {
- if (menu->opt & O_NONCYCLIC)
- result = E_REQUEST_DENIED;
- else
- item = menu->items[menu->nitems-1];
- }
- }
- break;
-
- default:
- /*======*/
+ break;
+
+ case REQ_NEXT_MATCH:
+ /*==================*/
+ assert(menu->pattern);
+ if (menu->pattern[0])
+ result = _nc_Match_Next_Character_In_Item_Name(menu,0,&item);
+ else
+ {
+ if ((item->index+1)<menu->nitems)
+ item=menu->items[item->index+1];
+ else
+ {
+ if (menu->opt & O_NONCYCLIC)
+ result = E_REQUEST_DENIED;
+ else
+ item = menu->items[0];
+ }
+ }
+ break;
+
+ case REQ_PREV_MATCH:
+ /*==================*/
+ assert(menu->pattern);
+ if (menu->pattern[0])
+ result = _nc_Match_Next_Character_In_Item_Name(menu,BS,&item);
+ else
+ {
+ if (item->index)
+ item = menu->items[item->index-1];
+ else
+ {
+ if (menu->opt & O_NONCYCLIC)
+ result = E_REQUEST_DENIED;
+ else
+ item = menu->items[menu->nitems-1];
+ }
+ }
+ break;
+
+ default:
+ /*======*/
+ result = E_UNKNOWN_COMMAND;
+ break;
+ }
+ }
+ else
+ { /* not a command */
+ if ( !(c & ~((int)MAX_REGULAR_CHARACTER)) && isprint(c) )
+ result = _nc_Match_Next_Character_In_Item_Name( menu, c, &item );
+#ifdef NCURSES_MOUSE_VERSION
+ else if (KEY_MOUSE == c)
+ {
+ MEVENT event;
+ WINDOW* uwin = Get_Menu_UserWin(menu);
+
+ getmouse(&event);
+ if ((event.bstate & (BUTTON1_CLICKED |
+ BUTTON1_DOUBLE_CLICKED |
+ BUTTON1_TRIPLE_CLICKED ))
+ && wenclose(uwin,event.y, event.x))
+ { /* we react only if the click was in the userwin, that means
+ * inside the menu display area or at the decoration window.
+ */
+ WINDOW* sub = Get_Menu_Window(menu);
+ int ry = event.y, rx = event.x; /* screen coordinates */
+
+ result = E_REQUEST_DENIED;
+ if (mouse_trafo(&ry,&rx,FALSE))
+ { /* rx, ry are now "curses" coordinates */
+ if (ry < sub->_begy)
+ { /* we clicked above the display region; this is
+ * interpreted as "scroll up" request
+ */
+ if (event.bstate & BUTTON1_CLICKED)
+ result = menu_driver(menu,REQ_SCR_ULINE);
+ else if (event.bstate & BUTTON1_DOUBLE_CLICKED)
+ result = menu_driver(menu,REQ_SCR_UPAGE);
+ else if (event.bstate & BUTTON1_TRIPLE_CLICKED)
+ result = menu_driver(menu,REQ_FIRST_ITEM);
+ RETURN(result);
+ }
+ else if (ry >= sub->_begy + sub->_maxy)
+ { /* we clicked below the display region; this is
+ * interpreted as "scroll down" request
+ */
+ if (event.bstate & BUTTON1_CLICKED)
+ result = menu_driver(menu,REQ_SCR_DLINE);
+ else if (event.bstate & BUTTON1_DOUBLE_CLICKED)
+ result = menu_driver(menu,REQ_SCR_DPAGE);
+ else if (event.bstate & BUTTON1_TRIPLE_CLICKED)
+ result = menu_driver(menu,REQ_LAST_ITEM);
+ RETURN(result);
+ }
+ else if (wenclose(sub,event.y,event.x))
+ { /* Inside the area we try to find the hit item */
+ int i,x,y,err;
+ ry = event.y; rx = event.x;
+ if (wmouse_trafo(sub,&ry,&rx,FALSE))
+ {
+ for(i=0;i<menu->nitems;i++)
+ {
+ err = _nc_menu_cursor_pos(menu,menu->items[i],
+ &y, &x);
+ if (E_OK==err)
+ {
+ if ((ry==y) &&
+ (rx>=x) &&
+ (rx < x + menu->itemlen))
+ {
+ item = menu->items[i];
+ result = E_OK;
+ break;
+ }
+ }
+ }
+ if (E_OK==result)
+ { /* We found an item, now we can handle the click.
+ * A single click just positions the menu cursor
+ * to the clicked item. A double click toggles
+ * the item.
+ */
+ if (event.bstate & BUTTON1_DOUBLE_CLICKED)
+ {
+ _nc_New_TopRow_and_CurrentItem(menu,
+ my_top_row,
+ item);
+ menu_driver(menu,REQ_TOGGLE_ITEM);
+ result = E_UNKNOWN_COMMAND;
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ result = E_REQUEST_DENIED;
+ }
+#endif /* NCURSES_MOUSE_VERSION */
+ else
result = E_UNKNOWN_COMMAND;
- break;
- }
- }
- else
- { /* not a command */
- if ( !(c & ~((int)MAX_REGULAR_CHARACTER)) && isprint(c) )
- result = _nc_Match_Next_Character_In_Item_Name( menu, c, &item );
- else
- result = E_UNKNOWN_COMMAND;
+ }
+
+ if (E_OK==result)
+ {
+ /* Adjust the top row if it turns out that the current item unfortunately
+ doesn't appear in the menu window */
+ if ( item->y < my_top_row )
+ my_top_row = item->y;
+ else if ( item->y >= (my_top_row + menu->arows) )
+ my_top_row = item->y - menu->arows + 1;
+
+ _nc_New_TopRow_and_CurrentItem( menu, my_top_row, item );
+
}
-
- /* Adjust the top row if it turns out that the current item unfortunately
- doesn't appear in the menu window */
- if ( item->y < my_top_row )
- my_top_row = item->y;
- else if ( item->y >= (my_top_row + menu->arows) )
- my_top_row = item->y - menu->arows + 1;
-
- _nc_New_TopRow_and_CurrentItem( menu, my_top_row, item );
-
+
RETURN(result);
}
diff --git a/lib/libmenu/menu.3tbl b/lib/libmenu/menu.3tbl
index 76bdfe4e4fe..01e1e36b1c0 100644
--- a/lib/libmenu/menu.3tbl
+++ b/lib/libmenu/menu.3tbl
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu.3tbl,v 1.3 1998/09/17 04:14:44 millert Exp $
+.\" $OpenBSD: menu.3tbl,v 1.4 1999/01/22 03:45:06 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu.3x,v 1.12 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu.3x,v 1.13 1998/11/29 01:09:07 Rick.Ohnemus Exp $
.TH menu 3 ""
.SH NAME
\fBmenu\fR - curses extension for programming menus
@@ -44,7 +44,7 @@ menus, display menus on the screen, and handle interaction with the user.
The \fBmenu\fR library uses the \fBcurses\fR libraries, and a curses
initialization routine such as \fBinitscr\fR must be called before using any of
-these functions. To use the \fBmenu\fR library, link with the options
+these functions. To use the \fBmenu\fR library, link with the options
\fB-lmenu -lcurses\fR.
.SS Current Default Values for Item Attributes
@@ -60,7 +60,7 @@ rendering of items already created.
The following table lists each \fBmenu\fR routine and the name of
the manual page on which it is described.
-.TS
+.TS
l l .
\fBcurses\fR Routine Name Manual Page Name
=
diff --git a/lib/libmenu/menu.priv.h b/lib/libmenu/menu.priv.h
index 11038ae1ea7..45eb1c1ff03 100644
--- a/lib/libmenu/menu.priv.h
+++ b/lib/libmenu/menu.priv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: menu.priv.h,v 1.4 1998/07/24 16:39:24 millert Exp $ */
+/* $OpenBSD: menu.priv.h,v 1.5 1999/01/22 03:45:06 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -52,10 +52,12 @@ extern MENU _nc_Default_Menu;
/* Normalize menu to default if none was given */
#define Normalize_Menu( menu ) ((menu)=(menu)?(menu):&_nc_Default_Menu)
+/* Get the user defined (framing) window of the menu */
+#define Get_Menu_UserWin(menu) ((menu)->userwin ? (menu)->userwin : stdscr)
+
/* Normalize menu window */
#define Get_Menu_Window( menu ) \
- ( (menu)->usersub ? (menu)->usersub : (\
- (menu)->userwin ? (menu)->userwin : stdscr ))
+ ((menu)->usersub ? (menu)->usersub : Get_Menu_UserWin(menu))
/* menu specific status flags */
#define _LINK_NEEDED (0x04)
@@ -85,7 +87,7 @@ extern MENU _nc_Default_Menu;
/* This macro ensures, that the item becomes visible, if possible with the
specified row as the top row of the window. If this is not possible,
- the top row will be adjusted and the value is stored in the row argument.
+ the top row will be adjusted and the value is stored in the row argument.
*/
#define Adjust_Current_Item(menu,row,item) \
{ if ((item)->y < row) \
@@ -100,7 +102,7 @@ extern MENU _nc_Default_Menu;
{ (menu)->pindex = 0; \
(menu)->pattern[0] = '\0'; }
-/* Internal functions. */
+/* Internal functions. */
extern void _nc_Draw_Menu(const MENU *);
extern void _nc_Show_Menu(const MENU *);
extern void _nc_Calculate_Item_Length_and_Width(MENU *);
@@ -110,3 +112,5 @@ extern void _nc_Disconnect_Items(MENU *);
extern void _nc_New_TopRow_and_CurrentItem(MENU *,int, ITEM *);
extern void _nc_Link_Items(MENU *);
extern int _nc_Match_Next_Character_In_Item_Name(MENU*,int,ITEM**);
+extern int _nc_menu_cursor_pos(const MENU* menu, const ITEM* item,
+ int* pY, int* pX);
diff --git a/lib/libmenu/menu_attribs.3 b/lib/libmenu/menu_attribs.3
index 558ff8733cd..47389609262 100644
--- a/lib/libmenu/menu_attribs.3
+++ b/lib/libmenu/menu_attribs.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_attribs.3,v 1.5 1998/09/17 04:14:44 millert Exp $
+.\" $OpenBSD: menu_attribs.3,v 1.6 1999/01/22 03:45:06 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_attribs.3x,v 1.5 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_attribs.3x,v 1.6 1998/11/29 01:09:20 Rick.Ohnemus Exp $
.TH menu_attributes 3 ""
.SH NAME
\fBmenu_attributes\fR - color and attribute control for menus
@@ -83,7 +83,7 @@ System error occurred (see \fBerrno\fR).
\fBE_BAD_ARGUMENT\fR
Routine detected an incorrect or out-of-range argument.
.SH SEE ALSO
-\fBcurses\fR(3) and 3 pages whose names begin "menu_" for detailed
+\fBcurses\fR(3) and 3 pages whose names begin with "menu_" for detailed
descriptions of the entry points.
.SH NOTES
The header file \fB<menu.h>\fR automatically includes the header file
diff --git a/lib/libmenu/menu_cursor.3 b/lib/libmenu/menu_cursor.3
index 3ca5e7df717..ce4599d2fbc 100644
--- a/lib/libmenu/menu_cursor.3
+++ b/lib/libmenu/menu_cursor.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_cursor.3,v 1.5 1998/09/17 04:14:44 millert Exp $
+.\" $OpenBSD: menu_cursor.3,v 1.6 1999/01/22 03:45:06 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_cursor.3x,v 1.4 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_cursor.3x,v 1.5 1998/11/29 01:09:30 Rick.Ohnemus Exp $
.TH menu_cursor 3 ""
.SH NAME
\fBmenu_cursor\fR - position a menu's cursor
diff --git a/lib/libmenu/menu_driver.3 b/lib/libmenu/menu_driver.3
index 2f544bec037..249d18d0d0e 100644
--- a/lib/libmenu/menu_driver.3
+++ b/lib/libmenu/menu_driver.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: menu_driver.3,v 1.4 1998/07/24 16:39:27 millert Exp $
+.\" $OpenBSD: menu_driver.3,v 1.5 1999/01/22 03:45:06 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -28,7 +28,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.'" $From: menu_driver.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $
+.'" $From: menu_driver.3x,v 1.8 1999/01/09 22:55:18 tom Exp $
.TH menu_driver 3 ""
.SH NAME
\fBmenu_driver\fR - command-processing loop of the menu system
@@ -39,8 +39,9 @@ int menu_driver(MENU *menu, int c);
.br
.SH DESCRIPTION
Once a menu has been posted (displayed), you should funnel input events to it
-through \fBmenu_driver\fR. This routine has two major input cases; either
-the input is a menu navigation request or it's a printable ASCII character.
+through \fBmenu_driver\fR. This routine has three major input cases; either
+the input is a menu navigation request, it's a printable ASCII character or it
+is the KEY_MOUSE special key associated with an mouse event.
The menu driver requests are as follows:
.TP 5
REQ_LEFT_ITEM
@@ -102,8 +103,27 @@ the new pattern. If there is no such match, \fBmenu_driver\fR returns
If the second argument is one of the above pre-defined requests, the
corresponding action is performed.
.PP
+If the second argument is the KEY_MOUSE special key, the associated
+mouse event is translated into one of the above pre-defined requests.
+Currently only clicks in the user window (e.g. inside the menu display
+area or the decoration window) are handled. If you click above the
+display region of the menu, a REQ_SCR_ULINE is generated, if you
+doubleclick a REQ_SCR_UPAGE is generated and if you tripleclick a
+REQ_FIRST_ITEM is generated. If you click below the display region of
+the menu, a REQ_SCR_DLINE is generated, if you doubleclick a REQ_SCR_DPAGE
+is generated and if you tripleclick a REQ_LAST_ITEM is generated. If you
+click at an item inside the display area of the menu, the menu cursor
+is positioned to that item. If you double-click at an item a REQ_TOGGLE_ITEM
+is generated and \fBE_UNKNOWN_COMMAND\fR is returned. This return value makes
+sense, because a double click usually means that an item-specific action should
+be returned. It's exactly the purpose of this return value to signal that an
+application specific command should be executed. If a translation
+into a request was done, \fBmenu_driver\fR returns the result of this request.
+If you clicked outside the user window or the mouse event couldn't be translated
+into a menu request an \fBE_REQUEST_DENIED\fR is returned.
+.PP
If the second argument is neither printable ASCII nor one of the above
-pre-defined menu requests, the drive assumes it is an application-specific
+pre-defined menu requests or KEY_MOUSE, the drive assumes it is an application-specific
command and returns \fBE_UNKNOWN_COMMAND\fR. Application-defined commands
should be defined relative to \fBMAX_COMMAND\fR, the maximum value of these
pre-defined requests.
@@ -140,7 +160,7 @@ The header file \fB<menu.h>\fR automatically includes the header files
\fB<curses.h>\fR.
.SH PORTABILITY
These routines emulate the System V menu library. They were not supported on
-Version 7 or BSD versions.
+Version 7 or BSD versions. The support for mouse events is ncurses specific.
.SH AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric
S. Raymond.
diff --git a/lib/libmenu/menu_format.3 b/lib/libmenu/menu_format.3
index 7e7838c5d5a..2ea075b1585 100644
--- a/lib/libmenu/menu_format.3
+++ b/lib/libmenu/menu_format.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_format.3,v 1.5 1998/09/17 04:14:44 millert Exp $
+.\" $OpenBSD: menu_format.3,v 1.6 1999/01/22 03:45:06 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_format.3x,v 1.6 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_format.3x,v 1.7 1998/11/29 01:09:39 Rick.Ohnemus Exp $
.TH menu_format 3 ""
.SH NAME
\fBmenu_format\fR - set and get menu sizes
@@ -50,7 +50,7 @@ The default format is 16 rows, 1 column. Calling \fBset_menu_format\fR with a
null menu pointer will change this default. A zero row or column argument to
\fBset_menu_format\fR is interpreted as a request not to change the current
value.
-
+
The function \fBmenu_format\fR returns the maximum-size constraints for the
given menu into the storage addressed by \fBrows\fR and \fBcols\fR.
.SH RETURN VALUE
diff --git a/lib/libmenu/menu_hook.3 b/lib/libmenu/menu_hook.3
index 7289191612a..88066b67a4f 100644
--- a/lib/libmenu/menu_hook.3
+++ b/lib/libmenu/menu_hook.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_hook.3,v 1.5 1998/09/17 04:14:45 millert Exp $
+.\" $OpenBSD: menu_hook.3,v 1.6 1999/01/22 03:45:06 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_hook.3x,v 1.5 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_hook.3x,v 1.6 1998/11/29 01:09:47 Rick.Ohnemus Exp $
.TH menu_hook 3 ""
.SH NAME
\fBmenu_hook\fR - set hooks for automatic invocation by applications
@@ -54,7 +54,7 @@ void (*)(MENU *) menu_term(const MENU *menu);
.br
.SH DESCRIPTION
These functions make it possible to set hook functions to be called at various
-points in the automatic processing of input event codes by \fBmenu_driver\fR.
+points in the automatic processing of input event codes by \fBmenu_driver\fR.
The function \fBset_item_init\fR sets a hook to be called at menu-post time and
each time the selected item changes (after the change). \fBitem_init\fR
diff --git a/lib/libmenu/menu_items.3 b/lib/libmenu/menu_items.3
index 4938cfd6c84..9adac1f204d 100644
--- a/lib/libmenu/menu_items.3
+++ b/lib/libmenu/menu_items.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_items.3,v 1.5 1998/09/17 04:14:45 millert Exp $
+.\" $OpenBSD: menu_items.3,v 1.6 1999/01/22 03:45:06 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_items.3x,v 1.4 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_items.3x,v 1.5 1998/11/29 01:09:56 Rick.Ohnemus Exp $
.TH menu_items 3 ""
.SH NAME
\fBmenu_items\fR - make and break connections between items and menus
diff --git a/lib/libmenu/menu_mark.3 b/lib/libmenu/menu_mark.3
index b802ff98ed8..3ff7a47c64c 100644
--- a/lib/libmenu/menu_mark.3
+++ b/lib/libmenu/menu_mark.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_mark.3,v 1.5 1998/09/17 04:14:45 millert Exp $
+.\" $OpenBSD: menu_mark.3,v 1.6 1999/01/22 03:45:06 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_mark.3x,v 1.5 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_mark.3x,v 1.6 1998/11/29 01:10:03 Rick.Ohnemus Exp $
.TH menu_mark 3 ""
.SH NAME
\fBmenu_mark\fR - get and set the menu mark string
@@ -43,7 +43,7 @@ const char *menu_mark(const MENU *menu);
.SH DESCRIPTION
In order to make menu selections visible on older terminals without
highlighting or color capability, the menu library marks selected items
-in a menu with a prefix string.
+in a menu with a prefix string.
The function \fBset_menu_mark\fR sets the mark string for the given menu.
Calling \fBset_menu_mark\fR with a null menu item will abolish the mark string.
diff --git a/lib/libmenu/menu_new.3 b/lib/libmenu/menu_new.3
index 6a3c6efeba0..8a18206c584 100644
--- a/lib/libmenu/menu_new.3
+++ b/lib/libmenu/menu_new.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_new.3,v 1.5 1998/09/17 04:14:45 millert Exp $
+.\" $OpenBSD: menu_new.3,v 1.6 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_new.3x,v 1.6 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_new.3x,v 1.7 1998/11/29 01:10:13 Rick.Ohnemus Exp $
.TH menu_new 3 ""
.SH NAME
\fBmenu_new\fR - create and destroy menus
diff --git a/lib/libmenu/menu_opts.3 b/lib/libmenu/menu_opts.3
index 36beef89b2a..3e6f1c48a35 100644
--- a/lib/libmenu/menu_opts.3
+++ b/lib/libmenu/menu_opts.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_opts.3,v 1.5 1998/09/17 04:14:46 millert Exp $
+.\" $OpenBSD: menu_opts.3,v 1.6 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_opts.3x,v 1.6 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_opts.3x,v 1.7 1998/11/29 01:10:21 Rick.Ohnemus Exp $
.TH menu_opts 3 ""
.SH NAME
\fBmenu_opts\fR - set and get menu options
@@ -54,7 +54,7 @@ others alone.
The function \fBmenu_opts_off\fR turns off the given option bits, and leaves
others alone.
-The function \fBmenu_opts\fR returns the menu's current option bits.
+The function \fBmenu_opts\fR returns the menu's current option bits.
The following options are defined (all are on by default):
.TP 5
@@ -73,7 +73,7 @@ Ignore the case when pattern-matching.
O_SHOWMATCH
Move the cursor to within the item name while pattern-matching.
.TP 5
-O_NONCYCLIC
+O_NONCYCLIC
Don't wrap around next-item and previous-item,
requests to the other end of the menu.
.SH RETURN VALUE
diff --git a/lib/libmenu/menu_pattern.3 b/lib/libmenu/menu_pattern.3
index 9a0b79d26ce..63240fc886a 100644
--- a/lib/libmenu/menu_pattern.3
+++ b/lib/libmenu/menu_pattern.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: menu_pattern.3,v 1.4 1998/07/24 16:39:35 millert Exp $
+.\" $OpenBSD: menu_pattern.3,v 1.5 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -46,7 +46,7 @@ and tested for a match, as described in \fBmenu_driver\fR(3).
The function \fBset_menu_pattern\fR sets the pattern buffer for the given menu
and tries to find the first matching item. If it succeeds, that item becomes
-current; if not, the current item does not change.
+current; if not, the current item does not change.
The function \fBmenu_pattern\fR returns the pattern buffer of the given
\fImenu\fR.
diff --git a/lib/libmenu/menu_post.3 b/lib/libmenu/menu_post.3
index 5cb187f3c59..24d2ee641bc 100644
--- a/lib/libmenu/menu_post.3
+++ b/lib/libmenu/menu_post.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_post.3,v 1.5 1998/09/17 04:14:46 millert Exp $
+.\" $OpenBSD: menu_post.3,v 1.6 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_post.3x,v 1.6 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_post.3x,v 1.7 1998/11/29 01:10:33 Rick.Ohnemus Exp $
.TH menu_post 3 ""
.SH NAME
\fBmenu_post\fR - write or erase menus from associated subwindows
diff --git a/lib/libmenu/menu_requestname.3 b/lib/libmenu/menu_requestname.3
index f42beb286a1..58d815c3bfb 100644
--- a/lib/libmenu/menu_requestname.3
+++ b/lib/libmenu/menu_requestname.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_requestname.3,v 1.4 1998/09/17 04:14:46 millert Exp $
+.\" $OpenBSD: menu_requestname.3,v 1.5 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_requestname.3x,v 1.5 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_requestname.3x,v 1.6 1998/11/29 01:10:40 Rick.Ohnemus Exp $
.TH menu_requestname 3 ""
.SH NAME
\fBmenu_requestname\fR - handle printable menu request names
diff --git a/lib/libmenu/menu_spacing.3 b/lib/libmenu/menu_spacing.3
index 174121c2f2e..e000a3c13fc 100644
--- a/lib/libmenu/menu_spacing.3
+++ b/lib/libmenu/menu_spacing.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_spacing.3,v 1.4 1998/09/17 04:14:46 millert Exp $
+.\" $OpenBSD: menu_spacing.3,v 1.5 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_spacing.3x,v 1.4 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_spacing.3x,v 1.5 1998/11/29 01:10:51 Rick.Ohnemus Exp $
.TH menu_spacing 3 ""
.SH NAME
\fBmenu_spacing\fR - Control spacing between menu items.
diff --git a/lib/libmenu/menu_userptr.3 b/lib/libmenu/menu_userptr.3
index 4ab172ad824..38e33fa9e44 100644
--- a/lib/libmenu/menu_userptr.3
+++ b/lib/libmenu/menu_userptr.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_userptr.3,v 1.5 1998/09/17 04:14:46 millert Exp $
+.\" $OpenBSD: menu_userptr.3,v 1.6 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_userptr.3x,v 1.5 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_userptr.3x,v 1.6 1998/11/29 01:11:02 Rick.Ohnemus Exp $
.TH menu_userptr 3 ""
.SH NAME
\fBmenu_userptr\fR - associate application data with a menu item
diff --git a/lib/libmenu/menu_win.3 b/lib/libmenu/menu_win.3
index e71a9df27e4..b21d77e18ab 100644
--- a/lib/libmenu/menu_win.3
+++ b/lib/libmenu/menu_win.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: menu_win.3,v 1.5 1998/09/17 04:14:46 millert Exp $
+.\" $OpenBSD: menu_win.3,v 1.6 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: menu_win.3x,v 1.5 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: menu_win.3x,v 1.6 1998/11/29 01:11:11 Rick.Ohnemus Exp $
.TH menu_win 3 ""
.SH NAME
\fBmenu_win\fR - make and break menu window and subwindow associations
@@ -59,7 +59,7 @@ it were \fBstsdcr\fR. A menu argument of \fBNULL\fR is treated as a request
to change the system default menu window or subwindow.
The function \fBscale_menu\fR returns the minimum size required for the
-subwindow of \fImenu\fR.
+subwindow of \fImenu\fR.
.SH RETURN VALUE
Routines that return pointers return \fBNULL\fR on error. Routines that return
an integer return one of the following error codes:
diff --git a/lib/libmenu/mitem_current.3 b/lib/libmenu/mitem_current.3
index 798d2803f3a..811c04a65d4 100644
--- a/lib/libmenu/mitem_current.3
+++ b/lib/libmenu/mitem_current.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: mitem_current.3,v 1.3 1998/09/17 04:14:46 millert Exp $
+.\" $OpenBSD: mitem_current.3,v 1.4 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: mitem_current.3x,v 1.7 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: mitem_current.3x,v 1.9 1998/12/26 19:52:34 tom Exp $
.TH mitem_current 3 ""
.SH NAME
\fBmitem_current\fR - set and get current_menu_item
@@ -62,7 +62,7 @@ the menu's item pointer list.
.SH RETURN VALUE
\fBcurrent_item\fR returns \fBNULL\fR on error.
-\fBtop_row\fR and \fBitem_index\fR return \fBERR\fR (the general \fBcurses\fB
+\fBtop_row\fR and \fBitem_index\fR return \fBERR\fR (the general \fBcurses\fR
error value) on error.
\fBset_current_item\fR and \fBset_top_row\fR return one of the following:
diff --git a/lib/libmenu/mitem_name.3 b/lib/libmenu/mitem_name.3
index 2040114dd50..80af3095b49 100644
--- a/lib/libmenu/mitem_name.3
+++ b/lib/libmenu/mitem_name.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: mitem_name.3,v 1.3 1998/09/17 04:14:46 millert Exp $
+.\" $OpenBSD: mitem_name.3,v 1.4 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: mitem_name.3x,v 1.4 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: mitem_name.3x,v 1.5 1998/11/29 01:11:29 Rick.Ohnemus Exp $
.TH mitem_name 3 ""
.SH NAME
\fBmitem_name\fR - get menu item name and description fields
diff --git a/lib/libmenu/mitem_new.3 b/lib/libmenu/mitem_new.3
index 90937f53e99..2d97ab08481 100644
--- a/lib/libmenu/mitem_new.3
+++ b/lib/libmenu/mitem_new.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: mitem_new.3,v 1.3 1998/09/17 04:14:47 millert Exp $
+.\" $OpenBSD: mitem_new.3,v 1.4 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: mitem_new.3x,v 1.6 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: mitem_new.3x,v 1.7 1998/11/29 01:11:38 Rick.Ohnemus Exp $
.TH mitem_new 3 ""
.SH NAME
\fBmitem_new\fR - create and destroy menu items
diff --git a/lib/libmenu/mitem_opts.3 b/lib/libmenu/mitem_opts.3
index bbf39d13347..368d181f9cf 100644
--- a/lib/libmenu/mitem_opts.3
+++ b/lib/libmenu/mitem_opts.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: mitem_opts.3,v 1.3 1998/09/17 04:14:47 millert Exp $
+.\" $OpenBSD: mitem_opts.3,v 1.4 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: mitem_opts.3x,v 1.5 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: mitem_opts.3x,v 1.6 1998/11/29 01:12:37 Rick.Ohnemus Exp $
.TH mitem_opts 3 ""
.SH NAME
\fBmitem_opts\fR - set and get menu item options
@@ -54,7 +54,7 @@ others alone.
The function \fBitem_opts_off\fR turns off the given option bits, and leaves
others alone.
-The function \fBitem_opts\fR returns the item's current option bits.
+The function \fBitem_opts\fR returns the item's current option bits.
There is only one defined option bit mask, \fBO_SELECTABLE\fR. When this is
on, the item may be selected during menu processing. This option defaults
diff --git a/lib/libmenu/mitem_userptr.3 b/lib/libmenu/mitem_userptr.3
index 6fe54507438..db4c0dd67b7 100644
--- a/lib/libmenu/mitem_userptr.3
+++ b/lib/libmenu/mitem_userptr.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: mitem_userptr.3,v 1.3 1998/09/17 04:14:47 millert Exp $
+.\" $OpenBSD: mitem_userptr.3,v 1.4 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: mitem_userptr.3x,v 1.5 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: mitem_userptr.3x,v 1.6 1998/11/29 01:12:47 Rick.Ohnemus Exp $
.TH mitem_userptr 3 ""
.SH NAME
\fBmitem_userptr\fR - associate application data with a menu item
diff --git a/lib/libmenu/mitem_visible.3 b/lib/libmenu/mitem_visible.3
index 1fbc5c97495..55531f4d726 100644
--- a/lib/libmenu/mitem_visible.3
+++ b/lib/libmenu/mitem_visible.3
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: mitem_visible.3,v 1.3 1998/09/17 04:14:47 millert Exp $
+.\" $OpenBSD: mitem_visible.3,v 1.4 1999/01/22 03:45:07 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: mitem_visible.3x,v 1.4 1998/08/27 21:21:04 Rick.Ohnemus Exp $
+.\" $From: mitem_visible.3x,v 1.5 1998/11/29 01:12:55 Rick.Ohnemus Exp $
.TH mitem_visible 3 ""
.SH NAME
\fBmitem_visible\fR - check visibility of a menu item