// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'SGImage.pas' rev: 6.00

#ifndef SGImageHPP
#define SGImageHPP

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

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

namespace Sgimage
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TsgExportFormat { xpBitmap, xpJPEG, xpMetafile };
#pragma option pop

class DELPHICLASS TsgScale;
class PASCALIMPLEMENTATION TsgScale : public System::TObject 
{
	typedef System::TObject inherited;
	
public:
	TsgScale* Prev;
	#pragma pack(push, 1)
	Types::TRect Bounds;
	#pragma pack(pop)
	
	#pragma pack(push, 1)
	Types::TRect PictureRect;
	#pragma pack(pop)
	
	bool UsePictureRect;
	__fastcall TsgScale(TsgScale* APrev);
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TsgScale(void) { }
	#pragma option pop
	
};


class DELPHICLASS TsgImage;
class PASCALIMPLEMENTATION TsgImage : public Extctrls::TImage 
{
	typedef Extctrls::TImage inherited;
	
private:
	bool FMouseRect;
	#pragma pack(push, 1)
	Types::TRect FDrag;
	#pragma pack(pop)
	
	Classes::TNotifyEvent FOnScaling;
	Classes::TNotifyEvent FOnPaint;
	TsgScale* FPrevScale;
	Controls::TCursor FCursor;
	bool FIsDragging;
	bool FIsMoving;
	bool FZoom;
	bool FIsZooming;
	#pragma pack(push, 1)
	Types::TPoint FZoomPoint;
	#pragma pack(pop)
	
	#pragma pack(push, 1)
	Types::TPoint FPrevPoint;
	#pragma pack(pop)
	
	bool FDragAllow;
	#pragma pack(push, 1)
	Types::TRect FPictureRect;
	#pragma pack(pop)
	
	bool FUsePictureRect;
	bool FCanPaint;
	bool FDontScroll;
	bool FDoPrevScale;
	Graphics::TColor FBackGroundColor;
	double FScaleMMWidth;
	double mmToPixelX;
	bool FIsBigScale;
	double FMaxWidth;
	bool FCenteringDrawing;
	Graphics::TCanvas* __fastcall ICanvas(void);
	double __fastcall GetScale(void);
	void __fastcall ClearScales(void);
	void __fastcall DragDraw(void);
	void __fastcall SetScale(bool AAbs, int ALeft, int ATop, Extended Coef);
	void __fastcall SetAbsScale(double Value);
	HIDESBASE MESSAGE void __fastcall WMCancelMode(Messages::TMessage &Mess);
	HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Mes);
	void __fastcall SetMouseRect(const bool Value);
	bool __fastcall SetRectBounds(int ALeft, int ATop, unsigned AWidth, unsigned AHeight);
	void __fastcall GetPictureLeftTop(bool Abs, Extended Coef, const int NX, const int NY, const int XMouse, const int YMouse, int &ALeft, int &ATop, Extended NewCoef);
	bool __fastcall GetIsPrevScaleExists(void);
	
protected:
	double __fastcall CheckScale(double AScale);
	void __fastcall DoAfterLoad(void);
	DYNAMIC void __fastcall Scaling(void);
	virtual void __fastcall Paint(void);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	
public:
	__fastcall virtual TsgImage(Classes::TComponent* AOwner);
	__fastcall virtual ~TsgImage(void);
	bool __fastcall Empty(void);
	bool __fastcall HasPrevScale(void);
	HIDESBASE Types::TPoint __fastcall Center();
	void __fastcall Cancel(void);
	HIDESBASE void __fastcall ChangeScale(bool Abs, Extended Coef, const Types::TPoint &Pos);
	bool __fastcall GetPointToImageSizeRatio(const Sgconsts::TFPoint &APoint, Extended &AXScaled, Extended &AYScaled);
	void __fastcall LoadFromFile(const AnsiString FileName);
	void __fastcall PrevScale(void);
	void __fastcall RefreshAfterPictureAssign(void);
	virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
	Types::TRect __fastcall PictureRect();
	bool __fastcall UsePictureRect(void);
	bool __fastcall ShowPoint(const Sgconsts::TFPoint &APoint, Extended AScale, const Sgconsts::TFRect &ARect);
	__property Graphics::TCanvas* Canvas = {read=ICanvas};
	__property bool CenteringDrawing = {read=FCenteringDrawing, write=FCenteringDrawing, nodefault};
	__property Graphics::TColor BackgroundColor = {read=FBackGroundColor, write=FBackGroundColor, nodefault};
	__property bool IsPrevScaleExists = {read=GetIsPrevScaleExists, nodefault};
	__property double ScaleMMWidth = {read=FScaleMMWidth, write=FScaleMMWidth};
	
__published:
	__property Classes::TNotifyEvent OnScaling = {read=FOnScaling, write=FOnScaling};
	__property Classes::TNotifyEvent OnPaint = {read=FOnPaint, write=FOnPaint};
	__property Stretch  = {default=1};
	__property bool Zoom = {read=FZoom, write=FZoom, default=1};
	__property bool Drag = {read=FDragAllow, write=FDragAllow, default=1};
	__property double Scale = {read=GetScale, write=SetAbsScale};
	__property bool MouseRect = {read=FMouseRect, write=SetMouseRect, default=1};
	__property bool IsBigScale = {read=FIsBigScale, write=FIsBigScale, nodefault};
};


//-- var, const, procedure ---------------------------------------------------
static const unsigned MaxSizeWinNT = 0xffffffff;
static const Word MaxSizeWin98 = 0x7fff;
extern PACKAGE void __fastcall Register(void);

}	/* namespace Sgimage */
using namespace Sgimage;
#pragma option pop	// -w-
#pragma option pop	// -Vx

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