home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 May
/
VPR9705A.ISO
/
VPR_DATA
/
PROGRAM
/
CBTRIAL
/
SETUP
/
DATA.Z
/
DBGRIDS.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-14
|
21KB
|
522 lines
//----------------------------------------------------------------------------
// DBGrids.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
// From: DBGrids.pas
//----------------------------------------------------------------------------
#ifndef DBGridsHPP
#define DBGridsHPP
//----------------------------------------------------------------------------
#include <Menus.hpp>
#include <DBCtrls.hpp>
#include <Grids.hpp>
#include <DBTables.hpp>
#include <DB.hpp>
#include <Graphics.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Messages.hpp>
#include <SysUtils.hpp>
#include <Windows.hpp>
#include <System.hpp>
#pragma warn -par
#pragma warn -hid
#pragma warn -inl
namespace Dbgrids
{
//-- type declarations -------------------------------------------------------
enum TColumnValue { cvColor, cvWidth, cvFont, cvAlignment, cvReadOnly, cvTitleColor, cvTitleCaption,
cvTitleAlignment, cvTitleFont };
typedef Set<TColumnValue, cvColor, cvTitleFont> TColumnValues;
class __declspec(delphiclass) TColumnTitle;
class __declspec(delphiclass) TColumn;
enum TColumnButtonStyle { cbsAuto, cbsEllipsis, cbsNone };
class __declspec(delphiclass) TCustomDBGrid;
class __declspec(pascalimplementation) TColumn : public Classes::TCollectionItem
{
typedef Classes::TCollectionItem inherited;
private:
Db::TField* FField;
System::AnsiString FFieldName;
Graphics::TColor FColor;
int FWidth;
TColumnTitle* FTitle;
Graphics::TFont* FFont;
Classes::TStrings* FPickList;
int FDropDownRows;
TColumnButtonStyle FButtonStyle;
TAlignment FAlignment;
bool FReadonly;
TColumnValues FAssignedValues;
void __fastcall FontChanged(System::TObject* Sender);
Classes::TAlignment __fastcall GetAlignment(void);
Graphics::TColor __fastcall GetColor(void);
Db::TField* __fastcall GetField(void);
Graphics::TFont* __fastcall GetFont(void);
Classes::TStrings* __fastcall GetPickList(void);
bool __fastcall GetReadOnly(void);
int __fastcall GetWidth(void);
bool __fastcall IsAlignmentStored(void);
bool __fastcall IsColorStored(void);
bool __fastcall IsFontStored(void);
bool __fastcall IsReadOnlyStored(void);
bool __fastcall IsWidthStored(void);
virtual void __fastcall SetAlignment(Classes::TAlignment Value);
void __fastcall SetButtonStyle(TColumnButtonStyle Value);
void __fastcall SetColor(Graphics::TColor Value);
virtual void __fastcall SetField(Db::TField* Value);
void __fastcall SetFieldName(const System::AnsiString Value);
void __fastcall SetFont(Graphics::TFont* Value);
void __fastcall SetPickList(Classes::TStrings* Value);
virtual void __fastcall SetReadOnly(bool Value);
void __fastcall SetTitle(TColumnTitle* Value);
virtual void __fastcall SetWidth(int Value);
protected:
virtual TColumnTitle* __fastcall CreateTitle(void);
TCustomDBGrid* __fastcall GetGrid(void);
void __fastcall RefreshDefaultFont(void);
public:
__fastcall virtual TColumn(Classes::TCollection* Collection);
__fastcall virtual ~TColumn(void);
virtual void __fastcall Assign(Classes::TPersistent* Source);
Classes::TAlignment __fastcall DefaultAlignment(void);
Graphics::TColor __fastcall DefaultColor(void);
Graphics::TFont* __fastcall DefaultFont(void);
bool __fastcall DefaultReadOnly(void);
int __fastcall DefaultWidth(void);
virtual void __fastcall RestoreDefaults(void);
__property TColumnValues AssignedValues = {read=FAssignedValues, nodefault};
__property Db::TField* Field = {read=GetField, write=SetField, nodefault};
__published:
__property Classes::TAlignment Alignment = {read=GetAlignment, write=SetAlignment, stored=IsAlignmentStored
, nodefault};
__property TColumnButtonStyle ButtonStyle = {read=FButtonStyle, write=SetButtonStyle, default=0};
__property Graphics::TColor Color = {read=GetColor, write=SetColor, stored=IsColorStored, nodefault
};
__property int DropDownRows = {read=FDropDownRows, write=FDropDownRows, default=7};
__property System::AnsiString FieldName = {read=FFieldName, write=SetFieldName, nodefault};
__property Graphics::TFont* Font = {read=GetFont, write=SetFont, stored=IsFontStored, nodefault};
__property Classes::TStrings* PickList = {read=GetPickList, write=SetPickList, nodefault};
__property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, stored=IsReadOnlyStored, nodefault
};
__property TColumnTitle* Title = {read=FTitle, write=SetTitle, nodefault};
__property int Width = {read=GetWidth, write=SetWidth, stored=IsWidthStored, nodefault};
};
class __declspec(pascalimplementation) TColumnTitle : public Classes::TPersistent
{
typedef Classes::TPersistent inherited;
private:
TColumn* FColumn;
System::AnsiString FCaption;
Graphics::TFont* FFont;
Graphics::TColor FColor;
TAlignment FAlignment;
void __fastcall FontChanged(System::TObject* Sender);
Classes::TAlignment __fastcall GetAlignment(void);
Graphics::TColor __fastcall GetColor(void);
System::AnsiString __fastcall GetCaption(void);
Graphics::TFont* __fastcall GetFont(void);
bool __fastcall IsAlignmentStored(void);
bool __fastcall IsColorStored(void);
bool __fastcall IsFontStored(void);
bool __fastcall IsCaptionStored(void);
void __fastcall SetAlignment(Classes::TAlignment Value);
void __fastcall SetColor(Graphics::TColor Value);
void __fastcall SetFont(Graphics::TFont* Value);
virtual void __fastcall SetCaption(const System::AnsiString Value);
protected:
void __fastcall RefreshDefaultFont(void);
public:
__fastcall TColumnTitle(TColumn* Column);
__fastcall virtual ~TColumnTitle(void);
virtual void __fastcall Assign(Classes::TPersistent* Source);
Classes::TAlignment __fastcall DefaultAlignment(void);
Graphics::TColor __fastcall DefaultColor(void);
Graphics::TFont* __fastcall DefaultFont(void);
System::AnsiString __fastcall DefaultCaption(void);
virtual void __fastcall RestoreDefaults(void);
__published:
__property Classes::TAlignment Alignment = {read=GetAlignment, write=SetAlignment, stored=IsAlignmentStored
, nodefault};
__property System::AnsiString Caption = {read=GetCaption, write=SetCaption, stored=IsCaptionStored,
nodefault};
__property Graphics::TColor Color = {read=GetColor, write=SetColor, stored=IsColorStored, nodefault
};
__property Graphics::TFont* Font = {read=GetFont, write=SetFont, stored=IsFontStored, nodefault};
};
typedef System::TMetaClass*TColumnClass;
enum TDBGridColumnsState { csDefault, csCustomized };
class __declspec(delphiclass) TDBGridColumns;
class __declspec(pascalimplementation) TDBGridColumns : public Classes::TCollection
{
typedef Classes::TCollection inherited;
private:
TCustomDBGrid* FGrid;
TColumn* __fastcall GetColumn(int Index);
TDBGridColumnsState __fastcall GetState(void);
void __fastcall SetColumn(int Index, TColumn* Value);
void __fastcall SetState(TDBGridColumnsState NewState);
protected:
virtual void __fastcall Update(Classes::TCollectionItem* Item);
public:
__fastcall TDBGridColumns(TCustomDBGrid* Grid, System::TMetaClass* ColumnClass);
HIDESBASE TColumn* __fastcall Add(void);
void __fastcall RestoreDefaults(void);
void __fastcall RebuildColumns(void);
__property TDBGridColumnsState State = {read=GetState, write=SetState, nodefault};
__property TCustomDBGrid* Grid = {read=FGrid, nodefault};
__property TColumn* Items[int Index] = {read=GetColumn, write=SetColumn/*, default*/};
public:
/* TCollection.Destroy */ __fastcall virtual ~TDBGridColumns(void) { }
};
class __declspec(delphiclass) TGridDataLink;
class __declspec(pascalimplementation) TGridDataLink : public Db::TDataLink
{
typedef Db::TDataLink inherited;
private:
TCustomDBGrid* FGrid;
int FFieldCount;
int FFieldMapSize;
void *FFieldMap;
bool FModified;
bool FInUpdateData;
bool FSparseMap;
bool __fastcall GetDefaultFields(void);
Db::TField* __fastcall GetFields(int I);
protected:
virtual void __fastcall ActiveChanged(void);
virtual void __fastcall DataSetChanged(void);
virtual void __fastcall DataSetScrolled(int Distance);
virtual void __fastcall FocusControl(Db::TFieldRef Field);
virtual void __fastcall EditingChanged(void);
virtual void __fastcall LayoutChanged(void);
virtual void __fastcall RecordChanged(Db::TField* Field);
virtual void __fastcall UpdateData(void);
int __fastcall GetMappedIndex(int ColIndex);
public:
__fastcall TGridDataLink(TCustomDBGrid* AGrid);
__fastcall virtual ~TGridDataLink(void);
bool __fastcall AddMapping(const System::AnsiString FieldName);
void __fastcall ClearMapping(void);
void __fastcall Modified(void);
void __fastcall Reset(void);
__property bool DefaultFields = {read=GetDefaultFields, nodefault};
__property int FieldCount = {read=FFieldCount, nodefault};
__property Db::TField* Fields[int I] = {read=GetFields};
__property bool SparseMap = {read=FSparseMap, write=FSparseMap, nodefault};
};
class __declspec(delphiclass) TBookmarkList;
class __declspec(pascalimplementation) TBookmarkList : public System::TObject
{
typedef System::TObject inherited;
private:
Classes::TStringList* FList;
TCustomDBGrid* FGrid;
System::AnsiString FCache;
int FCacheIndex;
bool FCacheFind;
bool FLinkActive;
int __fastcall GetCount(void);
bool __fastcall GetCurrentRowSelected(void);
System::AnsiString __fastcall GetItem(int Index);
int __fastcall Insert(const System::AnsiString Item);
void __fastcall SetCurrentRowSelected(bool Value);
void __fastcall StringsChanged(System::TObject* Sender);
protected:
System::AnsiString __fastcall CurrentRow(void);
int __fastcall Compare(const System::AnsiString Item1, const System::AnsiString Item2);
void __fastcall LinkActive(bool Value);
public:
__fastcall TBookmarkList(TCustomDBGrid* AGrid);
__fastcall virtual ~TBookmarkList(void);
void __fastcall Clear(void);
void __fastcall Delete(void);
bool __fastcall Find(const System::AnsiString Item, int &Index);
int __fastcall IndexOf(const System::AnsiString Item);
bool __fastcall Refresh(void);
__property int Count = {read=GetCount, nodefault};
__property bool CurrentRowSelected = {read=GetCurrentRowSelected, write=SetCurrentRowSelected, nodefault
};
__property System::AnsiString Items[int Index] = {read=GetItem/*, default*/};
};
enum TDBGridOption { dgEditing, dgAlwaysShowEditor, dgTitles, dgIndicator, dgColumnResize, dgColLines,
dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect
};
typedef Set<TDBGridOption, dgEditing, dgMultiSelect> TDBGridOptions;
typedef void __fastcall (__closure *TDrawDataCellEvent)(System::TObject* Sender, const Windows::TRect
&Rect, Db::TField* Field, Grids::TGridDrawState State);
typedef void __fastcall (__closure *TDrawColumnCellEvent)(System::TObject* Sender, const Windows::TRect
&Rect, int DataCol, TColumn* Column, Grids::TGridDrawState State);
class __declspec(pascalimplementation) TCustomDBGrid : public Grids::TCustomGrid
{
typedef Grids::TCustomGrid inherited;
private:
Controls::TImageList* FIndicators;
Graphics::TFont* FTitleFont;
bool FReadOnly;
bool FConnected;
bool FUserChange;
bool FDataChanged;
bool FEditRequest;
bool FLayoutFromDataset;
TDBGridOptions FOptions;
Byte FTitleOffset;
Byte FIndicatorOffset;
Byte FUpdateLock;
Byte FLayoutLock;
bool FInColExit;
bool FDefaultDrawing;
bool FSelfChangingTitleFont;
bool FSelecting;
int FSelRow;
TGridDataLink* FDataLink;
Classes::TNotifyEvent FOnColEnter;
Classes::TNotifyEvent FOnColExit;
TDrawDataCellEvent FOnDrawDataCell;
TDrawColumnCellEvent FOnDrawColumnCell;
System::AnsiString FEditText;
TDBGridColumns* FColumns;
Classes::TNotifyEvent FOnEditButtonClick;
Grids::TMovedEvent FOnColumnMoved;
TBookmarkList* FBookmarks;
System::AnsiString FSelectionAnchor;
bool __fastcall AcquireFocus(void);
void __fastcall DataChanged(void);
void __fastcall EditingChanged(void);
bool __fastcall Edit(void);
Db::TDataSource* __fastcall GetDataSource(void);
int __fastcall GetFieldCount(void);
Db::TField* __fastcall GetFields(int FieldIndex);
Db::TField* __fastcall GetSelectedField(void);
int __fastcall GetSelectedIndex(void);
void __fastcall InternalLayout(void);
void __fastcall MoveCol(int RawCol);
void __fastcall RecordChanged(Db::TField* Field);
void __fastcall SetColumns(TDBGridColumns* Value);
void __fastcall SetDataSource(Db::TDataSource* Value);
HIDESBASE void __fastcall SetOptions(TDBGridOptions Value);
void __fastcall SetSelectedField(Db::TField* Value);
void __fastcall SetSelectedIndex(int Value);
void __fastcall SetTitleFont(Graphics::TFont* Value);
void __fastcall TitleFontChanged(System::TObject* Sender);
void __fastcall UpdateData(void);
void __fastcall UpdateActive(void);
void __fastcall UpdateScrollBar(void);
void __fastcall UpdateRowCount(void);
HIDESBASE MESSAGE void __fastcall CMExit(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMParentFontChanged(Messages::TMessage &Message);
MESSAGE void __fastcall CMDeferLayout(void *Message);
HIDESBASE MESSAGE void __fastcall CMDesignHitTest(Messages::TWMMouse &Msg);
HIDESBASE MESSAGE void __fastcall WMSetCursor(Messages::TWMSetCursor &Msg);
HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &Message);
protected:
bool FUpdateFields;
bool FAcquireFocus;
int __fastcall RawToDataColumn(int ACol);
int __fastcall DataToRawColumn(int ACol);
bool __fastcall AcquireLayoutLock(void);
void __fastcall BeginLayout(void);
void __fastcall BeginUpdate(void);
void __fastcall CancelLayout(void);
virtual bool __fastcall CanEditAcceptKey(char Key);
virtual bool __fastcall CanEditModify(void);
virtual bool __fastcall CanEditShow(void);
virtual void __fastcall ColumnMoved(long FromIndex, long ToIndex);
virtual void __fastcall ColEnter(void);
virtual void __fastcall ColExit(void);
virtual void __fastcall ColWidthsChanged(void);
virtual TDBGridColumns* __fastcall CreateColumns(void);
virtual Grids::TInplaceEdit* __fastcall CreateEditor(void);
virtual void __fastcall CreateWnd(void);
void __fastcall DeferLayout(void);
virtual void __fastcall DefineFieldMap(void);
virtual void __fastcall DrawCell(long ACol, long ARow, const Windows::TRect &ARect, Grids::TGridDrawState
AState);
virtual void __fastcall DrawDataCell(const Windows::TRect &Rect, Db::TField* Field, Grids::TGridDrawState
State);
virtual void __fastcall DrawColumnCell(const Windows::TRect &Rect, int DataCol, TColumn* Column, Grids::TGridDrawState
State);
virtual void __fastcall EditButtonClick(void);
void __fastcall EndLayout(void);
void __fastcall EndUpdate(void);
Db::TField* __fastcall GetColField(int DataCol);
virtual int __fastcall GetEditLimit(void);
virtual System::AnsiString __fastcall GetEditMask(long ACol, long ARow);
virtual System::AnsiString __fastcall GetEditText(long ACol, long ARow);
System::AnsiString __fastcall GetFieldValue(int ACol);
virtual bool __fastcall HighlightCell(int DataCol, int DataRow, const System::AnsiString Value, Grids::TGridDrawState
AState);
virtual void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
virtual void __fastcall KeyPress(char &Key);
virtual void __fastcall LayoutChanged(void);
virtual void __fastcall LinkActive(bool Value);
virtual void __fastcall Loaded(void);
virtual void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X,
int Y);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
);
virtual void __fastcall Scroll(int Distance);
virtual void __fastcall SetColumnAttributes(void);
virtual void __fastcall SetEditText(long ACol, long ARow, const System::AnsiString Value);
bool __fastcall StoreColumns(void);
virtual void __fastcall TimedScroll(Grids::TGridScrollDirection Direction);
__property TDBGridColumns* Columns = {read=FColumns, write=SetColumns, nodefault};
__property bool DefaultDrawing = {read=FDefaultDrawing, write=FDefaultDrawing, default=1};
__property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource, nodefault};
__property TGridDataLink* DataLink = {read=FDataLink, nodefault};
__property Byte IndicatorOffset = {read=FIndicatorOffset, nodefault};
__property Byte LayoutLock = {read=FLayoutLock, nodefault};
__property TDBGridOptions Options = {read=FOptions, write=SetOptions, default=3325};
__property ParentColor ;
__property bool ReadOnly = {read=FReadOnly, write=FReadOnly, default=0};
__property TBookmarkList* SelectedRows = {read=FBookmarks, nodefault};
__property Graphics::TFont* TitleFont = {read=FTitleFont, write=SetTitleFont, nodefault};
__property Byte UpdateLock = {read=FUpdateLock, nodefault};
__property Classes::TNotifyEvent OnColEnter = {read=FOnColEnter, write=FOnColEnter};
__property Classes::TNotifyEvent OnColExit = {read=FOnColExit, write=FOnColExit};
__property TDrawDataCellEvent OnDrawDataCell = {read=FOnDrawDataCell, write=FOnDrawDataCell};
__property TDrawColumnCellEvent OnDrawColumnCell = {read=FOnDrawColumnCell, write=FOnDrawColumnCell
};
__property Classes::TNotifyEvent OnEditButtonClick = {read=FOnEditButtonClick, write=FOnEditButtonClick
};
__property Grids::TMovedEvent OnColumnMoved = {read=FOnColumnMoved, write=FOnColumnMoved};
public:
__fastcall virtual TCustomDBGrid(Classes::TComponent* AOwner);
__fastcall virtual ~TCustomDBGrid(void);
void __fastcall DefaultDrawDataCell(const Windows::TRect &Rect, Db::TField* Field, Grids::TGridDrawState
State);
void __fastcall DefaultDrawColumnCell(const Windows::TRect &Rect, int DataCol, TColumn* Column, Grids::TGridDrawState
State);
bool __fastcall ValidFieldIndex(int FieldIndex);
__property EditorMode ;
__property int FieldCount = {read=GetFieldCount, nodefault};
__property Db::TField* Fields[int FieldIndex] = {read=GetFields};
__property Db::TField* SelectedField = {read=GetSelectedField, write=SetSelectedField, nodefault};
__property int SelectedIndex = {read=GetSelectedIndex, write=SetSelectedIndex, nodefault};
public:
/* TWinControl.CreateParented */ __fastcall TCustomDBGrid(HWND ParentWindow) : Grids::TCustomGrid(ParentWindow
) { }
};
class __declspec(delphiclass) TDBGrid;
class __declspec(pascalimplementation) TDBGrid : public TCustomDBGrid
{
typedef TCustomDBGrid inherited;
public:
__property Canvas ;
__property SelectedRows ;
__published:
__property Align ;
__property BorderStyle ;
__property Color ;
__property Columns = {stored=StoreColumns};
__property Ctl3D ;
__property DataSource ;
__property DefaultDrawing ;
__property DragCursor ;
__property DragMode ;
__property Enabled ;
__property FixedColor ;
__property Font ;
__property ImeMode ;
__property ImeName ;
__property Options ;
__property ParentColor ;
__property ParentCtl3D ;
__property ParentFont ;
__property ParentShowHint ;
__property PopupMenu ;
__property ReadOnly ;
__property ShowHint ;
__property TabOrder ;
__property TabStop ;
__property TitleFont ;
__property Visible ;
__property OnColEnter ;
__property OnColExit ;
__property OnColumnMoved ;
__property OnDrawDataCell ;
__property OnDrawColumnCell ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnEditButtonClick ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnStartDrag ;
public:
/* TCustomDBGrid.Create */ __fastcall virtual TDBGrid(Classes::TComponent* AOwner) : Dbgrids::TCustomDBGrid(
AOwner) { }
/* TCustomDBGrid.Destroy */ __fastcall virtual ~TDBGrid(void) { }
public:
/* TWinControl.CreateParented */ __fastcall TDBGrid(HWND ParentWindow) : Dbgrids::TCustomDBGrid(ParentWindow
) { }
};
//-- var, const, procedure ---------------------------------------------------
#define ColumnTitleValues 0x1E0
#define cm_DeferLayout (Word)(1124)
#define IndicatorWidth (Byte)(11)
//-- template instantiations -------------------------------------------------
template class TDBGridOptions ;
template class TColumnValues ;
} /* namespace Dbgrids */
#pragma warn .par
#pragma warn .hid
#pragma warn .inl
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Dbgrids;
#endif
//-- end unit ----------------------------------------------------------------
#endif // DBGrids