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

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

#ifndef RVResizeHPP
#define RVResizeHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <RVItem.hpp>	// Pascal unit
#include <DLines.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Rvresize
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TRVResizeHandleIndex { rvrhLeftTop, rvrhRightTop, rvrhRightBottom, rvrhLeftBottom, rvrhTop, rvrhRight, rvrhBottom, rvrhLeft };
#pragma option pop

#pragma option push -b-
enum TRVResizeHandlesPosition { rvhpInside, rvhpOutside };
#pragma option pop

class DELPHICLASS TRVItemResizer;
class PASCALIMPLEMENTATION TRVItemResizer : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	int FWidth;
	int FHeight;
	Dlines::TRVDrawLineInfo* FDrawItem;
	int FDrawItemNo;
	int FItemNo;
	bool FDragging;
	bool FDragCancelled;
	int FDx;
	int FDy;
	#pragma pack(push, 1)
	Types::TRect FDragRect;
	#pragma pack(pop)
	
	TRVResizeHandleIndex FDraggedResizeHandle;
	Rvitem::TCustomRVItemInfo* FItem;
	TRVResizeHandlesPosition FPosition;
	bool __fastcall IsCornerResizeHandle(TRVResizeHandleIndex Index);
	void __fastcall GetResizeHandleShift(TRVResizeHandleIndex Index, int &DX, int &DY);
	
public:
	__fastcall TRVItemResizer(Dlines::TRVDrawLineInfo* ADrawItem, Rvitem::TCustomRVItemInfo* AItem, int ADrawItemNo);
	void __fastcall Draw(Graphics::TCanvas* Canvas, int HOffs, int VOffs);
	void __fastcall GetResizeHandleCoords(TRVResizeHandleIndex Index, bool Shifted, int &X, int &Y);
	bool __fastcall GetResizeHandleAt(int X, int Y, int HOffs, int VOffs, TRVResizeHandleIndex &Index);
	bool __fastcall MouseDown(int X, int Y, int HOffs, int VOffs);
	void __fastcall MouseUp(int X, int Y, int HOffs, int VOffs);
	void __fastcall DragTo(Classes::TShiftState Shift, int X, int Y, int HOffs, int VOffs);
	Controls::TCursor __fastcall GetResizeHandleCursor(TRVResizeHandleIndex Index);
	void __fastcall XorDrawing(Graphics::TCanvas* Canvas, int HOffs, int VOffs);
	void __fastcall CancelDrag(void);
	void __fastcall UpdateItem(Dlines::TRVDrawLineInfo* ADrawItem, Rvitem::TCustomRVItemInfo* AItem, int ADrawItemNo);
	__property bool Dragging = {read=FDragging, nodefault};
	__property bool DragCancelled = {read=FDragCancelled, nodefault};
	__property int ItemNo = {read=FItemNo, nodefault};
	__property int DrawItemNo = {read=FDrawItemNo, nodefault};
	__property Dlines::TRVDrawLineInfo* DrawItem = {read=FDrawItem};
	__property int Width = {read=FWidth, nodefault};
	__property int Height = {read=FHeight, nodefault};
	__property TRVResizeHandlesPosition Position = {read=FPosition, write=FPosition, nodefault};
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TRVItemResizer(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const Shortint RichViewResizeHandleSize = 0x6;

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

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