home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 377a.lha / libraries / intuition / req_alert / dblmenureq.h < prev    next >
Encoding:
C/C++ Source or Header  |  1980-02-04  |  4.0 KB  |  118 lines

  1.  
  2. /* dblmenureq.h -- The structures for the requester and its gadgets. */
  3. /* Copyright (c) 1990 Commodore-Amiga, Inc.
  4.  *
  5.  * This example is provided in electronic form by Commodore-Amiga, Inc. for
  6.  * use with the 1.3 revisions of the Addison-Wesley Amiga reference manuals. 
  7.  * The 1.3 Addison-Wesley Amiga Reference Manual series contains additional
  8.  * information on the correct usage of the techniques and operating system
  9.  * functions presented in this example.  The source and executable code of
  10.  * this example may only be distributed in free electronic form, via bulletin
  11.  * board or as part of a fully non-commercial and freely redistributable
  12.  * diskette.  Both the source and executable code (including comments) must
  13.  * be included, without modification, in any copy.  This example may not be
  14.  * published in printed form or distributed with any commercial product.
  15.  * However, the programming techniques and support routines set forth in
  16.  * this example may be used in the development of original executable
  17.  * software products for Commodore Amiga computers.
  18.  * All other rights reserved.
  19.  * This example is provided "as-is" and is subject to change; no warranties
  20.  * are made.  All use is at your own risk.  No liability or responsibility
  21.  * is assumed.
  22.  */
  23.  
  24. #define BACKPEN  0
  25.  
  26. /* Force text to use Topaz 8 font */
  27. struct TextAttr TOPAZ80 = 
  28.     {(STRPTR)"topaz.font",TOPAZ_EIGHTY, 0, 0};
  29.  
  30. /* Tell something about the program */
  31. struct IntuiText WinText[] =
  32.     { 
  33.        {3,0,JAM2,95,66,&TOPAZ80,"to activate",                    NULL},
  34.        {3,0,JAM2,48,56,&TOPAZ80,"Double-Click Menu Button",&WinText[0]}
  35.     };
  36.  
  37. /* Text for the Requester and its gadgets */
  38. struct IntuiText ReqTxt[] =
  39.     {
  40.        {3,BACKPEN,JAM2,23,3,&TOPAZ80,"Control Panel",NULL},
  41.        {2,0,      JAM1,22,1,&TOPAZ80,"Exit",         NULL},
  42.        {2,0,      JAM1,22,1,&TOPAZ80,"Fast",         NULL},
  43.        {2,0,      JAM1,21,1,&TOPAZ80,"Slow",         NULL}
  44.     };
  45.  
  46. /* image and mask data for cool buttons */
  47. USHORT chip MaskData[] =
  48.     {
  49.     0x07FF,0xFFFF,0xFFFF,0xFFFF,0xF000,0x3FFF,0xFFFF,0xFFFF,
  50.     0xFFFF,0xFE00,0x7FFF,0xFFFF,0xFFFF,0xFFFF,0xFF00,0xFFFF,
  51.     0xFFFF,0xFFFF,0xFFFF,0xFF80,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  52.     0xFF80,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFF80,0xFFFF,0xFFFF,
  53.     0xFFFF,0xFFFF,0xFF80,0x7FFF,0xFFFF,0xFFFF,0xFFFF,0xFF00,
  54.     0x3FFF,0xFFFF,0xFFFF,0xFFFF,0xFE00,0x07FF,0xFFFF,0xFFFF,
  55.     0xFFFF,0xF000
  56.     };
  57.  
  58. struct Image Button = 
  59.     {0,0,73,10,1,MaskData,0x0001,0x0000,NULL};
  60.  
  61. /* Mask information for gadgets */
  62. struct BoolInfo ButtonMask = {BOOLMASK,MaskData,0};
  63.  
  64. /*The buttons for the requester use REQGADGET
  65.  *to indicate that they are gadgets for a
  66.  *requester.  ENDGADGET indicates that the
  67.  *requester ends when this button is released.
  68. */ 
  69.  
  70. struct Gadget ReqGad[] =
  71.     {
  72.        {NULL,      35,60,73,10,GADGHCOMP|GADGIMAGE,
  73.         RELVERIFY|GADGIMMEDIATE|ENDGADGET|BOOLEXTEND,
  74.         BOOLGADGET|REQGADGET,(APTR)&Button,NULL,&ReqTxt[1],NULL,
  75.         (APTR)&ButtonMask,100,NULL
  76.        },
  77.        {&ReqGad[0],35,40,73,10,GADGHCOMP|GADGIMAGE,
  78.         RELVERIFY|GADGIMMEDIATE|ENDGADGET|BOOLEXTEND,
  79.         BOOLGADGET|REQGADGET,(APTR)&Button,NULL,&ReqTxt[2],NULL,
  80.         (APTR)&ButtonMask,101,NULL
  81.        },
  82.        {&ReqGad[1],35,20,73,10,GADGHCOMP|GADGIMAGE,
  83.         RELVERIFY|GADGIMMEDIATE|ENDGADGET|BOOLEXTEND,
  84.         BOOLGADGET|REQGADGET,(APTR)&Button,NULL,&ReqTxt[3],NULL,
  85.         (APTR)&ButtonMask,102,NULL 
  86.        }
  87.     };
  88.  
  89. /* Draw a pretty border around the requester */
  90. SHORT BorderVectors[] = 
  91.     {
  92.       0, 0,
  93.     148, 0,
  94.     148,84,
  95.       0,84,
  96.       0, 0
  97.     };
  98.  
  99. struct Border ReqBorder = {0,0,1,0,JAM1,5,BorderVectors,NULL};
  100.  
  101. struct Requester DMRequester =
  102.     {
  103.     NULL,
  104.     79,14,       /* LeftEdge and TopEdge */
  105.     149,85,      /* Width and Height */
  106.     -75,-43,
  107.     &ReqGad[2],  /* Gadgets used */
  108.     &ReqBorder,  /* Border */
  109.     &ReqTxt[0],  /* Text to render within requester */
  110.     POINTREL,
  111.     BACKPEN,     /* Color to use as the background */
  112.     NULL,
  113.     NULL,
  114.     NULL
  115.     };
  116.  
  117. /* End of dblmenureq.h */
  118.