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

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

#ifndef BaseGridHPP
#define BaseGridHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Grids.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 Basegrid
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TVAlignment { vtaTop, vtaCenter, vtaBottom };
#pragma option pop

class DELPHICLASS TCellProperties;
class DELPHICLASS TBaseGrid;
typedef void __fastcall (__closure *TGetDisplTextEvent)(System::TObject* Sender, int ACol, int ARow, 
	AnsiString &Value);

class PASCALIMPLEMENTATION TBaseGrid : public Grids::TStringGrid 
{
	typedef Grids::TStringGrid inherited;
	
private:
	bool FDefaultDrawing;
	int FGridLineWidth;
	Graphics::TColor FGridLineColor;
	int FPaintID;
	bool FCustomSelect;
	TGetDisplTextEvent FOnGetDisplText;
	bool FHideLastRow;
	int FNormalRowCount;
	bool __fastcall GetDefaultDrawing(void);
	void __fastcall SetDefaultDrawing(const bool Value);
	int __fastcall GetGridLineWidth(void);
	HIDESBASE void __fastcall SetGridLineWidth(const int Value);
	void __fastcall SetGridLineColor(const Graphics::TColor Value);
	void __fastcall SetObjectEx(int c, int r, const System::TObject* Value);
	System::TObject* __fastcall GetObjectEx(int c, int r);
	TCellProperties* __fastcall GetCellProperties(int c, int r);
	void __fastcall SetCellProperties(int c, int r, const TCellProperties* Value);
	AnsiString __fastcall GetCellEx(int c, int r);
	void __fastcall SetCellEx(int c, int r, const AnsiString Value);
	System::TObject* __fastcall GetGraphicObjectEx(int c, int r);
	void __fastcall SetGraphicObjectEx(int c, int r, const System::TObject* Value);
	void __fastcall RepaintFixedMergedCols(void);
	void __fastcall RepaintFixedMergedRows(void);
	System::TObject* __fastcall GetGridObject(int c, int r);
	void __fastcall SetGridObject(int c, int r, const System::TObject* Value);
	
protected:
	void __fastcall CopyRows(int ARow1, int ARow2);
	void __fastcall CopyCols(int ACol1, int ACol2);
	void __fastcall NilRow(int ARow);
	void __fastcall NilCol(int ACol);
	void __fastcall NilCell(int ACol, int ARow);
	void __fastcall SelectBaseCell(void);
	virtual bool __fastcall IsFixed(int ACol, int ARow);
	bool __fastcall IsSelected(int ACol, int ARow);
	virtual int __fastcall NodeIndent(int ARow);
	virtual bool __fastcall HasNodes(void);
	int __fastcall FixedColsWidth(void);
	int __fastcall FixedRowsHeight(void);
	DYNAMIC void __fastcall TopLeftChanged(void);
	virtual void __fastcall DrawCell(int ACol, int ARow, const Windows::TRect &ARect, Grids::TGridDrawState 
		AState);
	virtual void __fastcall DrawGridCell(Graphics::TCanvas* Canvas, int ACol, int ARow, const Windows::TRect 
		&ARect, Grids::TGridDrawState AState);
	bool __fastcall HasCellProperties(int ACol, int ARow);
	virtual bool __fastcall SelectCell(int ACol, int ARow);
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	DYNAMIC bool __fastcall DoMouseWheelDown(Classes::TShiftState Shift, const Windows::TPoint &MousePos
		);
	DYNAMIC bool __fastcall DoMouseWheelUp(Classes::TShiftState Shift, const Windows::TPoint &MousePos)
		;
	virtual void __fastcall Paint(void);
	DYNAMIC void __fastcall SetEditText(int ACol, int ARow, const AnsiString Value);
	DYNAMIC AnsiString __fastcall GetEditText(int ACol, int ARow);
	virtual void __fastcall GetVisualProperties(int ACol, int ARow, Grids::TGridDrawState &AState, bool 
		Print, bool Select, Graphics::TBrush* ABrush, Graphics::TFont* AFont, Classes::TAlignment &HA, TVAlignment 
		&VA, bool &WW);
	bool __fastcall IsBaseCellEx(int ACol, int ARow, int &MCol, int &MRow);
	Windows::TRect __fastcall GetCellRect(int c, int r);
	__property int PaintID = {read=FPaintID, nodefault};
	__property bool CustomSelect = {read=FCustomSelect, write=FCustomSelect, nodefault};
	__property TCellProperties* CellProperties[int c][int r] = {read=GetCellProperties, write=SetCellProperties
		};
	__property bool HideLastRow = {read=FHideLastRow, write=FHideLastRow, nodefault};
	__property int NormalRowCount = {read=FNormalRowCount, write=FNormalRowCount, nodefault};
	__property System::TObject* GridObjects[int c][int r] = {read=GetGridObject, write=SetGridObject};
	
public:
	__fastcall virtual TBaseGrid(Classes::TComponent* aOwner);
	__fastcall virtual ~TBaseGrid(void);
	HIDESBASE Windows::TRect __fastcall CellRect(int c, int r);
	Windows::TPoint __fastcall CellSize(int c, int r);
	bool __fastcall IsBaseCell(int ACol, int ARow);
	bool __fastcall IsMergedCell(int ACol, int ARow);
	bool __fastcall IsXMergedCell(int ACol, int ARow);
	bool __fastcall IsYMergedCell(int ACol, int ARow);
	Windows::TPoint __fastcall BaseCell(int ACol, int ARow);
	Windows::TRect __fastcall FullCell(int c, int r);
	Windows::TPoint __fastcall CellSpan(int ACol, int ARow);
	int __fastcall MinRowSpan(int ARow);
	int __fastcall MaxRowSpan(int ARow);
	bool __fastcall RowSpanIdentical(int ARow1, int ARow2);
	bool __fastcall ColSpanIdentical(int ACol1, int ACol2);
	virtual void __fastcall MergeCells(int c, int r, int spanx, int spany);
	virtual void __fastcall SplitCells(int c, int r);
	void __fastcall RepaintCell(int c, int r);
	__property System::TObject* Objects[int c][int r] = {read=GetObjectEx, write=SetObjectEx};
	__property System::TObject* GraphicObjects[int c][int r] = {read=GetGraphicObjectEx, write=SetGraphicObjectEx
		};
	__property AnsiString Cells[int c][int r] = {read=GetCellEx, write=SetCellEx};
	
__published:
	__property bool DefaultDrawing = {read=GetDefaultDrawing, write=SetDefaultDrawing, nodefault};
	__property int GridLineWidth = {read=GetGridLineWidth, write=SetGridLineWidth, nodefault};
	__property Graphics::TColor GridLineColor = {read=FGridLineColor, write=SetGridLineColor, nodefault
		};
	__property TGetDisplTextEvent OnGetDisplText = {read=FOnGetDisplText, write=FOnGetDisplText};
public:
		
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TBaseGrid(HWND ParentWindow) : Grids::TStringGrid(
		ParentWindow) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TCellProperties : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	TBaseGrid* FOwnerGrid;
	int FOwnerCol;
	int FOwnerRow;
	System::TObject* FObject;
	System::TObject* FGraphicObject;
	Graphics::TBrushStyle FBrushStyle;
	Graphics::TColor FBrushColor;
	int FFontSize;
	Graphics::TColor FFontColor;
	Graphics::TFontStyles FFontStyle;
	int FCellSpanY;
	int FCellSpanX;
	int FBorderWidth;
	Graphics::TColor FBorderColor;
	Classes::TAlignment FAlignment;
	TVAlignment FVAlignment;
	int FPaintID;
	bool FWordWrap;
	bool FIsBaseCell;
	void __fastcall SetBrushColor(const Graphics::TColor Value);
	void __fastcall SetAlignment(const Classes::TAlignment Value);
	void __fastcall SetVAlignment(const TVAlignment Value);
	void __fastcall SetWordWrap(const bool Value);
	Windows::TPoint __fastcall GetBaseCell(int c, int r);
	
protected:
	__property Windows::TPoint BaseCell[int c][int r] = {read=GetBaseCell};
	__property bool IsBaseCell = {read=FIsBaseCell, write=FIsBaseCell, nodefault};
	__property int CellSpanX = {read=FCellSpanX, write=FCellSpanX, nodefault};
	__property int CellSpanY = {read=FCellSpanY, write=FCellSpanY, nodefault};
	__property int PaintID = {read=FPaintID, write=FPaintID, nodefault};
	__property System::TObject* GraphicObject = {read=FGraphicObject, write=FGraphicObject};
	
public:
	__fastcall TCellProperties(TBaseGrid* AOwner, int ACol, int ARow);
	
__published:
	__property Classes::TAlignment Alignment = {read=FAlignment, write=SetAlignment, nodefault};
	__property Graphics::TColor BorderColor = {read=FBorderColor, write=FBorderColor, nodefault};
	__property int BorderWidth = {read=FBorderWidth, write=FBorderWidth, nodefault};
	__property Graphics::TColor BrushColor = {read=FBrushColor, write=SetBrushColor, nodefault};
	__property Graphics::TBrushStyle BrushStyle = {read=FBrushStyle, write=FBrushStyle, nodefault};
	__property System::TObject* CellObject = {read=FObject, write=FObject};
	__property Graphics::TColor FontColor = {read=FFontColor, write=FFontColor, nodefault};
	__property int FontSize = {read=FFontSize, write=FFontSize, nodefault};
	__property Graphics::TFontStyles FontStyle = {read=FFontStyle, write=FFontStyle, nodefault};
	__property TVAlignment VAlignment = {read=FVAlignment, write=SetVAlignment, nodefault};
	__property bool WordWrap = {read=FWordWrap, write=SetWordWrap, nodefault};
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TCellProperties(void) { }
	#pragma option pop
	
};


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

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

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