/*	XStatusBar.h
 *
 *		A slider object; this only displays the percentage of a thing
 *	that has been accomplished
 */

/*  YAAF - Yet another application framework
 *  Copyright (C) 1997, 1998 William Edward Woody
 *  
 *  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 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 MERCHANTABIILITY 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.
 *  
 *  To contact the author, either e-mail me at woody@pandawave.com, 
 *	or write to
 *  
 *          William Edward Woody
 *          In Phase Consulting
 *          1545 Ard Eevin Avenue
 *          Glendale, CA 91202
 *
 *	Or visit us on the web at http://www.pandawave.com
 */

#ifndef PandaWave_XSTATUSBAR
#define PandaWave_XSTATUSBAR

#include <XConfig.h>
#include <XControls.h>

/************************************************************************/
/*																		*/
/*	Status bar class													*/
/*																		*/
/************************************************************************/

/*	@C"XGStatusBar"
 *	@D"XGSlider"
 *	@H"XStatusBar.h"
 *	@I
 *
 *		This implements the abstraction of a range of controls
 *	which not only have a value, but an adjustable minimum and
 *	maximum value
 */

class XGStatusBar : public XGSlider {
	public:
								XGStatusBar(XGOwner *parent, XGArgStream &s);
		virtual					~XGStatusBar();
		
		enum {
			kClassID = 'stat'
		};
		
		/*
		 *	Events
		 */
		
		void					DoDrawView(Rect);
		
		/*
		 *	Min/Max Values
		 */
		
		virtual long			GetMinValue();
		virtual long			GetMaxValue();
		virtual long			GetValue();
		virtual void			SetMinValue(long);
		virtual void			SetMaxValue(long);
		virtual void			SetValue(long);

	private:
		long					fMinValue;
		long					fMaxValue;
		long					fCurValue;
		bool					fUpdate;
		
		void					DrawStatusBar();
};

#endif // PandaWave_XSTATUSBAR
