// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'EnRubber.pas' rev: 5.00

#ifndef EnRubberHPP
#define EnRubberHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Forms.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <EnImgScr.hpp>	// Pascal unit
#include <ExtCtrls.hpp>	// Pascal unit
#include <EnTransf.hpp>	// Pascal unit
#include <EnDiGrph.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Enrubber
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TProtectedScrollBox;
class PASCALIMPLEMENTATION TProtectedScrollBox : public Enimgscr::TImageScrollBox 
{
	typedef Enimgscr::TImageScrollBox inherited;
	
public:
	#pragma option push -w-inl
	/* TImageScrollBox.Create */ inline __fastcall virtual TProtectedScrollBox(Classes::TComponent* AOwner
		) : Enimgscr::TImageScrollBox(AOwner) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TImageScrollBox.Destroy */ inline __fastcall virtual ~TProtectedScrollBox(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TProtectedScrollBox(HWND ParentWindow) : Enimgscr::TImageScrollBox(
		ParentWindow) { }
	#pragma option pop
	
};


#pragma option push -b-
enum TBandMovement { bmAllDirections, bmTopBottom, bmLeftRight, bmInside };
#pragma option pop

#pragma option push -b-
enum TGrabHandle { ghTopLeft, ghTop, ghTopRight, ghRight, ghBottomRight, ghBottom, ghBottomLeft, ghLeft, 
	ghInside };
#pragma option pop

class DELPHICLASS TRubberbandMouseHandler;
class PASCALIMPLEMENTATION TRubberbandMouseHandler : public Enimgscr::TMouseHandler 
{
	typedef Enimgscr::TMouseHandler inherited;
	
private:
	int FX1;
	int FY1;
	int FX2;
	int FY2;
	Graphics::TCanvas* FCanvas;
	TProtectedScrollBox* FImageScrollBox;
	bool FBandVisible;
	TBandMovement FBandMovement;
	TGrabHandle FGrabHandle;
	Windows::TPoint FSaveSize;
	bool FAnimated;
	Extctrls::TTimer* FAnimationTimer;
	int FAnimationInterval;
	Graphics::TColor FTempFore;
	Graphics::TColor FTempBack;
	int FMouseX;
	int FMouseY;
	bool FShowGrips;
	int FGripSize;
	Graphics::TColor FGripColor;
	
protected:
	void __fastcall SetAnimated(const bool Animation);
	bool __fastcall GetAnimated(void);
	void __fastcall SetAnimationInterval(const int Interval);
	int __fastcall GetAnimationInterval(void);
	void __fastcall SetBackgroundColor(const Graphics::TColor Color);
	Graphics::TColor __fastcall GetBackgroundColor(void);
	void __fastcall SetForegroundColor(const Graphics::TColor Color);
	Graphics::TColor __fastcall GetForegroundColor(void);
	void __fastcall SetGripSize(const int GripSize);
	int __fastcall GetGripSize(void);
	void __fastcall SetShowGrips(const bool ShowGrips);
	bool __fastcall GetShowGrips(void);
	void __fastcall SetGripColor(const Graphics::TColor Color);
	Graphics::TColor __fastcall GetGripColor(void);
	void __fastcall SetLineStyle(const Graphics::TPenStyle Style);
	Graphics::TPenStyle __fastcall GetLineStyle(void);
	void __fastcall SetLineMode(const Graphics::TPenMode Mode);
	Graphics::TPenMode __fastcall GetLineMode(void);
	void __fastcall BoundXY(int &X, int &Y);
	void __fastcall DrawBand(void);
	void __fastcall RemoveBand(void);
	void __fastcall GraphicDraw(System::TObject* Sender);
	virtual void __fastcall BeforeResize(void);
	virtual void __fastcall AfterResize(void);
	bool __fastcall MouseOnGrabHandle(const int X, const int Y, TGrabHandle &GrabHandle);
	void __fastcall DoRubberbandChange(const int X1, const int Y1, const int X2, const int Y2);
	
public:
	__fastcall TRubberbandMouseHandler(const Enimgscr::TImageScrollBox* InImageScrollBox);
	__fastcall virtual ~TRubberbandMouseHandler(void);
	virtual void __fastcall MouseDown(const Controls::TMouseButton Button, const Classes::TShiftState Shift
		, const int X, const int Y);
	virtual void __fastcall MouseUp(const Controls::TMouseButton Button, const Classes::TShiftState Shift
		, const int X, const int Y);
	virtual void __fastcall MouseMove(const Classes::TShiftState Shift, const int X, const int Y);
	void __fastcall CopySelectionToClipBoard(void);
	void __fastcall CropToSelection(void);
	void __fastcall ExtractSelection(Endigrph::TDibGraphic* Dest);
	void __fastcall GetSelection(Windows::TRect &Rect);
	double __fastcall GetXFactor(void);
	double __fastcall GetYFactor(void);
	void __fastcall GetSourceSelection(Windows::TRect &Rect);
	void __fastcall ClearSelection(void);
	__property Graphics::TColor ForegroundColor = {read=GetForegroundColor, write=SetForegroundColor, nodefault
		};
	__property Graphics::TColor BackgroundColor = {read=GetBackgroundColor, write=SetBackgroundColor, nodefault
		};
	__property Graphics::TPenStyle LineStyle = {read=GetLineStyle, write=SetLineStyle, nodefault};
	__property Graphics::TPenMode LineMode = {read=GetLineMode, write=SetLineMode, nodefault};
	__property bool SelectionActive = {read=FBandVisible, write=FBandVisible, nodefault};
	__property bool Animated = {read=GetAnimated, write=SetAnimated, nodefault};
	__property int AnimationInterval = {read=GetAnimationInterval, write=SetAnimationInterval, nodefault
		};
	void __fastcall DrawBandTimerEvent(System::TObject* Sender);
	__property bool ShowGrips = {read=GetShowGrips, write=SetShowGrips, nodefault};
	__property int GripSize = {read=GetGripSize, write=SetGripSize, nodefault};
	__property Graphics::TColor GripColor = {read=GetGripColor, write=SetGripColor, nodefault};
};


class DELPHICLASS ERubberbandError;
class PASCALIMPLEMENTATION ERubberbandError : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall ERubberbandError(const AnsiString Msg) : Sysutils::Exception(
		Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall ERubberbandError(const AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall ERubberbandError(int Ident)/* overload */ : Sysutils::Exception(
		Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall ERubberbandError(int Ident, const System::TVarRec * 
		Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall ERubberbandError(const AnsiString Msg, int AHelpContext
		) : Sysutils::Exception(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall ERubberbandError(const AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
		) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall ERubberbandError(int Ident, int AHelpContext)/* overload */
		 : Sysutils::Exception(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall ERubberbandError(System::PResStringRec ResStringRec
		, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
		ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~ERubberbandError(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Enrubber */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Enrubber;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// EnRubber
