Metropoli BBS
VIEWER: wbnag.c MODE: TEXT (ASCII)
/***************************************************************************
 *		  Copyright (C) 1995  Charles P. Peterson                  *
 *	     4007 Enchanted Sun, San Antonio, Texas 78244-1254             *
 *              Email: Charles_P_Peterson@fcircus.sat.tx.us                *
 *                                                                         *
 *		  This is free software with NO WARRANTY.                  *
 *	      See gfft.c, or run program itself, for details.              *
 *		      Support is available for a fee.                      *
 ***************************************************************************
 *
 * Program:     gfft--General FFT analysis
 * File:        wbnag.c
 * Purpose:     'nag' requester
 * Author:      Charles Peterson (CPP)
 * History:     27-Jan-95 (1.28) CPP; Created.
 * Comments:    Workbench GUI.  Amiga Dependent!
 */

#ifdef AMIGA  /* This module is AMIGA dependent */

#include <stdio.h>     /* sprintf() */

/*
 * Amiga includes
 */
#include <exec/types.h>
#include <workbench/workbench.h>
#include <intuition/intuition.h>
#include <clib/intuition_protos.h>
#include <clib/exec_protos.h>
#include <dos.h> /* chkabort() */

#define NONAG FALSE

/*
 * GFFT includes
 */
#include "gfft.h"
#include "settings.h"
#include "wbench.h"

/*
 * External globals
 */
extern struct Window *dialog_window_p;

static struct Requester *nag_rp = NULL;

static struct Gadget *end_nag_gadgetp;
static struct IntuiText *line1_textp;
static struct IntuiText *line2_textp;
static struct IntuiText *line3_textp;
static struct IntuiText *line4_textp;
static struct IntuiText *line5_textp;
static struct IntuiText *line6_textp;
static struct IntuiText *line7_textp;


void workbench_nag_requester (void)
{
    static nagged_already = FALSE;
    struct IntuiMessage *message;
    APTR *address = NULL;
    int key = 0;

    if (NONAG || nagged_already) return;

    nagged_already = TRUE;

    if (!nag_rp)
    {
	gadget__begin (GTYP_REQGADGET);
/*
 * Setup Text
 */
	line1_textp = requester_text__new (
"PLEASE help the author support this program by sending a donation today."
   , 0, 0);

	line2_textp = requester_text__new (
"Any amount will be appreciated, but for only $10, I'll send thanks"
   , 0, 1);

	line3_textp = requester_text__new (
"    and tell you how to make this nag requester to go away.  For $25,"
   , 0, 2);

	line4_textp = requester_text__new (
"    I'll send you the FPU optimized version right away (see README)."
   , 0, 3);

	line5_textp = requester_text__new (
"Charles Peterson, 4007 Enchanted Sun, San Antonio, TX 78244-1254 USA"
   , 0, 4);

	line6_textp = requester_text__new (
"There is ABSOLUTELY NO WARRANTY.  Click Version/Copyright button (after"
   , 0, 5);

	line7_textp = requester_text__new (
"clicking this message away) for details and your copying rights."
   , 0, 6);

/*
 * Setup Gadgets
 */
	end_nag_gadgetp = tall_action_button__new
	  ("...OK",
	   68, 6);

	nag_rp = requester__new ();
	nag_rp->ReqGadget = end_nag_gadgetp;
	nag_rp->ReqText = line7_textp;

    } /* Ok, nag_rp has been created */
    
    if (requester__display (nag_rp, dialog_window_p))
    {
	while (TRUE)
	{
	    Wait (1 << dialog_window_p->UserPort->mp_SigBit);
	    while (message = (struct IntuiMessage *) GetMsg 
		   (dialog_window_p->UserPort))
	    {
		address = message->IAddress;
		ReplyMsg ((struct Message *) message);
		if (address == (APTR) end_nag_gadgetp)
		{
		    requester__remove (nag_rp, dialog_window_p);
		    return;
		}
	    }
	}
    }
}

#endif /* end ifdef AMIGA */
[ RETURN TO DIRECTORY ]