X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=menu%2Fm_post.c;h=2cc0ea09d5feb5c0445b93416f5e76355686e692;hp=08314a56d6972e60ba9b30c4c09abf4c07e64b2a;hb=f3ec084eb66ba14feb6357b674fb85dd474933d8;hpb=c6540b9c89dda1a6a8bd681726831e8924176504 diff --git a/menu/m_post.c b/menu/m_post.c index 08314a56..2cc0ea09 100644 --- a/menu/m_post.c +++ b/menu/m_post.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 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 * @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_post.c,v 1.28 2010/01/23 21:20:11 tom Exp $") +MODULE_ID("$Id: m_post.c,v 1.32 2020/02/02 23:34:34 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -67,7 +68,7 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) - 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) @@ -79,13 +80,13 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) 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; } } @@ -93,7 +94,7 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) 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 @@ -101,19 +102,19 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) */ 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; } } @@ -158,10 +159,10 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) 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)) @@ -171,21 +172,21 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) 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); } /*--------------------------------------------------------------------------- @@ -225,7 +226,7 @@ _nc_Draw_Menu(const MENU * menu) { _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; @@ -244,7 +245,7 @@ _nc_Draw_Menu(const MENU * menu) } } while (hitem && (hitem != lasthor)); - wattroff(menu->win, menu->back); + wattroff(menu->win, (int)menu->back); item = item->down; y += menu->spc_rows; @@ -305,7 +306,7 @@ post_menu(MENU * menu) else RETURN(E_NOT_CONNECTED); - menu->status |= _POSTED; + SetStatus(menu, _POSTED); if (!(menu->opt & O_ONEVALUE)) { @@ -369,7 +370,7 @@ unpost_menu(MENU * menu) delwin(menu->win); menu->win = (WINDOW *)0; - menu->status &= ~_POSTED; + ClrStatus(menu, _POSTED); RETURN(E_OK); }