home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Resources / System / BoingBag1 / Contributions / InstallerNG / GUI-API / example / igui_Confirm.c < prev    next >
C/C++ Source or Header  |  1999-10-28  |  2KB  |  88 lines

  1.  
  2. #include "includes.h"
  3. #include "installergui_data.h"
  4.  
  5. /********************************************************************
  6.  *
  7.  *  DESCRIPTION
  8.  *
  9.  */
  10.  
  11. /********************************************************************
  12.  *
  13.  *  STATIC
  14.  *
  15.  */
  16.  
  17. /********************************************************************
  18.  *
  19.  *  EXTERN
  20.  *
  21.  */
  22.  
  23. /********************************************************************
  24.  *
  25.  *  PUBLIC
  26.  *
  27.  */
  28.  
  29. /********************************************************************
  30.  *
  31.  *  CODE
  32.  *
  33.  */
  34.  
  35. long __asm igui_Confirm(register __a0 APTR application,
  36.                         register __a1 struct FunctionEnvironment *localenv)
  37. {
  38.   #ifdef DEBUG
  39.   DEBUG_MAKRO
  40.   #endif
  41.  
  42.   {
  43.     struct Application *app = (struct Application *) application;
  44.  
  45.     // in case of an error return 1
  46.     long val = 1,
  47.          event;
  48.  
  49.     APTR obj = GroupObject,
  50.                  Child, HVSpace,
  51.                  Child, TextObject,
  52.                    MUIA_Frame, MUIV_Frame_None,
  53.                    MUIA_Text_Contents, localenv->fe_Prompt,
  54.                    MUIA_Text_SetMin, TRUE,
  55.                    MUIA_Text_PreParse, "\33c",
  56.                  End,
  57.                  Child, HVSpace,
  58.                End;
  59.  
  60.     // set the help text
  61.     igui_SetHelp(app, (char *) localenv->fe_Help);
  62.  
  63.     //
  64.     if (guistuff_NewContent(app, obj))
  65.     {
  66.       // rename the "cancel" button to "skip this part"
  67.       igui_NameCancel(app, app->app_Texts[BUTTON_SKIP]);
  68.  
  69.       // wait, until the user "proceeds", "skips" or confirms the "quit" action
  70.       do
  71.       {
  72.         event = igui_QuietWaitApp(app);
  73.  
  74.         if      (event == GUIEVENT_PROCEED) { val = 1; break; }
  75.         else if (event == GUIEVENT_ABORT)   { val = 0; break; }
  76.       }
  77.       while (guistuff_HandleGUIEvent(app, event));
  78.  
  79.       // restore the "cancel" button
  80.       igui_NameCancel(app, app->app_Texts[BUTTON_PROCEED_INSTALL]);
  81.     }
  82.  
  83.     igui_EmptyPanel(app);
  84.     return(val);
  85.   }
  86. }
  87.  
  88.