/*
 *
 *  AM --- AmigaMail
 *  (C) 1991, 1992 by Christian Riede
 *
 *  AM is distributed in the hope that it will be useful, but WITHOUT ANY
 *  WARRANTY.  No author or distributor accepts responsibility to anyone
 *  for the consequences of using it or for whether it serves any
 *  particular purpose or works at all, unless he says so in writing.
 *  Refer to the GNU General Public License, Version 1, for full details.
 *  
 *  Everyone is granted permission to copy, modify and redistribute AM,
 *  but only under the conditions described in the GNU General Public
 *  License, Version 1.  A copy of this license is supposed to have been 
 *  given to you along with AM so you can know your rights and responsi-
 *  bilities.  It should be in a file named COPYING.  Among other things,
 *  the copyright notice and this notice must be preserved on all copies.
 *
 *  
 *
 */

#include "am.h"

/* pop up a two button requester */
/* return TRUE/FALSE if the user presses OK/Cancel */
int TwoGadRequest(struct Window *Window, char *s,...)
{
	va_list ap;
	int result;
	struct EasyStruct EasyStruct = {
		sizeof(struct EasyStruct),
		0,0,0,0};

	va_start(ap,s);

	if (Window) 
	{
		ScreenToFront(Window->WScreen);
		ActivateWindow(Window);
	}

	EasyStruct.es_Title = (UBYTE *)"AmigaMail";

	EasyStruct.es_TextFormat = (UBYTE *)s;

	EasyStruct.es_GadgetFormat = (UBYTE *)"OK|CANCEL";

	result = EasyRequestArgs(Window,&EasyStruct,0,ap);

	va_end(ap);

	return(result);
}
	
/* pop up a single button requester */
/* wait for user to confirm */
void SimpleRequest(struct Window *Window, char *s,...)
{
	va_list ap;
	struct EasyStruct EasyStruct = {
		sizeof(struct EasyStruct),
		0,0,0,0};

	va_start(ap,s);

	if (Window) 
	{
		ScreenToFront(Window->WScreen);
		ActivateWindow(Window);
	}

	
	EasyStruct.es_Title = (UBYTE *)"AmigaMail";

	EasyStruct.es_TextFormat = (UBYTE *)s;

	EasyStruct.es_GadgetFormat = (UBYTE *)"OK";

	EasyRequestArgs(Window,&EasyStruct,0,ap);

	va_end(ap);
}

