home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / Vcl / dbgrids.hpp < prev    next >
C/C++ Source or Header  |  2000-02-01  |  26KB  |  643 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'DBGrids.pas' rev: 5.00
  6.  
  7. #ifndef DBGridsHPP
  8. #define DBGridsHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <ImgList.hpp>    // Pascal unit
  14. #include <Menus.hpp>    // Pascal unit
  15. #include <Db.hpp>    // Pascal unit
  16. #include <DBCtrls.hpp>    // Pascal unit
  17. #include <Grids.hpp>    // Pascal unit
  18. #include <Graphics.hpp>    // Pascal unit
  19. #include <StdCtrls.hpp>    // Pascal unit
  20. #include <Forms.hpp>    // Pascal unit
  21. #include <Controls.hpp>    // Pascal unit
  22. #include <Classes.hpp>    // Pascal unit
  23. #include <Messages.hpp>    // Pascal unit
  24. #include <SysUtils.hpp>    // Pascal unit
  25. #include <Windows.hpp>    // Pascal unit
  26. #include <SysInit.hpp>    // Pascal unit
  27. #include <System.hpp>    // Pascal unit
  28.  
  29. //-- user supplied -----------------------------------------------------------
  30.  
  31. namespace Dbgrids
  32. {
  33. //-- type declarations -------------------------------------------------------
  34. #pragma option push -b-
  35. enum TColumnValue { cvColor, cvWidth, cvFont, cvAlignment, cvReadOnly, cvTitleColor, cvTitleCaption, 
  36.     cvTitleAlignment, cvTitleFont, cvImeMode, cvImeName };
  37. #pragma option pop
  38.  
  39. typedef Set<TColumnValue, cvColor, cvImeName>  TColumnValues;
  40.  
  41. class DELPHICLASS TColumnTitle;
  42. class DELPHICLASS TColumn;
  43. #pragma option push -b-
  44. enum TColumnButtonStyle { cbsAuto, cbsEllipsis, cbsNone };
  45. #pragma option pop
  46.  
  47. class DELPHICLASS TCustomDBGrid;
  48. class PASCALIMPLEMENTATION TColumn : public Classes::TCollectionItem 
  49. {
  50.     typedef Classes::TCollectionItem inherited;
  51.     
  52. private:
  53.     Db::TField* FField;
  54.     AnsiString FFieldName;
  55.     Graphics::TColor FColor;
  56.     int FWidth;
  57.     TColumnTitle* FTitle;
  58.     Graphics::TFont* FFont;
  59.     Controls::TImeMode FImeMode;
  60.     AnsiString FImeName;
  61.     Classes::TStrings* FPickList;
  62.     Menus::TPopupMenu* FPopupMenu;
  63.     unsigned FDropDownRows;
  64.     TColumnButtonStyle FButtonStyle;
  65.     Classes::TAlignment FAlignment;
  66.     bool FReadonly;
  67.     TColumnValues FAssignedValues;
  68.     bool FVisible;
  69.     bool FExpanded;
  70.     bool FStored;
  71.     void __fastcall FontChanged(System::TObject* Sender);
  72.     Classes::TAlignment __fastcall GetAlignment(void);
  73.     Graphics::TColor __fastcall GetColor(void);
  74.     bool __fastcall GetExpanded(void);
  75.     Db::TField* __fastcall GetField(void);
  76.     Graphics::TFont* __fastcall GetFont(void);
  77.     Controls::TImeMode __fastcall GetImeMode(void);
  78.     AnsiString __fastcall GetImeName();
  79.     TColumn* __fastcall GetParentColumn(void);
  80.     Classes::TStrings* __fastcall GetPickList(void);
  81.     bool __fastcall GetReadOnly(void);
  82.     bool __fastcall GetShowing(void);
  83.     int __fastcall GetWidth(void);
  84.     bool __fastcall GetVisible(void);
  85.     bool __fastcall IsAlignmentStored(void);
  86.     bool __fastcall IsColorStored(void);
  87.     bool __fastcall IsFontStored(void);
  88.     bool __fastcall IsImeModeStored(void);
  89.     bool __fastcall IsImeNameStored(void);
  90.     bool __fastcall IsReadOnlyStored(void);
  91.     bool __fastcall IsWidthStored(void);
  92.     virtual void __fastcall SetAlignment(Classes::TAlignment Value);
  93.     void __fastcall SetButtonStyle(TColumnButtonStyle Value);
  94.     void __fastcall SetColor(Graphics::TColor Value);
  95.     void __fastcall SetExpanded(bool Value);
  96.     virtual void __fastcall SetField(Db::TField* Value);
  97.     void __fastcall SetFieldName(const AnsiString Value);
  98.     void __fastcall SetFont(Graphics::TFont* Value);
  99.     virtual void __fastcall SetImeMode(Controls::TImeMode Value);
  100.     virtual void __fastcall SetImeName(AnsiString Value);
  101.     void __fastcall SetPickList(Classes::TStrings* Value);
  102.     void __fastcall SetPopupMenu(Menus::TPopupMenu* Value);
  103.     virtual void __fastcall SetReadOnly(bool Value);
  104.     void __fastcall SetTitle(TColumnTitle* Value);
  105.     virtual void __fastcall SetWidth(int Value);
  106.     void __fastcall SetVisible(bool Value);
  107.     bool __fastcall GetExpandable(void);
  108.     
  109. protected:
  110.     virtual TColumnTitle* __fastcall CreateTitle(void);
  111.     TCustomDBGrid* __fastcall GetGrid(void);
  112.     virtual AnsiString __fastcall GetDisplayName();
  113.     void __fastcall RefreshDefaultFont(void);
  114.     virtual void __fastcall SetIndex(int Value);
  115.     __property bool IsStored = {read=FStored, write=FStored, default=1};
  116.     
  117. public:
  118.     __fastcall virtual TColumn(Classes::TCollection* Collection);
  119.     __fastcall virtual ~TColumn(void);
  120.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  121.     Classes::TAlignment __fastcall DefaultAlignment(void);
  122.     Graphics::TColor __fastcall DefaultColor(void);
  123.     Graphics::TFont* __fastcall DefaultFont(void);
  124.     Controls::TImeMode __fastcall DefaultImeMode(void);
  125.     AnsiString __fastcall DefaultImeName();
  126.     bool __fastcall DefaultReadOnly(void);
  127.     int __fastcall DefaultWidth(void);
  128.     int __fastcall Depth(void);
  129.     virtual void __fastcall RestoreDefaults(void);
  130.     __property TCustomDBGrid* Grid = {read=GetGrid};
  131.     __property TColumnValues AssignedValues = {read=FAssignedValues, nodefault};
  132.     __property bool Expandable = {read=GetExpandable, nodefault};
  133.     __property Db::TField* Field = {read=GetField, write=SetField};
  134.     __property TColumn* ParentColumn = {read=GetParentColumn};
  135.     __property bool Showing = {read=GetShowing, nodefault};
  136.     
  137. __published:
  138.     __property Classes::TAlignment Alignment = {read=GetAlignment, write=SetAlignment, stored=IsAlignmentStored
  139.         , nodefault};
  140.     __property TColumnButtonStyle ButtonStyle = {read=FButtonStyle, write=SetButtonStyle, default=0};
  141.     __property Graphics::TColor Color = {read=GetColor, write=SetColor, stored=IsColorStored, nodefault
  142.         };
  143.     __property unsigned DropDownRows = {read=FDropDownRows, write=FDropDownRows, default=7};
  144.     __property bool Expanded = {read=GetExpanded, write=SetExpanded, default=1};
  145.     __property AnsiString FieldName = {read=FFieldName, write=SetFieldName};
  146.     __property Graphics::TFont* Font = {read=GetFont, write=SetFont, stored=IsFontStored};
  147.     __property Controls::TImeMode ImeMode = {read=GetImeMode, write=SetImeMode, stored=IsImeModeStored, 
  148.         nodefault};
  149.     __property AnsiString ImeName = {read=GetImeName, write=SetImeName, stored=IsImeNameStored};
  150.     __property Classes::TStrings* PickList = {read=GetPickList, write=SetPickList};
  151.     __property Menus::TPopupMenu* PopupMenu = {read=FPopupMenu, write=SetPopupMenu};
  152.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, stored=IsReadOnlyStored, nodefault
  153.         };
  154.     __property TColumnTitle* Title = {read=FTitle, write=SetTitle};
  155.     __property int Width = {read=GetWidth, write=SetWidth, stored=IsWidthStored, nodefault};
  156.     __property bool Visible = {read=GetVisible, write=SetVisible, nodefault};
  157. };
  158.  
  159.  
  160. class PASCALIMPLEMENTATION TColumnTitle : public Classes::TPersistent 
  161. {
  162.     typedef Classes::TPersistent inherited;
  163.     
  164. private:
  165.     TColumn* FColumn;
  166.     AnsiString FCaption;
  167.     Graphics::TFont* FFont;
  168.     Graphics::TColor FColor;
  169.     Classes::TAlignment FAlignment;
  170.     void __fastcall FontChanged(System::TObject* Sender);
  171.     Classes::TAlignment __fastcall GetAlignment(void);
  172.     Graphics::TColor __fastcall GetColor(void);
  173.     AnsiString __fastcall GetCaption();
  174.     Graphics::TFont* __fastcall GetFont(void);
  175.     bool __fastcall IsAlignmentStored(void);
  176.     bool __fastcall IsColorStored(void);
  177.     bool __fastcall IsFontStored(void);
  178.     bool __fastcall IsCaptionStored(void);
  179.     void __fastcall SetAlignment(Classes::TAlignment Value);
  180.     void __fastcall SetColor(Graphics::TColor Value);
  181.     void __fastcall SetFont(Graphics::TFont* Value);
  182.     virtual void __fastcall SetCaption(const AnsiString Value);
  183.     
  184. protected:
  185.     void __fastcall RefreshDefaultFont(void);
  186.     
  187. public:
  188.     __fastcall TColumnTitle(TColumn* Column);
  189.     __fastcall virtual ~TColumnTitle(void);
  190.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  191.     Classes::TAlignment __fastcall DefaultAlignment(void);
  192.     Graphics::TColor __fastcall DefaultColor(void);
  193.     Graphics::TFont* __fastcall DefaultFont(void);
  194.     AnsiString __fastcall DefaultCaption();
  195.     virtual void __fastcall RestoreDefaults(void);
  196.     __property TColumn* Column = {read=FColumn};
  197.     
  198. __published:
  199.     __property Classes::TAlignment Alignment = {read=GetAlignment, write=SetAlignment, stored=IsAlignmentStored
  200.         , nodefault};
  201.     __property AnsiString Caption = {read=GetCaption, write=SetCaption, stored=IsCaptionStored};
  202.     __property Graphics::TColor Color = {read=GetColor, write=SetColor, stored=IsColorStored, nodefault
  203.         };
  204.     __property Graphics::TFont* Font = {read=GetFont, write=SetFont, stored=IsFontStored};
  205. };
  206.  
  207.  
  208. typedef TMetaClass*TColumnClass;
  209.  
  210. #pragma option push -b-
  211. enum TDBGridColumnsState { csDefault, csCustomized };
  212. #pragma option pop
  213.  
  214. class DELPHICLASS TDBGridColumns;
  215. class PASCALIMPLEMENTATION TDBGridColumns : public Classes::TCollection 
  216. {
  217.     typedef Classes::TCollection inherited;
  218.     
  219. private:
  220.     TCustomDBGrid* FGrid;
  221.     TColumn* __fastcall GetColumn(int Index);
  222.     TColumn* __fastcall InternalAdd(void);
  223.     void __fastcall SetColumn(int Index, TColumn* Value);
  224.     void __fastcall SetState(TDBGridColumnsState NewState);
  225.     TDBGridColumnsState __fastcall GetState(void);
  226.     
  227. protected:
  228.     DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
  229.     virtual void __fastcall Update(Classes::TCollectionItem* Item);
  230.     
  231. public:
  232.     __fastcall TDBGridColumns(TCustomDBGrid* Grid, TMetaClass* ColumnClass);
  233.     HIDESBASE TColumn* __fastcall Add(void);
  234.     void __fastcall LoadFromFile(const AnsiString Filename);
  235.     void __fastcall LoadFromStream(Classes::TStream* S);
  236.     void __fastcall RestoreDefaults(void);
  237.     void __fastcall RebuildColumns(void);
  238.     void __fastcall SaveToFile(const AnsiString Filename);
  239.     void __fastcall SaveToStream(Classes::TStream* S);
  240.     __property TDBGridColumnsState State = {read=GetState, write=SetState, nodefault};
  241.     __property TCustomDBGrid* Grid = {read=FGrid};
  242.     __property TColumn* Items[int Index] = {read=GetColumn, write=SetColumn/*, default*/};
  243. public:
  244.     #pragma option push -w-inl
  245.     /* TCollection.Destroy */ inline __fastcall virtual ~TDBGridColumns(void) { }
  246.     #pragma option pop
  247.     
  248. };
  249.  
  250.  
  251. typedef DynamicArray<int >  DBGrids__5;
  252.  
  253. class DELPHICLASS TGridDataLink;
  254. class PASCALIMPLEMENTATION TGridDataLink : public Db::TDataLink 
  255. {
  256.     typedef Db::TDataLink inherited;
  257.     
  258. private:
  259.     TCustomDBGrid* FGrid;
  260.     int FFieldCount;
  261.     DynamicArray<int >  FFieldMap;
  262.     bool FModified;
  263.     bool FInUpdateData;
  264.     bool FSparseMap;
  265.     bool __fastcall GetDefaultFields(void);
  266.     Db::TField* __fastcall GetFields(int I);
  267.     
  268. protected:
  269.     virtual void __fastcall ActiveChanged(void);
  270.     void __fastcall BuildAggMap(void);
  271.     virtual void __fastcall DataSetChanged(void);
  272.     virtual void __fastcall DataSetScrolled(int Distance);
  273.     virtual void __fastcall FocusControl(Db::TFieldRef Field);
  274.     virtual void __fastcall EditingChanged(void);
  275.     virtual bool __fastcall IsAggRow(int Value);
  276.     virtual void __fastcall LayoutChanged(void);
  277.     virtual void __fastcall RecordChanged(Db::TField* Field);
  278.     virtual void __fastcall UpdateData(void);
  279.     int __fastcall GetMappedIndex(int ColIndex);
  280.     
  281. public:
  282.     __fastcall TGridDataLink(TCustomDBGrid* AGrid);
  283.     __fastcall virtual ~TGridDataLink(void);
  284.     bool __fastcall AddMapping(const AnsiString FieldName);
  285.     void __fastcall ClearMapping(void);
  286.     void __fastcall Modified(void);
  287.     void __fastcall Reset(void);
  288.     __property bool DefaultFields = {read=GetDefaultFields, nodefault};
  289.     __property int FieldCount = {read=FFieldCount, nodefault};
  290.     __property Db::TField* Fields[int I] = {read=GetFields};
  291.     __property bool SparseMap = {read=FSparseMap, write=FSparseMap, nodefault};
  292. };
  293.  
  294.  
  295. class DELPHICLASS TBookmarkList;
  296. class PASCALIMPLEMENTATION TBookmarkList : public System::TObject 
  297. {
  298.     typedef System::TObject inherited;
  299.     
  300. private:
  301.     Classes::TStringList* FList;
  302.     TCustomDBGrid* FGrid;
  303.     AnsiString FCache;
  304.     int FCacheIndex;
  305.     bool FCacheFind;
  306.     bool FLinkActive;
  307.     int __fastcall GetCount(void);
  308.     bool __fastcall GetCurrentRowSelected(void);
  309.     AnsiString __fastcall GetItem(int Index);
  310.     void __fastcall SetCurrentRowSelected(bool Value);
  311.     void __fastcall StringsChanged(System::TObject* Sender);
  312.     
  313. protected:
  314.     AnsiString __fastcall CurrentRow();
  315.     int __fastcall Compare(const AnsiString Item1, const AnsiString Item2);
  316.     void __fastcall LinkActive(bool Value);
  317.     
  318. public:
  319.     __fastcall TBookmarkList(TCustomDBGrid* AGrid);
  320.     __fastcall virtual ~TBookmarkList(void);
  321.     void __fastcall Clear(void);
  322.     void __fastcall Delete(void);
  323.     bool __fastcall Find(const AnsiString Item, int &Index);
  324.     int __fastcall IndexOf(const AnsiString Item);
  325.     bool __fastcall Refresh(void);
  326.     __property int Count = {read=GetCount, nodefault};
  327.     __property bool CurrentRowSelected = {read=GetCurrentRowSelected, write=SetCurrentRowSelected, nodefault
  328.         };
  329.     __property AnsiString Items[int Index] = {read=GetItem/*, default*/};
  330. };
  331.  
  332.  
  333. #pragma option push -b-
  334. enum TDBGridOption { dgEditing, dgAlwaysShowEditor, dgTitles, dgIndicator, dgColumnResize, dgColLines, 
  335.     dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect 
  336.     };
  337. #pragma option pop
  338.  
  339. typedef Set<TDBGridOption, dgEditing, dgMultiSelect>  TDBGridOptions;
  340.  
  341. typedef void __fastcall (__closure *TDrawDataCellEvent)(System::TObject* Sender, const Windows::TRect 
  342.     &Rect, Db::TField* Field, Grids::TGridDrawState State);
  343.  
  344. typedef void __fastcall (__closure *TDrawColumnCellEvent)(System::TObject* Sender, const Windows::TRect 
  345.     &Rect, int DataCol, TColumn* Column, Grids::TGridDrawState State);
  346.  
  347. typedef void __fastcall (__closure *TDBGridClickEvent)(TColumn* Column);
  348.  
  349. class PASCALIMPLEMENTATION TCustomDBGrid : public Grids::TCustomGrid 
  350. {
  351.     typedef Grids::TCustomGrid inherited;
  352.     
  353. private:
  354.     Controls::TImageList* FIndicators;
  355.     Graphics::TFont* FTitleFont;
  356.     bool FReadOnly;
  357.     AnsiString FOriginalImeName;
  358.     Controls::TImeMode FOriginalImeMode;
  359.     bool FUserChange;
  360.     bool FIsESCKey;
  361.     bool FLayoutFromDataset;
  362.     TDBGridOptions FOptions;
  363.     Byte FTitleOffset;
  364.     Byte FIndicatorOffset;
  365.     Byte FUpdateLock;
  366.     Byte FLayoutLock;
  367.     bool FInColExit;
  368.     bool FDefaultDrawing;
  369.     bool FSelfChangingTitleFont;
  370.     bool FSelecting;
  371.     int FSelRow;
  372.     TGridDataLink* FDataLink;
  373.     Classes::TNotifyEvent FOnColEnter;
  374.     Classes::TNotifyEvent FOnColExit;
  375.     TDrawDataCellEvent FOnDrawDataCell;
  376.     TDrawColumnCellEvent FOnDrawColumnCell;
  377.     AnsiString FEditText;
  378.     TDBGridColumns* FColumns;
  379.     Classes::TList* FVisibleColumns;
  380.     TBookmarkList* FBookmarks;
  381.     AnsiString FSelectionAnchor;
  382.     Classes::TNotifyEvent FOnEditButtonClick;
  383.     Grids::TMovedEvent FOnColumnMoved;
  384.     TDBGridClickEvent FOnCellClick;
  385.     TDBGridClickEvent FOnTitleClick;
  386.     TColumn* FDragCol;
  387.     bool __fastcall AcquireFocus(void);
  388.     void __fastcall DataChanged(void);
  389.     void __fastcall EditingChanged(void);
  390.     Db::TDataSource* __fastcall GetDataSource(void);
  391.     int __fastcall GetFieldCount(void);
  392.     Db::TField* __fastcall GetFields(int FieldIndex);
  393.     Db::TField* __fastcall GetSelectedField(void);
  394.     int __fastcall GetSelectedIndex(void);
  395.     void __fastcall InternalLayout(void);
  396.     void __fastcall MoveCol(int RawCol, int Direction);
  397.     bool __fastcall PtInExpandButton(int X, int Y, TColumn* &MasterCol);
  398.     void __fastcall ReadColumns(Classes::TReader* Reader);
  399.     void __fastcall RecordChanged(Db::TField* Field);
  400.     HIDESBASE void __fastcall SetIme(void);
  401.     void __fastcall SetColumns(TDBGridColumns* Value);
  402.     void __fastcall SetDataSource(Db::TDataSource* Value);
  403.     HIDESBASE void __fastcall SetOptions(TDBGridOptions Value);
  404.     void __fastcall SetSelectedField(Db::TField* Value);
  405.     void __fastcall SetSelectedIndex(int Value);
  406.     void __fastcall SetTitleFont(Graphics::TFont* Value);
  407.     void __fastcall TitleFontChanged(System::TObject* Sender);
  408.     void __fastcall UpdateData(void);
  409.     void __fastcall UpdateActive(void);
  410.     void __fastcall UpdateIme(void);
  411.     void __fastcall UpdateScrollBar(void);
  412.     void __fastcall UpdateRowCount(void);
  413.     void __fastcall WriteColumns(Classes::TWriter* Writer);
  414.     HIDESBASE MESSAGE void __fastcall CMBiDiModeChanged(Messages::TMessage &Message);
  415.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TMessage &Message);
  416.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  417.     HIDESBASE MESSAGE void __fastcall CMParentFontChanged(Messages::TMessage &Message);
  418.     MESSAGE void __fastcall CMDeferLayout(void *Message);
  419.     HIDESBASE MESSAGE void __fastcall CMDesignHitTest(Messages::TWMMouse &Msg);
  420.     HIDESBASE MESSAGE void __fastcall WMSetCursor(Messages::TWMSetCursor &Msg);
  421.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  422.     HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &Message);
  423.     HIDESBASE MESSAGE void __fastcall WMIMEStartComp(Messages::TMessage &Message);
  424.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  425.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TMessage &Message);
  426.     
  427. protected:
  428.     bool FUpdateFields;
  429.     bool FAcquireFocus;
  430.     int __fastcall RawToDataColumn(int ACol);
  431.     int __fastcall DataToRawColumn(int ACol);
  432.     bool __fastcall AcquireLayoutLock(void);
  433.     void __fastcall BeginLayout(void);
  434.     void __fastcall BeginUpdate(void);
  435.     virtual void __fastcall CalcSizingState(int X, int Y, Grids::TGridState &State, int &Index, int &SizingPos
  436.         , int &SizingOfs, Grids::TGridDrawInfo &FixedInfo);
  437.     void __fastcall CancelLayout(void);
  438.     DYNAMIC bool __fastcall CanEditAcceptKey(char Key);
  439.     DYNAMIC bool __fastcall CanEditModify(void);
  440.     virtual bool __fastcall CanEditShow(void);
  441.     DYNAMIC void __fastcall CellClick(TColumn* Column);
  442.     DYNAMIC void __fastcall ColumnMoved(int FromIndex, int ToIndex);
  443.     Windows::TRect __fastcall CalcTitleRect(TColumn* Col, int ARow, TColumn* &MasterCol);
  444.     TColumn* __fastcall ColumnAtDepth(TColumn* Col, int ADepth);
  445.     DYNAMIC void __fastcall ColEnter(void);
  446.     DYNAMIC void __fastcall ColExit(void);
  447.     DYNAMIC void __fastcall ColWidthsChanged(void);
  448.     DYNAMIC TDBGridColumns* __fastcall CreateColumns(void);
  449.     virtual Grids::TInplaceEdit* __fastcall CreateEditor(void);
  450.     virtual void __fastcall CreateWnd(void);
  451.     void __fastcall DeferLayout(void);
  452.     virtual void __fastcall DefineFieldMap(void);
  453.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  454.     virtual void __fastcall DrawCell(int ACol, int ARow, const Windows::TRect &ARect, Grids::TGridDrawState 
  455.         AState);
  456.     DYNAMIC void __fastcall DrawDataCell(const Windows::TRect &Rect, Db::TField* Field, Grids::TGridDrawState 
  457.         State);
  458.     DYNAMIC void __fastcall DrawColumnCell(const Windows::TRect &Rect, int DataCol, TColumn* Column, Grids::TGridDrawState 
  459.         State);
  460.     DYNAMIC void __fastcall EditButtonClick(void);
  461.     void __fastcall EndLayout(void);
  462.     void __fastcall EndUpdate(void);
  463.     Db::TField* __fastcall GetColField(int DataCol);
  464.     DYNAMIC int __fastcall GetEditLimit(void);
  465.     DYNAMIC AnsiString __fastcall GetEditMask(int ACol, int ARow);
  466.     DYNAMIC AnsiString __fastcall GetEditText(int ACol, int ARow);
  467.     AnsiString __fastcall GetFieldValue(int ACol);
  468.     virtual bool __fastcall HighlightCell(int DataCol, int DataRow, const AnsiString Value, Grids::TGridDrawState 
  469.         AState);
  470.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  471.     DYNAMIC void __fastcall KeyPress(char &Key);
  472.     void __fastcall InvalidateTitles(void);
  473.     virtual void __fastcall LayoutChanged(void);
  474.     virtual void __fastcall LinkActive(bool Value);
  475.     virtual void __fastcall Loaded(void);
  476.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  477.         int Y);
  478.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  479.         Y);
  480.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  481.         );
  482.     virtual void __fastcall Scroll(int Distance);
  483.     virtual void __fastcall SetColumnAttributes(void);
  484.     DYNAMIC void __fastcall SetEditText(int ACol, int ARow, const AnsiString Value);
  485.     bool __fastcall StoreColumns(void);
  486.     DYNAMIC void __fastcall TimedScroll(Grids::TGridScrollDirection Direction);
  487.     DYNAMIC void __fastcall TitleClick(TColumn* Column);
  488.     DYNAMIC void __fastcall TopLeftChanged(void);
  489.     bool __fastcall UseRightToLeftAlignmentForField(const Db::TField* AField, Classes::TAlignment Alignment
  490.         );
  491.     DYNAMIC bool __fastcall BeginColumnDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt
  492.         );
  493.     DYNAMIC bool __fastcall CheckColumnDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt
  494.         );
  495.     DYNAMIC bool __fastcall EndColumnDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt
  496.         );
  497.     __property TDBGridColumns* Columns = {read=FColumns, write=SetColumns};
  498.     __property bool DefaultDrawing = {read=FDefaultDrawing, write=FDefaultDrawing, default=1};
  499.     __property TGridDataLink* DataLink = {read=FDataLink};
  500.     __property Byte IndicatorOffset = {read=FIndicatorOffset, nodefault};
  501.     __property Byte LayoutLock = {read=FLayoutLock, nodefault};
  502.     __property TDBGridOptions Options = {read=FOptions, write=SetOptions, default=3325};
  503.     __property ParentColor ;
  504.     __property bool ReadOnly = {read=FReadOnly, write=FReadOnly, default=0};
  505.     __property TBookmarkList* SelectedRows = {read=FBookmarks};
  506.     __property Graphics::TFont* TitleFont = {read=FTitleFont, write=SetTitleFont};
  507.     __property Byte UpdateLock = {read=FUpdateLock, nodefault};
  508.     __property Classes::TNotifyEvent OnColEnter = {read=FOnColEnter, write=FOnColEnter};
  509.     __property Classes::TNotifyEvent OnColExit = {read=FOnColExit, write=FOnColExit};
  510.     __property TDrawDataCellEvent OnDrawDataCell = {read=FOnDrawDataCell, write=FOnDrawDataCell};
  511.     __property TDrawColumnCellEvent OnDrawColumnCell = {read=FOnDrawColumnCell, write=FOnDrawColumnCell
  512.         };
  513.     __property Classes::TNotifyEvent OnEditButtonClick = {read=FOnEditButtonClick, write=FOnEditButtonClick
  514.         };
  515.     __property Grids::TMovedEvent OnColumnMoved = {read=FOnColumnMoved, write=FOnColumnMoved};
  516.     __property TDBGridClickEvent OnCellClick = {read=FOnCellClick, write=FOnCellClick};
  517.     __property TDBGridClickEvent OnTitleClick = {read=FOnTitleClick, write=FOnTitleClick};
  518.     
  519. public:
  520.     __fastcall virtual TCustomDBGrid(Classes::TComponent* AOwner);
  521.     __fastcall virtual ~TCustomDBGrid(void);
  522.     void __fastcall DefaultDrawDataCell(const Windows::TRect &Rect, Db::TField* Field, Grids::TGridDrawState 
  523.         State);
  524.     void __fastcall DefaultDrawColumnCell(const Windows::TRect &Rect, int DataCol, TColumn* Column, Grids::TGridDrawState 
  525.         State);
  526.     virtual void __fastcall DefaultHandler(void *Msg);
  527.     DYNAMIC bool __fastcall ExecuteAction(Classes::TBasicAction* Action);
  528.     DYNAMIC void __fastcall ShowPopupEditor(TColumn* Column, int X, int Y);
  529.     DYNAMIC bool __fastcall UpdateAction(Classes::TBasicAction* Action);
  530.     bool __fastcall ValidFieldIndex(int FieldIndex);
  531.     __property EditorMode ;
  532.     __property int FieldCount = {read=GetFieldCount, nodefault};
  533.     __property Db::TField* Fields[int FieldIndex] = {read=GetFields};
  534.     __property Db::TField* SelectedField = {read=GetSelectedField, write=SetSelectedField};
  535.     __property int SelectedIndex = {read=GetSelectedIndex, write=SetSelectedIndex, nodefault};
  536.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  537. public:
  538.     #pragma option push -w-inl
  539.     /* TWinControl.CreateParented */ inline __fastcall TCustomDBGrid(HWND ParentWindow) : Grids::TCustomGrid(
  540.         ParentWindow) { }
  541.     #pragma option pop
  542.     
  543. };
  544.  
  545.  
  546. class DELPHICLASS TDBGrid;
  547. class PASCALIMPLEMENTATION TDBGrid : public TCustomDBGrid 
  548. {
  549.     typedef TCustomDBGrid inherited;
  550.     
  551. public:
  552.     __property Canvas ;
  553.     __property SelectedRows ;
  554.     
  555. __published:
  556.     __property Align ;
  557.     __property Anchors ;
  558.     __property BiDiMode ;
  559.     __property BorderStyle ;
  560.     __property Color ;
  561.     __property Columns  = {stored=false};
  562.     __property Constraints ;
  563.     __property Ctl3D ;
  564.     __property DataSource ;
  565.     __property DefaultDrawing ;
  566.     __property DragCursor ;
  567.     __property DragKind ;
  568.     __property DragMode ;
  569.     __property Enabled ;
  570.     __property FixedColor ;
  571.     __property Font ;
  572.     __property ImeMode ;
  573.     __property ImeName ;
  574.     __property Options ;
  575.     __property ParentBiDiMode ;
  576.     __property ParentColor ;
  577.     __property ParentCtl3D ;
  578.     __property ParentFont ;
  579.     __property ParentShowHint ;
  580.     __property PopupMenu ;
  581.     __property ReadOnly ;
  582.     __property ShowHint ;
  583.     __property TabOrder ;
  584.     __property TabStop ;
  585.     __property TitleFont ;
  586.     __property Visible ;
  587.     __property OnCellClick ;
  588.     __property OnColEnter ;
  589.     __property OnColExit ;
  590.     __property OnColumnMoved ;
  591.     __property OnDrawDataCell ;
  592.     __property OnDrawColumnCell ;
  593.     __property OnDblClick ;
  594.     __property OnDragDrop ;
  595.     __property OnDragOver ;
  596.     __property OnEditButtonClick ;
  597.     __property OnEndDock ;
  598.     __property OnEndDrag ;
  599.     __property OnEnter ;
  600.     __property OnExit ;
  601.     __property OnKeyDown ;
  602.     __property OnKeyPress ;
  603.     __property OnKeyUp ;
  604.     __property OnMouseDown ;
  605.     __property OnMouseMove ;
  606.     __property OnMouseUp ;
  607.     __property OnStartDock ;
  608.     __property OnStartDrag ;
  609.     __property OnTitleClick ;
  610. public:
  611.     #pragma option push -w-inl
  612.     /* TCustomDBGrid.Create */ inline __fastcall virtual TDBGrid(Classes::TComponent* AOwner) : TCustomDBGrid(
  613.         AOwner) { }
  614.     #pragma option pop
  615.     #pragma option push -w-inl
  616.     /* TCustomDBGrid.Destroy */ inline __fastcall virtual ~TDBGrid(void) { }
  617.     #pragma option pop
  618.     
  619. public:
  620.     #pragma option push -w-inl
  621.     /* TWinControl.CreateParented */ inline __fastcall TDBGrid(HWND ParentWindow) : TCustomDBGrid(ParentWindow
  622.         ) { }
  623.     #pragma option pop
  624.     
  625. };
  626.  
  627.  
  628. //-- var, const, procedure ---------------------------------------------------
  629. #define ColumnTitleValues (System::Set<TColumnValue, cvColor, cvImeName> () )
  630. static const Word cm_DeferLayout = 0x464;
  631. static const Shortint IndicatorWidth = 0xb;
  632.  
  633. }    /* namespace Dbgrids */
  634. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  635. using namespace Dbgrids;
  636. #endif
  637. #pragma option pop    // -w-
  638. #pragma option pop    // -Vx
  639.  
  640. #pragma delphiheader end.
  641. //-- end unit ----------------------------------------------------------------
  642. #endif    // DBGrids
  643.