home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / MNHILITE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.7 KB  |  70 lines

  1. /**
  2. *
  3. * Name        MNHILITE -- Move or remove menu highlight bar
  4. *                or item description.
  5. *
  6. * Synopsis    presult = mnhilite(pmenu,row,col,option);
  7. *
  8. *        BMENU *presult    Pointer to newly-changed BMENU
  9. *                structure, or NIL if failure.
  10. *        int row,col    Row and column of item to highlight.
  11. *                Ignored if MN_UNHIGHLIGHT specified.
  12. *        int option    Option bits:
  13. *
  14. *                  MN_HIGHLIGHT
  15. *                  MN_UNHIGHLIGHT (ignores row and col)
  16. *                  MN_USE_DESCRIPTION
  17. *                  WN_UPDATE or WN_NO_UPDATE
  18. *
  19. * Description    This function highlights a menu item or removes the
  20. *        highlight bar.    It optionally adds or removes the item's
  21. *        Lotus-style description string.
  22. *
  23. *        This function will not work on protected menu items.
  24. *
  25. * Returns    presult       Pointer to newly-changed BMENU
  26. *                  structure, or NIL if failure.
  27. *        b_wnerr       Possible values:
  28. *                  (No change)       Success.
  29. *                  WN_BAD_OPT       Unknown option.
  30. *                  MN_BAD_MENU       pmenu is invalid.
  31. *                  WN_BAD_WIN       pmenu->pwin is invalid.
  32. *
  33. *                  WN_NOT_SHOWN       Internal error.
  34. *                  WN_BAD_DEV       Internal error.
  35. *                  MN_BAD_ITEM       Internal error.
  36. *                  WN_ILL_DIM       Internal error.
  37. *                  WN_NULL_PTR       Internal error.
  38. *
  39. * Version    6.00 (C)Copyright Blaise Computing Inc.  1989
  40. *
  41. **/
  42.  
  43. #include <bmenu.h>
  44.  
  45. BMENU *mnhilite(pmenu,row,col,option)
  46. BMENU *pmenu;
  47. int    row,col,option;
  48. {
  49.     BITEM *pitem;
  50.  
  51.     mnvalidm(pmenu)              /* Validate menu.           */
  52.  
  53.     switch (option & (MN_HIGHLIGHT | MN_UNHIGHLIGHT))
  54.     {
  55.     case MN_HIGHLIGHT:
  56.         if (NIL == (pitem = mnmchitm(pmenu,NIL,row,col,0,NIL)))
  57.         return NIL;
  58.         break;
  59.  
  60.     case MN_UNHIGHLIGHT:
  61.         pitem = NIL;
  62.         break;
  63.  
  64.     default:
  65.         wnreterr(WN_BAD_OPT);
  66.     }
  67.  
  68.     return mnhilit0(pmenu,pitem,option);
  69. }
  70.