/*	XProgress.h
 *
 *		Progress bar management
 */

/**********************************************************************

  YAAF is Copyright 1997-1999 by William Woody.

  Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions 
  are met:

  Redistributions of source code must retain the above copyright notice, 
  this list of conditions and the following disclaimer.

  Neither the name of the copyright holder or other contributors may
  be used to promote products derived from this software without
  specific written prior permission.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 
  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
  SOFTWARE.
  
  Contact:   woody@alumni.caltech.edu
  Web page:  http://www.pandawave.com/yaaf/

**********************************************************************/

#ifndef PandaWave_XPROGRESS
#define PandaWave_XPROGRESS

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

/************************************************************************/
/*																		*/
/*	Forwards															*/
/*																		*/
/************************************************************************/


class XGDraw;

/************************************************************************/
/*																		*/
/*	Class Declarations													*/
/*																		*/
/************************************************************************/

/*$	XGProgress
 *
 *		The progress control
 */

class XGProgress : public XGSlider {
	public:
								XGProgress (XGView *o, XGArgStream &s);
		virtual					~XGProgress ();
		
		enum {
			kClassID = 'prog'
		};
		
		void					DoDrawView (XRect);
		void					DoActivate (bool);
		void					DoMoveView (void);
		void					DoSizeView (void);
		void					DoShowHide (void);
		void					DoEnable (void);

		long					GetValue (void) { return fMax; }
		void					SetValue (long);

		long					GetMinValue (void) { return fMin; }
		long					GetMaxValue (void) { return fMax; }
		void					SetMinValue (long);
		void					SetMaxValue (long);

		long					GetIndeterminate (void) { return fIndeterminate; }
		void					SetIndeterminate (bool);

	private:
		bool					fIndeterminate;
		long					fValue;
		long					fMin;
		long					fMax;
		long					fScale;

#if OPT_MACOS
		ControlHandle			fControl;
#endif

#if OPT_WINOS
		HWND					fControl;
#endif

		void					InitControl (void);
		void					DrawBar(XGDraw &);

};
		
#endif // PandaWave_XPROGRESS
