/****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include "menu.priv.h"
-MODULE_ID("$Id: m_post.c,v 1.26 2004/12/25 23:57:04 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.31 2012/06/09 23:54:35 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
- it is a onevalued menu and it is the current item
- or it has a selection value
*/
- wattron(menu->win, menu->back);
+ wattron(menu->win, (int)menu->back);
if (item->value || (item == menu->curitem))
{
if (menu->marklen)
item. */
if (!(menu->opt & O_ONEVALUE) && item->value && item != menu->curitem)
{
- wattron(menu->win, menu->fore);
+ wattron(menu->win, (int)menu->fore);
isfore = TRUE;
}
waddstr(menu->win, menu->mark);
if (isfore)
{
- wattron(menu->win, menu->fore);
+ wattron(menu->win, (int)menu->fore);
isfore = FALSE;
}
}
else /* otherwise we have to wipe out the marker area */
for (ch = ' ', i = menu->marklen; i > 0; i--)
waddch(menu->win, ch);
- wattroff(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->back);
count += menu->marklen;
/* First we have to calculate the attribute depending on selectability
*/
if (!(item->opt & O_SELECTABLE))
{
- wattron(menu->win, menu->grey);
+ wattron(menu->win, (int)menu->grey);
isgrey = TRUE;
}
else
{
if (item->value || item == menu->curitem)
{
- wattron(menu->win, menu->fore);
+ wattron(menu->win, (int)menu->fore);
isfore = TRUE;
}
else
{
- wattron(menu->win, menu->back);
+ wattron(menu->win, (int)menu->back);
isback = TRUE;
}
}
assert(cx >= 0 && cy >= 0);
getyx(menu->win, ncy, ncx);
if (isgrey)
- wattroff(menu->win, menu->grey);
+ wattroff(menu->win, (int)menu->grey);
else if (isfore)
- wattroff(menu->win, menu->fore);
- wattron(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->fore);
+ wattron(menu->win, (int)menu->back);
for (j = 1; j < menu->spc_rows; j++)
{
if ((item_y + j) < getmaxy(menu->win))
waddch(menu->win, ' ');
}
if ((cy + j) < getmaxy(menu->win))
- mvwaddch(menu->win, cy + j, cx - 1, menu->pad);
+ (void)mvwaddch(menu->win, cy + j, cx - 1, menu->pad);
}
wmove(menu->win, ncy, ncx);
if (!isback)
- wattroff(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->back);
}
}
/* Remove attributes */
if (isfore)
- wattroff(menu->win, menu->fore);
+ wattroff(menu->win, (int)menu->fore);
if (isback)
- wattroff(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->back);
if (isgrey)
- wattroff(menu->win, menu->grey);
+ wattroff(menu->win, (int)menu->grey);
}
/*---------------------------------------------------------------------------
{
_nc_Post_Item(menu, hitem);
- wattron(menu->win, menu->back);
+ wattron(menu->win, (int)menu->back);
if (((hitem = hitem->right) != lasthor) && hitem)
{
int i, j, cy, cx;
}
}
while (hitem && (hitem != lasthor));
- wattroff(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->back);
item = item->down;
y += menu->spc_rows;
/*---------------------------------------------------------------------------
| Facility : libnmenu
-| Function : int post_menu(MENU *)
+| Function : int post_menu(MENU* menu)
|
| Description : Post a menu to the screen. This makes it visible.
|
NCURSES_EXPORT(int)
post_menu(MENU * menu)
{
- T((T_CALLED("post_menu(%p)"), menu));
+ T((T_CALLED("post_menu(%p)"), (void *)menu));
if (!menu)
RETURN(E_BAD_ARGUMENT);
else
RETURN(E_NOT_CONNECTED);
- menu->status |= _POSTED;
+ SetStatus(menu, _POSTED);
if (!(menu->opt & O_ONEVALUE))
{
/*---------------------------------------------------------------------------
| Facility : libnmenu
-| Function : int unpost_menu(MENU *)
+| Function : int unpost_menu(MENU*)
|
| Description : Detach menu from screen
|
{
WINDOW *win;
- T((T_CALLED("unpost_menu(%p)"), menu));
+ T((T_CALLED("unpost_menu(%p)"), (void *)menu));
if (!menu)
RETURN(E_BAD_ARGUMENT);
delwin(menu->win);
menu->win = (WINDOW *)0;
- menu->status &= ~_POSTED;
+ ClrStatus(menu, _POSTED);
RETURN(E_OK);
}