#ifndef CODE_SELGADGET_CXX
#define CODE_SELGADGET_CXX

/*-----------------------------------------------------------------------
 * Xclasses code file
 * ($Id: selgadget.cxx,v 1.1.1.1 1998/07/16 19:29:28 cvs Exp $)
 * 
 * Copyright (C) 1998 Jürgen Schmitz
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 *-----------------------------------------------------------------------
 */

#include "types.h"
#include <Xclasses/gadget.h>
#include "include/selgadget_p.h"

selgadget::selgadget() : gadget()
{
//	while (!(p=new pselgadget))
//	{
//		outOfMemory("selgadget");
//	}
//	p->o=this;
	Name("selgadget");
	SetKeyHandler(KHM_SELECT);
}
pselgadget::pselgadget()
{
}
pselgadget::~pselgadget()
{
}
selgadget::~selgadget()
{
	if (win) Free();
//	if (p) delete p;
}
void selgadget::State(int s)
{
}
int selgadget::State(void)
{
	return RELEASED;
}
int selgadget::Create(void)
{
	char *r;
	if (r=GetResource("state"))
	{
		if (!strcmp(r,"PRESSED")) State(PRESSED);
		else if (!strcmp(r,"RELEASED")) State(RELEASED);
	}

	if (gadget::Create())
	{
		return 1;
	} 
	return 0;
}

#endif
