/*
 *	(c) 1998-99 Sassafras Software Inc.
 *
 *	Implements a grow icon for Windows (this class does nothing
 *	on a Mac).  Draws the Win95-style grow box and grows the
 *	window on mouse click-drag. [Not used in 1.0a8]
 */

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

  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 SS_GROWICON
#define SS_GROWICON

#include <XView.h>

/************************************************************************/
/*																		*/
/*	Structures															*/
/*																		*/
/************************************************************************/


struct XGGrowIconInitRecord {
	XGSViewInitRecord	v;
};

/************************************************************************/
/*																		*/
/*	Grow Icon View Class												*/
/*																		*/
/************************************************************************/


class XGGrowIcon : public XGView {
	public:
								XGGrowIcon(XGView *parent, XGArgStream &init);
								XGGrowIcon(XGView *parent, XGGrowIconInitRecord &init);
		virtual					~XGGrowIcon();

		enum {
			kClassID = 'grow'
		};

		/*
		 *	Standard behaviour routines
		 */
		void					DoDrawView (XRect);

#if OPT_WINOS
		bool					DoMouseDown (XPoint, short);
		void					DoMouseMove (XPoint, short);
#endif

		void					RecalcAutoLocation (XGView *below = NULL, XGView *beside = NULL, XRect *r = NULL);
		virtual long			GetHeight (void);

	private:
#if OPT_WINOS
		XPoint					fLastPos;
#endif

};

#endif	// SS_GROWICON
