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

  1. /**
  2. *
  3. * Name        MNVDISP -- Display virtual menu in a viewport.
  4. *
  5. * Synopsis    presult = mnvdisp(pmenu,pwhere,
  6. *                  view_h,view_w,origin_row,origin_col,
  7. *                  pborder);
  8. *
  9. *        BWINDOW *presult  Pointer to newly-displayed BMENU
  10. *                  structure, or NIL if failure.
  11. *        BWINDOW *pmenu      Pointer to BMENU structure to
  12. *                  display.
  13. *        WHERE    *pwhere   Pointer to WHERE structure denoting
  14. *                  device, display page, and coordinates
  15. *                  where window is to be displayed.
  16. *        int view_h,view_w Dimensions of viewport (not counting
  17. *                  border).
  18. *        int origin_row,origin_col
  19. *                  Coordinates of menu location to be
  20. *                  displayed in upper left corner of
  21. *                  viewport.
  22. *        BORDER    *pborder  Pointer to BORDER structure denoting
  23. *                  type of border to put around window.
  24. *
  25. * Description    This function displays a menu on a given video device
  26. *        and display page and adds a border.
  27. *
  28. *        An error occurs if pmenu does not point to a valid menu
  29. *        structure.  An error also occurs if the location where
  30. *        the menu is to be displayed is impossible, for example
  31. *        if an unknown device is requested or if the dimensions
  32. *        of the menu exceed the screen's dimensions.
  33. *
  34. * Returns    presult       Pointer to newly-displayed BMENU
  35. *                  structure, or NIL if failure.
  36. *        b_pcurwin      Pointer to newly-displayed BWINDOW
  37. *                  structure, or unchanged if failure.
  38. *        *pmenu->pwin      Several fields altered.
  39. *        b_wnlist[][]      Linked list altered.
  40. *        b_pactnode[][]      Window node with active cursor.
  41. *        b_wnerr       Possible values:
  42. *                  (No change)       Success.
  43. *                  MN_BAD_MENU       *pmenu is invalid.
  44. *                  WN_BAD_WIN       *pmenu's window is
  45. *                           invalid.
  46. *                  WN_ALREADY_SHOWN Already shown.
  47. *                  WN_BAD_DEV       Unknown device or
  48. *                           window dimensions
  49. *                           overflow screen.
  50. *                  WN_NO_MEMORY       Insufficient memory.
  51. *                  WN_BAD_NODE       Internal error.
  52. *                  WN_BAD_PAGE       Internal error.
  53. *                  WN_COVERED       Internal error.
  54. *                  WN_ILL_DIM       Internal error.
  55. *                  WN_NOT_SHOWN       Internal error.
  56. *                  WN_NULL_PTR       Internal error.
  57. *
  58. * Version    6.00 (C)Copyright Blaise Computing Inc.  1987,1989
  59. *
  60. **/
  61.  
  62. #include <bmenu.h>
  63.  
  64. BMENU  *mnvdisp(pmenu,pwhere,view_h,view_w,origin_row,origin_col,pborder)
  65. BMENU         *pmenu;
  66. const WHERE  *pwhere;
  67. int          view_h,view_w,origin_row,origin_col;
  68. const BORDER *pborder;
  69. {
  70.         /* Validate menu data structure.            */
  71.     mnvalidm (pmenu);
  72.  
  73.         /* Display the menu.                    */
  74.     return ((wnvdisp (pmenu->pwin, pwhere, view_h, view_w,
  75.               origin_row, origin_col, pborder) == NIL)
  76.         ? NIL
  77.         : pmenu);
  78. }
  79.