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

// (DO NOT EDIT: machine generated header) 'dbadvgrd.pas' rev: 4.00

#ifndef dbadvgrdHPP
#define dbadvgrdHPP

#pragma delphiheader begin
#pragma option push -w-
#include <AdvObj.hpp>	// Pascal unit
#include <AdvGrid.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Db.hpp>	// Pascal unit
#include <Grids.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Messages.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 Dbadvgrd
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS EDBAdvGridError;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION EDBAdvGridError : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall EDBAdvGridError(const AnsiString Msg) : Sysutils::Exception(
		Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall EDBAdvGridError(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 EDBAdvGridError(int Ident, Extended Dummy) : Sysutils::Exception(
		Ident, Dummy) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall EDBAdvGridError(int Ident, const System::TVarRec * Args
		, const int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall EDBAdvGridError(const AnsiString Msg, int AHelpContext
		) : Sysutils::Exception(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall EDBAdvGridError(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 EDBAdvGridError(int Ident, int AHelpContext) : Sysutils::Exception(
		Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall EDBAdvGridError(int Ident, const System::TVarRec 
		* Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext
		) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~EDBAdvGridError(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

class DELPHICLASS TStringGridField;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TStringGridField : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
private:
	AnsiString fFieldName;
	AnsiString fTitle;
	void __fastcall SetFieldName(const AnsiString value);
	void __fastcall SetTitle(const AnsiString value);
	HIDESBASE void __fastcall Changed(void);
	
protected:
	virtual AnsiString __fastcall GetDisplayName();
	
public:
	__fastcall virtual TStringGridField(Classes::TCollection* Collection);
	__fastcall virtual ~TStringGridField(void);
	
__published:
	__property AnsiString FieldName = {read=fFieldName, write=SetFieldName};
	__property AnsiString Title = {read=fTitle, write=SetTitle};
};

#pragma pack(pop)

class DELPHICLASS TStringGridFields;
class DELPHICLASS TDBAdvStringGrid;
class DELPHICLASS TAdvGridDataLink;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TAdvGridDataLink : public Db::TDataLink 
{
	typedef Db::TDataLink inherited;
	
private:
	TDBAdvStringGrid* FGrid;
	
protected:
	virtual void __fastcall ActiveChanged(void);
	virtual void __fastcall DataSetChanged(void);
	virtual void __fastcall DataSetScrolled(int distance);
	virtual void __fastcall RecordChanged(Db::TField* Field);
	void __fastcall BeforeRecordDeleted(Db::TDataSet* DataSet);
	void __fastcall AfterRecordDeleted(Db::TDataSet* DataSet);
	
public:
	__fastcall TAdvGridDataLink(TDBAdvStringGrid* AGrid);
	__fastcall virtual ~TAdvGridDataLink(void);
};

#pragma pack(pop)

#pragma option push -b-
enum TDataMapMode { dmRow, dmCell };
#pragma option pop

#pragma pack(push, 4)
class PASCALIMPLEMENTATION TDBAdvStringGrid : public Advgrid::TAdvStringGrid 
{
	typedef Advgrid::TAdvStringGrid inherited;
	
private:
	int FMapping[256];
	TAdvGridDataLink* FDataLink;
	Db::TDataSetState FOldState;
	TStringGridFields* FStringGridFields;
	bool FCloseWhenLoaded;
	bool FLoaded;
	bool FSelectScroll;
	bool FDataScroll;
	bool fKeepLinked;
	bool fPageMode;
	Classes::TStringList* fHTMLTemplate;
	TDataMapMode fDataMapMode;
	int fMaxRows;
	int fLastRow;
	int fLastCol;
	Advobj::TIntList* fWidths;
	int fFixedColumns;
	bool fShowPictureFields;
	bool fShowMemoFields;
	bool fShowBooleanFields;
	bool fShowIndicator;
	bool fDeleting;
	Db::TDataSource* __fastcall GetDataSource(void);
	void __fastcall SetDatasource(Db::TDataSource* Value);
	void __fastcall SetCloseWhenLoaded(bool Value);
	void __fastcall SetStringGridFields(TStringGridFields* value);
	bool __fastcall CheckDataSet(void);
	int __fastcall MaxVisibleRows(void);
	int __fastcall MaxRowsInDataset(void);
	void __fastcall SetBufferCount(void);
	bool __fastcall InitMapping(void);
	void __fastcall SetPageMode(const bool Value);
	void __fastcall SetHTMLTemplate(const Classes::TStringList* Value);
	HIDESBASE MESSAGE void __fastcall WMKeyDown(Messages::TWMKey &Msg);
	HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &WMScroll);
	HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMKey &Msg);
	void __fastcall StoreColWidths(void);
	void __fastcall ReStoreColWidths(void);
	void __fastcall SetShowIndicator(const bool Value);
	
protected:
	void __fastcall ClearAll(void);
	virtual void __fastcall Loaded(void);
	virtual bool __fastcall SelectCell(int ACol, int ARow);
	void __fastcall SetActive(bool active);
	void __fastcall ShowFields(void);
	virtual void __fastcall GetCellAlign(int ACol, int ARow, Classes::TAlignment &AAlignment);
	bool __fastcall UpdateDataRow(int arow);
	bool __fastcall UpdateDataCell(int acol, int arow);
	void __fastcall UpdateVisibleCells(void);
	void __fastcall UpdateCursorPos(void);
	void __fastcall UpdateRowCount(void);
	void __fastcall TemplateChanged(System::TObject* Sender);
	virtual void __fastcall DrawCell(int ACol, int ARow, const Windows::TRect &ARect, Grids::TGridDrawState 
		AState);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
		);
	
public:
	__fastcall virtual TDBAdvStringGrid(Classes::TComponent* AOwner);
	__fastcall virtual ~TDBAdvStringGrid(void);
	virtual int __fastcall GetVersionNr(void);
	virtual AnsiString __fastcall GetVersionString();
	void __fastcall LoadFromDataSource(void);
	
__published:
	__property bool CloseWhenLoaded = {read=FCloseWhenLoaded, write=SetCloseWhenLoaded, nodefault};
	__property bool KeepLinked = {read=fKeepLinked, write=fKeepLinked, nodefault};
	__property TDataMapMode DataMapMode = {read=fDataMapMode, write=fDataMapMode, nodefault};
	__property Db::TDataSource* Datasource = {read=GetDataSource, write=SetDatasource};
	__property TStringGridFields* Fields = {read=FStringGridFields, write=SetStringGridFields};
	__property bool PageMode = {read=fPageMode, write=SetPageMode, nodefault};
	__property Classes::TStringList* HTMLTemplate = {read=fHTMLTemplate, write=SetHTMLTemplate};
	__property bool ShowMemoFields = {read=fShowMemoFields, write=fShowMemoFields, nodefault};
	__property bool ShowPictureFields = {read=fShowPictureFields, write=fShowPictureFields, nodefault};
		
	__property bool ShowBooleanFields = {read=fShowBooleanFields, write=fShowBooleanFields, nodefault};
		
	__property bool ShowIndicator = {read=fShowIndicator, write=SetShowIndicator, nodefault};
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TDBAdvStringGrid(HWND ParentWindow) : Advgrid::TAdvStringGrid(
		ParentWindow) { }
	#pragma option pop
	
};

#pragma pack(pop)

#pragma pack(push, 4)
class PASCALIMPLEMENTATION TStringGridFields : public Classes::TCollection 
{
	typedef Classes::TCollection inherited;
	
private:
	TDBAdvStringGrid* fOwner;
	HIDESBASE TStringGridField* __fastcall GetItem(int Index);
	HIDESBASE void __fastcall SetItem(int Index, const TStringGridField* Value);
	
public:
	__fastcall TStringGridFields(TDBAdvStringGrid* aOwner);
	
protected:
	virtual void __fastcall Update(Classes::TCollectionItem* Item);
	
public:
	HIDESBASE TStringGridField* __fastcall Add(void);
	HIDESBASE TStringGridField* __fastcall Insert(int index);
	__property TStringGridField* Items[int Index] = {read=GetItem, write=SetItem};
	DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
public:
	#pragma option push -w-inl
	/* TCollection.Destroy */ inline __fastcall virtual ~TStringGridFields(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
static const Byte MAX_FIELDS = 0xff;

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

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