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

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

#ifndef EnCtlRszHPP
#define EnCtlRszHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Menus.hpp>	// Pascal unit
#include <ExtCtrls.hpp>	// Pascal unit
#include <StdCtrls.hpp>	// Pascal unit
#include <Dialogs.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 Enctlrsz
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TControlResizerEvent)(System::TObject* Sender, const Windows::TRect 
	&OldBounds, const Windows::TRect &NewBounds);

class DELPHICLASS TControlResizer;
class PASCALIMPLEMENTATION TControlResizer : public Controls::TGraphicControl 
{
	typedef Controls::TGraphicControl inherited;
	
private:
	HDC FLineDC;
	int FNewLeft;
	int FNewTop;
	int FNewWidth;
	int FNewHeight;
	int FMinWidth;
	int FMinHeight;
	bool FMoving;
	bool FSizing;
	Controls::TControl* FTargetControl;
	Extctrls::TShape* FHookNW;
	Extctrls::TShape* FHookSW;
	Extctrls::TShape* FHookSE;
	Extctrls::TShape* FHookNE;
	Extctrls::TShape* FHookN;
	Extctrls::TShape* FHookW;
	Extctrls::TShape* FHookS;
	Extctrls::TShape* FHookE;
	Windows::TPoint FMaxPos;
	Windows::TPoint FMinPos;
	Windows::TPoint FDelta;
	Windows::TPoint FClick;
	int FBoxSize;
	int FLineSize;
	bool FCtrl3D;
	bool FMovable;
	bool FResizable;
	bool FControlChanging;
	TControlResizerEvent FOnResizing;
	TControlResizerEvent FOnResized;
	TControlResizerEvent FOnMoving;
	TControlResizerEvent FOnMoved;
	Graphics::TColor FBoxColor;
	bool FHandlesCreated;
	Windows::TRect FOldBounds;
	void __fastcall SetBoxSize(int Value);
	void __fastcall SetTargetControl(Controls::TControl* Value);
	void __fastcall SetBoxColor(Graphics::TColor Value);
	void __fastcall CreateHandles(void);
	
protected:
	virtual void __fastcall SetParent(Controls::TWinControl* AParent);
	void __fastcall SetHandlesParent(Controls::TWinControl* AParent);
	void __fastcall ManageMouseDown(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState 
		Shift, int X, int Y);
	void __fastcall ManageMouseMove(System::TObject* Sender, Classes::TShiftState Shift, int X, int Y);
		
	void __fastcall ManageMouseUp(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState 
		Shift, int X, int Y);
	void __fastcall ManageMovingMouseDown(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState 
		Shift, int X, int Y);
	void __fastcall ManageMovingMouseMove(System::TObject* Sender, Classes::TShiftState Shift, int X, int 
		Y);
	void __fastcall ManageMovingMouseUp(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState 
		Shift, int X, int Y);
	MESSAGE void __fastcall WMEraseBack(Messages::TMessage &Message);
	void __fastcall RealignHandles(void);
	void __fastcall UpdateTargetControl(void);
	void __fastcall UpdatePosFromTargetControl(void);
	void __fastcall AllocateLineDC(void);
	void __fastcall DrawLine(void);
	void __fastcall ReleaseLineDC(void);
	virtual void __fastcall Resized(void);
	virtual void __fastcall Moved(void);
	
public:
	__fastcall virtual TControlResizer(Classes::TComponent* AOwner);
	virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
	void __fastcall HideHandles(void);
	void __fastcall ShowHandles(void);
	HIDESBASE MESSAGE void __fastcall CMVisibleChanged(Messages::TMessage &Message);
	
__published:
	__property OnClick ;
	__property OnDblClick ;
	__property OnMouseDown ;
	__property OnMouseMove ;
	__property OnMouseUp ;
	__property PopupMenu ;
	__property Width ;
	__property Height ;
	__property int MinWidth = {read=FMinWidth, write=FMinWidth, nodefault};
	__property int MinHeight = {read=FMinHeight, write=FMinHeight, nodefault};
	__property int BoxSize = {read=FBoxSize, write=SetBoxSize, nodefault};
	__property Graphics::TColor BoxColor = {read=FBoxColor, write=SetBoxColor, nodefault};
	__property int LineSize = {read=FLineSize, write=FLineSize, nodefault};
	__property bool Resizable = {read=FResizable, write=FResizable, nodefault};
	__property bool Movable = {read=FMovable, write=FMovable, nodefault};
	__property Controls::TControl* TargetControl = {read=FTargetControl, write=SetTargetControl};
	__property TControlResizerEvent OnResizing = {read=FOnResizing, write=FOnResizing};
	__property TControlResizerEvent OnResized = {read=FOnResized, write=FOnResized};
	__property TControlResizerEvent OnMoving = {read=FOnMoving, write=FOnMoving};
	__property TControlResizerEvent OnMoved = {read=FOnMoved, write=FOnMoved};
public:
	#pragma option push -w-inl
	/* TGraphicControl.Destroy */ inline __fastcall virtual ~TControlResizer(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const Shortint CDefaultResizerBoxSize = 0x5;

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

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