home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / PopUp / c / Show
Encoding:
Text File  |  1993-07-05  |  1.8 KB  |  59 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    PopUp.Show.c
  12.     Author:  Copyright © 1993 Jason Williams
  13.     Version: 1.00 (20 May 1993)
  14.     Purpose: High(er)-level support for opening PopUps
  15. */
  16.  
  17.  
  18. #include "WimpSWIs.h"
  19. #include "DeskLib:PopUp.h"
  20. #include <string.h>
  21.  
  22. static popup_handle DoShow(popup_block *block, char *name,
  23.                            popup_data *definition)
  24. {
  25.   strcpy(block->header.name, name);
  26.   memcpy(&block->data, definition, sizeof(popup_data));
  27.   block->header.reserved1 = block->header.reserved2 =
  28.                             block->header.reserved3 = 0;
  29.   return(PopUp_Open(block));
  30. }
  31.  
  32.  
  33. extern popup_handle PopUp_ShowPtr(char *name, BOOL isstatic,
  34.                                   popup_data *definition)
  35. {
  36.   popup_block temp;
  37.   mouse_block ptr;
  38.  
  39.   Wimp_GetPointerInfo(&ptr);
  40.   temp.header.openpos.x = ptr.pos.x - 64;
  41.   temp.header.openpos.y = ptr.pos.y + 64;
  42.   if (isstatic)
  43.     temp.header.flags = popup_STATIC;
  44.   else
  45.     temp.header.flags = popup_STANDALONE;
  46.   return(DoShow(&temp, name, definition));
  47. }
  48.  
  49.  
  50. extern popup_handle PopUp_ShowMenuLeaf(char *name, popup_data *definition,
  51.                                        message_menuwarn *msg)
  52. {
  53.   popup_block temp;
  54.  
  55.   temp.header.openpos = msg->openpos;
  56.   temp.header.flags = popup_MENULEAF;
  57.   return(DoShow(&temp, name, definition));
  58. }
  59.