home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classsource.lha / ClassSource / Intuition / Requester / Requester.c
Encoding:
C/C++ Source or Header  |  1995-02-12  |  2.2 KB  |  95 lines

  1. #include <classes/Intuition/Requester.h>
  2.  
  3. #pragma -
  4. #include <pragma/intuition_lib.h>
  5. #pragma +
  6.  
  7. EasyRequesterC::EasyRequesterC(WindowC *w,
  8.     ULONG idcmpFlags, STRPTR title, STRPTR gadgettext)
  9. {
  10.     window = w;
  11.     idcmp = idcmpFlags;
  12.     easy.es_StructSize = sizeof(EasyStruct);
  13.     easy.es_Flags = 0;
  14.     easy.es_Title = title;
  15.     easy.es_TextFormat = NULL;
  16.     easy.es_GadgetFormat = gadgettext;
  17. }
  18.  
  19. LONG EasyRequesterC::request(STRPTR text, APTR args)
  20. {
  21.     easy.es_TextFormat = text;
  22.     return EasyRequestArgs((window == NULL) ? NULL : window->window(),&easy,
  23.         (idcmp == 0) ? NULL : &idcmp,args);
  24. }
  25.  
  26. LONG EasyRequesterC::request(STRPTR text, ULONG arg1, ...)
  27. {
  28.     easy.es_TextFormat = text;
  29.     return EasyRequestArgs((window == NULL) ? NULL : window->window(),&easy,
  30.         (idcmp == 0) ? NULL : &idcmp,&arg1);
  31. }
  32.  
  33. // **********************************************************
  34.  
  35. InfoRequesterC::InfoRequesterC(WindowC *w, STRPTR title, STRPTR gadget)
  36.     : EasyRequesterC(w,0,title,gadget)
  37. {
  38. }
  39.  
  40. VOID InfoRequesterC::request(STRPTR text, APTR args)
  41. {
  42.     EasyRequesterC::request(text,args);
  43. }
  44.  
  45. VOID InfoRequesterC::request(STRPTR text, ULONG arg1, ...)
  46. {
  47.     EasyRequesterC::request(text,&arg1);
  48. }
  49.  
  50. // ********************************************************
  51.  
  52. TwoButtonRequesterC::TwoButtonRequesterC(WindowC *w, STRPTR title,
  53.     STRPTR left, STRPTR right)
  54.     : EasyRequesterC(w,0,title,NULL)
  55. {
  56.     gadgettext = left;
  57.     gadgettext += "|";
  58.     gadgettext += right;
  59.     easy.es_GadgetFormat = (char *) gadgettext;
  60. }
  61.  
  62. BOOL TwoButtonRequesterC::request(STRPTR text, APTR args)
  63. {
  64.     return EasyRequesterC::request(text,args) != 0;
  65. }
  66.  
  67. BOOL TwoButtonRequesterC::request(STRPTR text, ULONG arg1, ...)
  68. {
  69.     return EasyRequesterC::request(text,&arg1) != 0;
  70. }
  71.  
  72. // ***********************************************************
  73.  
  74. ThreeButtonRequesterC::ThreeButtonRequesterC(WindowC *w, STRPTR title,
  75.         STRPTR left, STRPTR middle, STRPTR right)
  76.     : EasyRequesterC(w,0,title,NULL)
  77. {
  78.     gadgettext = left;
  79.     gadgettext += "|";
  80.     gadgettext += middle;
  81.     gadgettext += "|";
  82.     gadgettext += right;
  83.     easy.es_GadgetFormat = (char *) gadgettext;
  84. }
  85.  
  86. ULONG ThreeButtonRequesterC::request(STRPTR text, APTR args)
  87. {
  88.     return EasyRequesterC::request(text,args);
  89. }
  90.  
  91. ULONG ThreeButtonRequesterC::request(STRPTR text, ULONG arg1, ...)
  92. {
  93.     return EasyRequesterC::request(text,&arg1);
  94. }
  95.