home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / Vcl / grids.hpp < prev    next >
C/C++ Source or Header  |  2000-02-01  |  28KB  |  689 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) 'Grids.pas' rev: 5.00
  6.  
  7. #ifndef GridsHPP
  8. #define GridsHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <Mask.hpp>    // Pascal unit
  14. #include <StdCtrls.hpp>    // Pascal unit
  15. #include <Forms.hpp>    // Pascal unit
  16. #include <Controls.hpp>    // Pascal unit
  17. #include <Menus.hpp>    // Pascal unit
  18. #include <Graphics.hpp>    // Pascal unit
  19. #include <Classes.hpp>    // Pascal unit
  20. #include <SysUtils.hpp>    // Pascal unit
  21. #include <Windows.hpp>    // Pascal unit
  22. #include <Messages.hpp>    // Pascal unit
  23. #include <SysInit.hpp>    // Pascal unit
  24. #include <System.hpp>    // Pascal unit
  25.  
  26. //-- user supplied -----------------------------------------------------------
  27.  
  28. namespace Grids
  29. {
  30. //-- type declarations -------------------------------------------------------
  31. class DELPHICLASS EInvalidGridOperation;
  32. class PASCALIMPLEMENTATION EInvalidGridOperation : public Sysutils::Exception 
  33. {
  34.     typedef Sysutils::Exception inherited;
  35.     
  36. public:
  37.     #pragma option push -w-inl
  38.     /* Exception.Create */ inline __fastcall EInvalidGridOperation(const AnsiString Msg) : Sysutils::Exception(
  39.         Msg) { }
  40.     #pragma option pop
  41.     #pragma option push -w-inl
  42.     /* Exception.CreateFmt */ inline __fastcall EInvalidGridOperation(const AnsiString Msg, const System::TVarRec 
  43.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  44.     #pragma option pop
  45.     #pragma option push -w-inl
  46.     /* Exception.CreateRes */ inline __fastcall EInvalidGridOperation(int Ident)/* overload */ : Sysutils::Exception(
  47.         Ident) { }
  48.     #pragma option pop
  49.     #pragma option push -w-inl
  50.     /* Exception.CreateResFmt */ inline __fastcall EInvalidGridOperation(int Ident, const System::TVarRec 
  51.         * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  52.     #pragma option pop
  53.     #pragma option push -w-inl
  54.     /* Exception.CreateHelp */ inline __fastcall EInvalidGridOperation(const AnsiString Msg, int AHelpContext
  55.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  56.     #pragma option pop
  57.     #pragma option push -w-inl
  58.     /* Exception.CreateFmtHelp */ inline __fastcall EInvalidGridOperation(const AnsiString Msg, const System::TVarRec 
  59.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  60.         ) { }
  61.     #pragma option pop
  62.     #pragma option push -w-inl
  63.     /* Exception.CreateResHelp */ inline __fastcall EInvalidGridOperation(int Ident, int AHelpContext)/* overload */
  64.          : Sysutils::Exception(Ident, AHelpContext) { }
  65.     #pragma option pop
  66.     #pragma option push -w-inl
  67.     /* Exception.CreateResFmtHelp */ inline __fastcall EInvalidGridOperation(System::PResStringRec ResStringRec
  68.         , const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  69.         ResStringRec, Args, Args_Size, AHelpContext) { }
  70.     #pragma option pop
  71.     
  72. public:
  73.     #pragma option push -w-inl
  74.     /* TObject.Destroy */ inline __fastcall virtual ~EInvalidGridOperation(void) { }
  75.     #pragma option pop
  76.     
  77. };
  78.  
  79.  
  80. typedef int __fastcall (__closure *TGetExtentsFunc)(int Index);
  81.  
  82. struct TGridAxisDrawInfo
  83. {
  84.     int EffectiveLineWidth;
  85.     int FixedBoundary;
  86.     int GridBoundary;
  87.     int GridExtent;
  88.     int LastFullVisibleCell;
  89.     int FullVisBoundary;
  90.     int FixedCellCount;
  91.     int FirstGridCell;
  92.     int GridCellCount;
  93.     TGetExtentsFunc GetExtent;
  94. } ;
  95.  
  96. struct TGridDrawInfo
  97. {
  98.     TGridAxisDrawInfo Horz;
  99.     TGridAxisDrawInfo Vert;
  100. } ;
  101.  
  102. #pragma option push -b-
  103. enum TGridState { gsNormal, gsSelecting, gsRowSizing, gsColSizing, gsRowMoving, gsColMoving };
  104. #pragma option pop
  105.  
  106. typedef TGridState TGridMovement;
  107.  
  108. class DELPHICLASS TInplaceEdit;
  109. class DELPHICLASS TCustomGrid;
  110. struct TGridCoord
  111. {
  112.     int X;
  113.     int Y;
  114. } ;
  115.  
  116. #pragma option push -b-
  117. enum TGridOption { goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, 
  118.     goRowSizing, goColSizing, goRowMoving, goColMoving, goEditing, goTabs, goRowSelect, goAlwaysShowEditor, 
  119.     goThumbTracking };
  120. #pragma option pop
  121.  
  122. typedef Set<TGridOption, goFixedVertLine, goThumbTracking>  TGridOptions;
  123.  
  124. struct TGridRect;
  125. #pragma option push -b-
  126. enum Grids__3 { gdSelected, gdFocused, gdFixed };
  127. #pragma option pop
  128.  
  129. typedef Set<Grids__3, gdSelected, gdFixed>  TGridDrawState;
  130.  
  131. #pragma option push -b-
  132. enum Grids__4 { sdLeft, sdRight, sdUp, sdDown };
  133. #pragma option pop
  134.  
  135. typedef Set<Grids__4, sdLeft, sdDown>  TGridScrollDirection;
  136.  
  137. class PASCALIMPLEMENTATION TCustomGrid : public Controls::TCustomControl 
  138. {
  139.     typedef Controls::TCustomControl inherited;
  140.     
  141. private:
  142.     TGridCoord FAnchor;
  143.     Forms::TFormBorderStyle FBorderStyle;
  144.     bool FCanEditModify;
  145.     int FColCount;
  146.     void *FColWidths;
  147.     void *FTabStops;
  148.     TGridCoord FCurrent;
  149.     int FDefaultColWidth;
  150.     int FDefaultRowHeight;
  151.     int FFixedCols;
  152.     int FFixedRows;
  153.     Graphics::TColor FFixedColor;
  154.     int FGridLineWidth;
  155.     TGridOptions FOptions;
  156.     int FRowCount;
  157.     void *FRowHeights;
  158.     Stdctrls::TScrollStyle FScrollBars;
  159.     TGridCoord FTopLeft;
  160.     int FSizingIndex;
  161.     int FSizingPos;
  162.     int FSizingOfs;
  163.     int FMoveIndex;
  164.     int FMovePos;
  165.     Windows::TPoint FHitTest;
  166.     TInplaceEdit* FInplaceEdit;
  167.     int FInplaceCol;
  168.     int FInplaceRow;
  169.     int FColOffset;
  170.     bool FDefaultDrawing;
  171.     bool FEditorMode;
  172.     TGridCoord __fastcall CalcCoordFromPoint(int X, int Y, const TGridDrawInfo &DrawInfo);
  173.     void __fastcall CalcDrawInfoXY(TGridDrawInfo &DrawInfo, int UseWidth, int UseHeight);
  174.     TGridCoord __fastcall CalcMaxTopLeft(const TGridCoord &Coord, const TGridDrawInfo &DrawInfo);
  175.     void __fastcall CancelMode(void);
  176.     void __fastcall ChangeGridOrientation(bool RightToLeftOrientation);
  177.     void __fastcall ChangeSize(int NewColCount, int NewRowCount);
  178.     void __fastcall ClampInView(const TGridCoord &Coord);
  179.     void __fastcall DrawSizingLine(const TGridDrawInfo &DrawInfo);
  180.     void __fastcall DrawMove(void);
  181.     void __fastcall FocusCell(int ACol, int ARow, bool MoveAnchor);
  182.     void __fastcall GridRectToScreenRect(const TGridRect &GridRect, Windows::TRect &ScreenRect, bool IncludeLine
  183.         );
  184.     void __fastcall HideEdit(void);
  185.     void __fastcall Initialize(void);
  186.     void __fastcall InvalidateGrid(void);
  187.     void __fastcall InvalidateRect(const TGridRect &ARect);
  188.     void __fastcall ModifyScrollBar(unsigned ScrollBar, unsigned ScrollCode, unsigned Pos, bool UseRightToLeft
  189.         );
  190.     void __fastcall MoveAdjust(int &CellPos, int FromIndex, int ToIndex);
  191.     void __fastcall MoveAnchor(const TGridCoord &NewAnchor);
  192.     void __fastcall MoveAndScroll(int Mouse, int CellHit, TGridDrawInfo &DrawInfo, TGridAxisDrawInfo &Axis
  193.         , int Scrollbar, const Windows::TPoint &MousePt);
  194.     void __fastcall MoveCurrent(int ACol, int ARow, bool MoveAnchor, bool Show);
  195.     void __fastcall MoveTopLeft(int ALeft, int ATop);
  196.     void __fastcall ResizeCol(int Index, int OldSize, int NewSize);
  197.     void __fastcall ResizeRow(int Index, int OldSize, int NewSize);
  198.     void __fastcall SelectionMoved(const TGridRect &OldSel);
  199.     void __fastcall ScrollDataInfo(int DX, int DY, TGridDrawInfo &DrawInfo);
  200.     void __fastcall TopLeftMoved(const TGridCoord &OldTopLeft);
  201.     void __fastcall UpdateScrollPos(void);
  202.     void __fastcall UpdateScrollRange(void);
  203.     int __fastcall GetColWidths(int Index);
  204.     int __fastcall GetRowHeights(int Index);
  205.     TGridRect __fastcall GetSelection();
  206.     bool __fastcall GetTabStops(int Index);
  207.     int __fastcall GetVisibleColCount(void);
  208.     int __fastcall GetVisibleRowCount(void);
  209.     bool __fastcall IsActiveControl(void);
  210.     void __fastcall ReadColWidths(Classes::TReader* Reader);
  211.     void __fastcall ReadRowHeights(Classes::TReader* Reader);
  212.     void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
  213.     void __fastcall SetCol(int Value);
  214.     void __fastcall SetColCount(int Value);
  215.     void __fastcall SetColWidths(int Index, int Value);
  216.     void __fastcall SetDefaultColWidth(int Value);
  217.     void __fastcall SetDefaultRowHeight(int Value);
  218.     void __fastcall SetEditorMode(bool Value);
  219.     void __fastcall SetFixedColor(Graphics::TColor Value);
  220.     void __fastcall SetFixedCols(int Value);
  221.     void __fastcall SetFixedRows(int Value);
  222.     void __fastcall SetGridLineWidth(int Value);
  223.     void __fastcall SetLeftCol(int Value);
  224.     void __fastcall SetOptions(TGridOptions Value);
  225.     void __fastcall SetRow(int Value);
  226.     void __fastcall SetRowCount(int Value);
  227.     void __fastcall SetRowHeights(int Index, int Value);
  228.     void __fastcall SetScrollBars(Stdctrls::TScrollStyle Value);
  229.     void __fastcall SetSelection(const TGridRect &Value);
  230.     void __fastcall SetTabStops(int Index, bool Value);
  231.     void __fastcall SetTopRow(int Value);
  232.     void __fastcall UpdateEdit(void);
  233.     void __fastcall UpdateText(void);
  234.     void __fastcall WriteColWidths(Classes::TWriter* Writer);
  235.     void __fastcall WriteRowHeights(Classes::TWriter* Writer);
  236.     MESSAGE void __fastcall CMCancelMode(Messages::TMessage &Msg);
  237.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  238.     HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
  239.     HIDESBASE MESSAGE void __fastcall CMDesignHitTest(Messages::TWMMouse &Msg);
  240.     MESSAGE void __fastcall CMWantSpecialKey(Messages::TWMKey &Msg);
  241.     HIDESBASE MESSAGE void __fastcall CMShowingChanged(Messages::TMessage &Message);
  242.     HIDESBASE MESSAGE void __fastcall WMChar(Messages::TWMKey &Msg);
  243.     HIDESBASE MESSAGE void __fastcall WMCancelMode(Messages::TWMNoParams &Msg);
  244.     HIDESBASE MESSAGE void __fastcall WMCommand(Messages::TWMCommand &Message);
  245.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Msg);
  246.     HIDESBASE MESSAGE void __fastcall WMHScroll(Messages::TWMScroll &Msg);
  247.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Msg);
  248.     HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TMessage &Message);
  249.     HIDESBASE MESSAGE void __fastcall WMNCHitTest(Messages::TWMNCHitTest &Msg);
  250.     HIDESBASE MESSAGE void __fastcall WMSetCursor(Messages::TWMSetCursor &Msg);
  251.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Msg);
  252.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Msg);
  253.     MESSAGE void __fastcall WMTimer(Messages::TWMTimer &Msg);
  254.     HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &Msg);
  255.     
  256. protected:
  257.     TGridState FGridState;
  258.     bool FSaveCellExtents;
  259.     TGridOptions DesignOptionsBoost;
  260.     bool VirtualView;
  261.     void __fastcall CalcDrawInfo(TGridDrawInfo &DrawInfo);
  262.     void __fastcall CalcFixedInfo(TGridDrawInfo &DrawInfo);
  263.     virtual void __fastcall CalcSizingState(int X, int Y, TGridState &State, int &Index, int &SizingPos
  264.         , int &SizingOfs, TGridDrawInfo &FixedInfo);
  265.     virtual TInplaceEdit* __fastcall CreateEditor(void);
  266.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  267.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  268.     DYNAMIC void __fastcall KeyPress(char &Key);
  269.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  270.         int Y);
  271.     DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
  272.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  273.         Y);
  274.     HIDESBASEDYNAMIC void __fastcall AdjustSize(int Index, int Amount, bool Rows);
  275.     Windows::TRect __fastcall BoxRect(int ALeft, int ATop, int ARight, int ABottom);
  276.     DYNAMIC void __fastcall DoExit(void);
  277.     Windows::TRect __fastcall CellRect(int ACol, int ARow);
  278.     DYNAMIC bool __fastcall CanEditAcceptKey(char Key);
  279.     DYNAMIC bool __fastcall CanGridAcceptKey(Word Key, Classes::TShiftState Shift);
  280.     DYNAMIC bool __fastcall CanEditModify(void);
  281.     virtual bool __fastcall CanEditShow(void);
  282.     DYNAMIC bool __fastcall DoMouseWheelDown(Classes::TShiftState Shift, const Windows::TPoint &MousePos
  283.         );
  284.     DYNAMIC bool __fastcall DoMouseWheelUp(Classes::TShiftState Shift, const Windows::TPoint &MousePos)
  285.         ;
  286.     DYNAMIC AnsiString __fastcall GetEditText(int ACol, int ARow);
  287.     DYNAMIC void __fastcall SetEditText(int ACol, int ARow, const AnsiString Value);
  288.     DYNAMIC AnsiString __fastcall GetEditMask(int ACol, int ARow);
  289.     DYNAMIC int __fastcall GetEditLimit(void);
  290.     int __fastcall GetGridWidth(void);
  291.     int __fastcall GetGridHeight(void);
  292.     void __fastcall HideEditor(void);
  293.     void __fastcall ShowEditor(void);
  294.     void __fastcall ShowEditorChar(char Ch);
  295.     void __fastcall InvalidateEditor(void);
  296.     void __fastcall MoveColumn(int FromIndex, int ToIndex);
  297.     DYNAMIC void __fastcall ColumnMoved(int FromIndex, int ToIndex);
  298.     void __fastcall MoveRow(int FromIndex, int ToIndex);
  299.     DYNAMIC void __fastcall RowMoved(int FromIndex, int ToIndex);
  300.     virtual void __fastcall DrawCell(int ACol, int ARow, const Windows::TRect &ARect, TGridDrawState AState
  301.         ) = 0 ;
  302.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  303.     void __fastcall MoveColRow(int ACol, int ARow, bool MoveAnchor, bool Show);
  304.     virtual bool __fastcall SelectCell(int ACol, int ARow);
  305.     DYNAMIC void __fastcall SizeChanged(int OldColCount, int OldRowCount);
  306.     bool __fastcall Sizing(int X, int Y);
  307.     void __fastcall ScrollData(int DX, int DY);
  308.     void __fastcall InvalidateCell(int ACol, int ARow);
  309.     void __fastcall InvalidateCol(int ACol);
  310.     void __fastcall InvalidateRow(int ARow);
  311.     DYNAMIC void __fastcall TopLeftChanged(void);
  312.     DYNAMIC void __fastcall TimedScroll(TGridScrollDirection Direction);
  313.     virtual void __fastcall Paint(void);
  314.     DYNAMIC void __fastcall ColWidthsChanged(void);
  315.     DYNAMIC void __fastcall RowHeightsChanged(void);
  316.     virtual void __fastcall DeleteColumn(int ACol);
  317.     virtual void __fastcall DeleteRow(int ARow);
  318.     void __fastcall UpdateDesigner(void);
  319.     DYNAMIC bool __fastcall BeginColumnDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt
  320.         );
  321.     DYNAMIC bool __fastcall BeginRowDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt)
  322.         ;
  323.     DYNAMIC bool __fastcall CheckColumnDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt
  324.         );
  325.     DYNAMIC bool __fastcall CheckRowDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt)
  326.         ;
  327.     DYNAMIC bool __fastcall EndColumnDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt
  328.         );
  329.     DYNAMIC bool __fastcall EndRowDrag(int &Origin, int &Destination, const Windows::TPoint &MousePt);
  330.     __property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
  331.     __property int Col = {read=FCurrent.X, write=SetCol, nodefault};
  332.     __property Color ;
  333.     __property int ColCount = {read=FColCount, write=SetColCount, default=5};
  334.     __property int ColWidths[int Index] = {read=GetColWidths, write=SetColWidths};
  335.     __property int DefaultColWidth = {read=FDefaultColWidth, write=SetDefaultColWidth, default=64};
  336.     __property bool DefaultDrawing = {read=FDefaultDrawing, write=FDefaultDrawing, default=1};
  337.     __property int DefaultRowHeight = {read=FDefaultRowHeight, write=SetDefaultRowHeight, default=24};
  338.     __property bool EditorMode = {read=FEditorMode, write=SetEditorMode, nodefault};
  339.     __property Graphics::TColor FixedColor = {read=FFixedColor, write=SetFixedColor, default=-2147483633
  340.         };
  341.     __property int FixedCols = {read=FFixedCols, write=SetFixedCols, default=1};
  342.     __property int FixedRows = {read=FFixedRows, write=SetFixedRows, default=1};
  343.     __property int GridHeight = {read=GetGridHeight, nodefault};
  344.     __property int GridLineWidth = {read=FGridLineWidth, write=SetGridLineWidth, default=1};
  345.     __property int GridWidth = {read=GetGridWidth, nodefault};
  346.     __property Windows::TPoint HitTest = {read=FHitTest};
  347.     __property TInplaceEdit* InplaceEditor = {read=FInplaceEdit};
  348.     __property int LeftCol = {read=FTopLeft.X, write=SetLeftCol, nodefault};
  349.     __property TGridOptions Options = {read=FOptions, write=SetOptions, default=31};
  350.     __property ParentColor ;
  351.     __property int Row = {read=FCurrent.Y, write=SetRow, nodefault};
  352.     __property int RowCount = {read=FRowCount, write=SetRowCount, default=5};
  353.     __property int RowHeights[int Index] = {read=GetRowHeights, write=SetRowHeights};
  354.     __property Stdctrls::TScrollStyle ScrollBars = {read=FScrollBars, write=SetScrollBars, default=3};
  355.     __property TGridRect Selection = {read=GetSelection, write=SetSelection};
  356.     __property bool TabStops[int Index] = {read=GetTabStops, write=SetTabStops};
  357.     __property int TopRow = {read=FTopLeft.Y, write=SetTopRow, nodefault};
  358.     __property int VisibleColCount = {read=GetVisibleColCount, nodefault};
  359.     __property int VisibleRowCount = {read=GetVisibleRowCount, nodefault};
  360.     
  361. public:
  362.     __fastcall virtual TCustomGrid(Classes::TComponent* AOwner);
  363.     __fastcall virtual ~TCustomGrid(void);
  364.     TGridCoord __fastcall MouseCoord(int X, int Y);
  365.     
  366. __published:
  367.     __property TabStop ;
  368. public:
  369.     #pragma option push -w-inl
  370.     /* TWinControl.CreateParented */ inline __fastcall TCustomGrid(HWND ParentWindow) : Controls::TCustomControl(
  371.         ParentWindow) { }
  372.     #pragma option pop
  373.     
  374. };
  375.  
  376.  
  377. class PASCALIMPLEMENTATION TInplaceEdit : public Mask::TCustomMaskEdit 
  378. {
  379.     typedef Mask::TCustomMaskEdit inherited;
  380.     
  381. private:
  382.     TCustomGrid* FGrid;
  383.     int FClickTime;
  384.     void __fastcall InternalMove(const Windows::TRect &Loc, bool Redraw);
  385.     void __fastcall SetGrid(TCustomGrid* Value);
  386.     HIDESBASE MESSAGE void __fastcall CMShowingChanged(Messages::TMessage &Message);
  387.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  388.     HIDESBASE MESSAGE void __fastcall WMPaste(void *Message);
  389.     HIDESBASE MESSAGE void __fastcall WMCut(void *Message);
  390.     MESSAGE void __fastcall WMClear(void *Message);
  391.     
  392. protected:
  393.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  394.     DYNAMIC void __fastcall DblClick(void);
  395.     DYNAMIC bool __fastcall DoMouseWheel(Classes::TShiftState Shift, int WheelDelta, const Windows::TPoint 
  396.         &MousePos);
  397.     virtual bool __fastcall EditCanModify(void);
  398.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  399.     DYNAMIC void __fastcall KeyPress(char &Key);
  400.     DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
  401.     virtual void __fastcall BoundsChanged(void);
  402.     virtual void __fastcall UpdateContents(void);
  403.     virtual void __fastcall WndProc(Messages::TMessage &Message);
  404.     __property TCustomGrid* Grid = {read=FGrid};
  405.     
  406. public:
  407.     __fastcall virtual TInplaceEdit(Classes::TComponent* AOwner);
  408.     void __fastcall Deselect(void);
  409.     HIDESBASE void __fastcall Hide(void);
  410.     HIDESBASE void __fastcall Invalidate(void);
  411.     void __fastcall Move(const Windows::TRect &Loc);
  412.     bool __fastcall PosEqual(const Windows::TRect &Rect);
  413.     HIDESBASE void __fastcall SetFocus(void);
  414.     void __fastcall UpdateLoc(const Windows::TRect &Loc);
  415.     HIDESBASE bool __fastcall Visible(void);
  416. public:
  417.     #pragma option push -w-inl
  418.     /* TWinControl.CreateParented */ inline __fastcall TInplaceEdit(HWND ParentWindow) : Mask::TCustomMaskEdit(
  419.         ParentWindow) { }
  420.     #pragma option pop
  421.     #pragma option push -w-inl
  422.     /* TWinControl.Destroy */ inline __fastcall virtual ~TInplaceEdit(void) { }
  423.     #pragma option pop
  424.     
  425. };
  426.  
  427.  
  428. struct TGridRect
  429. {
  430.     
  431.     union
  432.     {
  433.         struct 
  434.         {
  435.             TGridCoord TopLeft;
  436.             TGridCoord BottomRight;
  437.             
  438.         };
  439.         struct 
  440.         {
  441.             int Left;
  442.             int Top;
  443.             int Right;
  444.             int Bottom;
  445.             
  446.         };
  447.         
  448.     };
  449. } ;
  450.  
  451. typedef void __fastcall (__closure *TSelectCellEvent)(System::TObject* Sender, int ACol, int ARow, bool 
  452.     &CanSelect);
  453.  
  454. typedef void __fastcall (__closure *TDrawCellEvent)(System::TObject* Sender, int ACol, int ARow, const 
  455.     Windows::TRect &Rect, TGridDrawState State);
  456.  
  457. typedef void __fastcall (__closure *TGetEditEvent)(System::TObject* Sender, int ACol, int ARow, AnsiString 
  458.     &Value);
  459.  
  460. typedef void __fastcall (__closure *TSetEditEvent)(System::TObject* Sender, int ACol, int ARow, const 
  461.     AnsiString Value);
  462.  
  463. typedef void __fastcall (__closure *TMovedEvent)(System::TObject* Sender, int FromIndex, int ToIndex
  464.     );
  465.  
  466. class DELPHICLASS TDrawGrid;
  467. class PASCALIMPLEMENTATION TDrawGrid : public TCustomGrid 
  468. {
  469.     typedef TCustomGrid inherited;
  470.     
  471. private:
  472.     TMovedEvent FOnColumnMoved;
  473.     TDrawCellEvent FOnDrawCell;
  474.     TGetEditEvent FOnGetEditMask;
  475.     TGetEditEvent FOnGetEditText;
  476.     TMovedEvent FOnRowMoved;
  477.     TSelectCellEvent FOnSelectCell;
  478.     TSetEditEvent FOnSetEditText;
  479.     Classes::TNotifyEvent FOnTopLeftChanged;
  480.     
  481. protected:
  482.     DYNAMIC void __fastcall ColumnMoved(int FromIndex, int ToIndex);
  483.     virtual void __fastcall DrawCell(int ACol, int ARow, const Windows::TRect &ARect, TGridDrawState AState
  484.         );
  485.     DYNAMIC AnsiString __fastcall GetEditMask(int ACol, int ARow);
  486.     DYNAMIC AnsiString __fastcall GetEditText(int ACol, int ARow);
  487.     DYNAMIC void __fastcall RowMoved(int FromIndex, int ToIndex);
  488.     virtual bool __fastcall SelectCell(int ACol, int ARow);
  489.     DYNAMIC void __fastcall SetEditText(int ACol, int ARow, const AnsiString Value);
  490.     DYNAMIC void __fastcall TopLeftChanged(void);
  491.     
  492. public:
  493.     HIDESBASE Windows::TRect __fastcall CellRect(int ACol, int ARow);
  494.     void __fastcall MouseToCell(int X, int Y, int &ACol, int &ARow);
  495.     __property Canvas ;
  496.     __property Col ;
  497.     __property ColWidths ;
  498.     __property EditorMode ;
  499.     __property GridHeight ;
  500.     __property GridWidth ;
  501.     __property LeftCol ;
  502.     __property Selection ;
  503.     __property Row ;
  504.     __property RowHeights ;
  505.     __property TabStops ;
  506.     __property TopRow ;
  507.     
  508. __published:
  509.     __property Align ;
  510.     __property Anchors ;
  511.     __property BiDiMode ;
  512.     __property BorderStyle ;
  513.     __property Color ;
  514.     __property ColCount ;
  515.     __property Constraints ;
  516.     __property Ctl3D ;
  517.     __property DefaultColWidth ;
  518.     __property DefaultRowHeight ;
  519.     __property DefaultDrawing ;
  520.     __property DragCursor ;
  521.     __property DragKind ;
  522.     __property DragMode ;
  523.     __property Enabled ;
  524.     __property FixedColor ;
  525.     __property FixedCols ;
  526.     __property RowCount ;
  527.     __property FixedRows ;
  528.     __property Font ;
  529.     __property GridLineWidth ;
  530.     __property Options ;
  531.     __property ParentBiDiMode ;
  532.     __property ParentColor ;
  533.     __property ParentCtl3D ;
  534.     __property ParentFont ;
  535.     __property ParentShowHint ;
  536.     __property PopupMenu ;
  537.     __property ScrollBars ;
  538.     __property ShowHint ;
  539.     __property TabOrder ;
  540.     __property TabStop ;
  541.     __property Visible ;
  542.     __property VisibleColCount ;
  543.     __property VisibleRowCount ;
  544.     __property OnClick ;
  545.     __property TMovedEvent OnColumnMoved = {read=FOnColumnMoved, write=FOnColumnMoved};
  546.     __property OnContextPopup ;
  547.     __property OnDblClick ;
  548.     __property OnDragDrop ;
  549.     __property OnDragOver ;
  550.     __property TDrawCellEvent OnDrawCell = {read=FOnDrawCell, write=FOnDrawCell};
  551.     __property OnEndDock ;
  552.     __property OnEndDrag ;
  553.     __property OnEnter ;
  554.     __property OnExit ;
  555.     __property TGetEditEvent OnGetEditMask = {read=FOnGetEditMask, write=FOnGetEditMask};
  556.     __property TGetEditEvent OnGetEditText = {read=FOnGetEditText, write=FOnGetEditText};
  557.     __property OnKeyDown ;
  558.     __property OnKeyPress ;
  559.     __property OnKeyUp ;
  560.     __property OnMouseDown ;
  561.     __property OnMouseMove ;
  562.     __property OnMouseUp ;
  563.     __property OnMouseWheelDown ;
  564.     __property OnMouseWheelUp ;
  565.     __property TMovedEvent OnRowMoved = {read=FOnRowMoved, write=FOnRowMoved};
  566.     __property TSelectCellEvent OnSelectCell = {read=FOnSelectCell, write=FOnSelectCell};
  567.     __property TSetEditEvent OnSetEditText = {read=FOnSetEditText, write=FOnSetEditText};
  568.     __property OnStartDock ;
  569.     __property OnStartDrag ;
  570.     __property Classes::TNotifyEvent OnTopLeftChanged = {read=FOnTopLeftChanged, write=FOnTopLeftChanged
  571.         };
  572. public:
  573.     #pragma option push -w-inl
  574.     /* TCustomGrid.Create */ inline __fastcall virtual TDrawGrid(Classes::TComponent* AOwner) : TCustomGrid(
  575.         AOwner) { }
  576.     #pragma option pop
  577.     #pragma option push -w-inl
  578.     /* TCustomGrid.Destroy */ inline __fastcall virtual ~TDrawGrid(void) { }
  579.     #pragma option pop
  580.     
  581. public:
  582.     #pragma option push -w-inl
  583.     /* TWinControl.CreateParented */ inline __fastcall TDrawGrid(HWND ParentWindow) : TCustomGrid(ParentWindow
  584.         ) { }
  585.     #pragma option pop
  586.     
  587. };
  588.  
  589.  
  590. class DELPHICLASS TStringGridStrings;
  591. class DELPHICLASS TStringGrid;
  592. class PASCALIMPLEMENTATION TStringGrid : public TDrawGrid 
  593. {
  594.     typedef TDrawGrid inherited;
  595.     
  596. private:
  597.     void *FData;
  598.     void *FRows;
  599.     void *FCols;
  600.     bool FUpdating;
  601.     bool FNeedsUpdating;
  602.     int FEditUpdate;
  603.     void __fastcall DisableEditUpdate(void);
  604.     void __fastcall EnableEditUpdate(void);
  605.     HIDESBASE void __fastcall Initialize(void);
  606.     HIDESBASE void __fastcall Update(int ACol, int ARow);
  607.     void __fastcall SetUpdateState(bool Updating);
  608.     AnsiString __fastcall GetCells(int ACol, int ARow);
  609.     Classes::TStrings* __fastcall GetCols(int Index);
  610.     System::TObject* __fastcall GetObjects(int ACol, int ARow);
  611.     Classes::TStrings* __fastcall GetRows(int Index);
  612.     void __fastcall SetCells(int ACol, int ARow, const AnsiString Value);
  613.     void __fastcall SetCols(int Index, Classes::TStrings* Value);
  614.     void __fastcall SetObjects(int ACol, int ARow, System::TObject* Value);
  615.     void __fastcall SetRows(int Index, Classes::TStrings* Value);
  616.     TStringGridStrings* __fastcall EnsureColRow(int Index, bool IsCol);
  617.     void * __fastcall EnsureDataRow(int ARow);
  618.     
  619. protected:
  620.     DYNAMIC void __fastcall ColumnMoved(int FromIndex, int ToIndex);
  621.     virtual void __fastcall DrawCell(int ACol, int ARow, const Windows::TRect &ARect, TGridDrawState AState
  622.         );
  623.     DYNAMIC AnsiString __fastcall GetEditText(int ACol, int ARow);
  624.     DYNAMIC void __fastcall SetEditText(int ACol, int ARow, const AnsiString Value);
  625.     DYNAMIC void __fastcall RowMoved(int FromIndex, int ToIndex);
  626.     
  627. public:
  628.     __fastcall virtual TStringGrid(Classes::TComponent* AOwner);
  629.     __fastcall virtual ~TStringGrid(void);
  630.     __property AnsiString Cells[int ACol][int ARow] = {read=GetCells, write=SetCells};
  631.     __property Classes::TStrings* Cols[int Index] = {read=GetCols, write=SetCols};
  632.     __property System::TObject* Objects[int ACol][int ARow] = {read=GetObjects, write=SetObjects};
  633.     __property Classes::TStrings* Rows[int Index] = {read=GetRows, write=SetRows};
  634. public:
  635.     #pragma option push -w-inl
  636.     /* TWinControl.CreateParented */ inline __fastcall TStringGrid(HWND ParentWindow) : TDrawGrid(ParentWindow
  637.         ) { }
  638.     #pragma option pop
  639.     
  640. };
  641.  
  642.  
  643. class PASCALIMPLEMENTATION TStringGridStrings : public Classes::TStrings 
  644. {
  645.     typedef Classes::TStrings inherited;
  646.     
  647. private:
  648.     TStringGrid* FGrid;
  649.     int FIndex;
  650.     void __fastcall CalcXY(int Index, int &X, int &Y);
  651.     
  652. protected:
  653.     virtual AnsiString __fastcall Get(int Index);
  654.     virtual int __fastcall GetCount(void);
  655.     virtual System::TObject* __fastcall GetObject(int Index);
  656.     virtual void __fastcall Put(int Index, const AnsiString S);
  657.     virtual void __fastcall PutObject(int Index, System::TObject* AObject);
  658.     virtual void __fastcall SetUpdateState(bool Updating);
  659.     
  660. public:
  661.     __fastcall TStringGridStrings(TStringGrid* AGrid, int AIndex);
  662.     virtual int __fastcall Add(const AnsiString S);
  663.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  664.     virtual void __fastcall Clear(void);
  665.     virtual void __fastcall Delete(int Index);
  666.     virtual void __fastcall Insert(int Index, const AnsiString S);
  667. public:
  668.     #pragma option push -w-inl
  669.     /* TStrings.Destroy */ inline __fastcall virtual ~TStringGridStrings(void) { }
  670.     #pragma option pop
  671.     
  672. };
  673.  
  674.  
  675. //-- var, const, procedure ---------------------------------------------------
  676. static const int MaxCustomExtents = 0x7ffffff;
  677. static const Shortint MaxShortInt = 0x7f;
  678.  
  679. }    /* namespace Grids */
  680. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  681. using namespace Grids;
  682. #endif
  683. #pragma option pop    // -w-
  684. #pragma option pop    // -Vx
  685.  
  686. #pragma delphiheader end.
  687. //-- end unit ----------------------------------------------------------------
  688. #endif    // Grids
  689.