home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / DBCGRIDS.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  8.6 KB  |  238 lines

  1. //----------------------------------------------------------------------------
  2. // DBCGrids.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: DBCGrids.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef DBCGridsHPP
  6. #define DBCGridsHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef DBHPP
  9. #include <DB.hpp>
  10. #endif
  11.  
  12. #ifndef MenusHPP
  13. #include <Menus.hpp>
  14. #endif
  15.  
  16. #ifndef GraphicsHPP
  17. #include <Graphics.hpp>
  18. #endif
  19.  
  20. #ifndef FormsHPP
  21. #include <Forms.hpp>
  22. #endif
  23.  
  24. #ifndef ControlsHPP
  25. #include <Controls.hpp>
  26. #endif
  27.  
  28. #ifndef ClassesHPP
  29. #include <Classes.hpp>
  30. #endif
  31.  
  32. #ifndef MessagesHPP
  33. #include <Messages.hpp>
  34. #endif
  35.  
  36. #ifndef WindowsHPP
  37. #include <Windows.hpp>
  38. #endif
  39.  
  40. #ifndef SysUtilsHPP
  41. #include <SysUtils.hpp>
  42. #endif
  43.  
  44. #ifndef SystemHPP
  45. #include <System.hpp>
  46. #endif
  47.  
  48. namespace Dbcgrids
  49. {
  50. //-- type declarations -------------------------------------------------------
  51. class __declspec(delphiclass) TDBCtrlGridLink;
  52. class __declspec(delphiclass) TDBCtrlGrid;
  53. class __declspec(delphiclass) TDBCtrlPanel;
  54. class __declspec(pascalimplementation) TDBCtrlPanel : public Controls::TWinControl
  55. {
  56.     typedef TDBCtrlPanel ThisClass;
  57.     typedef Controls::TWinControl inherited;
  58.     
  59. private:
  60.     TDBCtrlGrid *FDBCtrlGrid;
  61.     MESSAGE void __fastcall CMControlListChange(Controls::TCMControlListChange &Message);
  62.     MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  63.     MESSAGE void __fastcall WMNCHitTest(Messages::TWMNCHitTest &Message);
  64.     
  65. protected:
  66.     virtual void __fastcall PaintWindow(System::Integer DC);
  67.     
  68. public:
  69.     __fastcall TDBCtrlPanel(TDBCtrlGrid *DBCtrlGrid);
  70. public:
  71.     /* !! TWinControl.Destroy */ __fastcall virtual ~TDBCtrlPanel(void) { }
  72.     
  73. };
  74.  
  75. enum TDBCtrlGridOrientation { goVertical, goHorizontal };
  76.  
  77. enum TDBCtrlGridBorder { gbNone, gbRaised };
  78.  
  79. typedef void __fastcall (__closure *TPaintPanelEvent)(TDBCtrlGrid *DBCtrlGrid, System::Integer Index
  80.     );
  81.  
  82. enum TDBCtrlGridKey { gkNull, gkEditMode, gkPriorTab, gkNextTab, gkLeft, gkRight, gkUp, gkDown, gkScrollUp, 
  83.     gkScrollDown, gkPageUp, gkPageDown, gkHome, gkEnd, gkInsert, gkAppend, gkDelete, gkCancel };
  84.  
  85. class __declspec(pascalimplementation) TDBCtrlGrid : public Controls::TWinControl
  86. {
  87.     typedef TDBCtrlGrid ThisClass;
  88.     typedef Controls::TWinControl inherited;
  89.     
  90. private:
  91.     TDBCtrlGridLink *FDataLink;
  92.     TDBCtrlPanel *FPanel;
  93.     Graphics::TCanvas *FCanvas;
  94.     System::Integer FColCount;
  95.     System::Integer FRowCount;
  96.     System::Integer FPanelWidth;
  97.     System::Integer FPanelHeight;
  98.     System::Integer FPanelIndex;
  99.     System::Integer FPanelCount;
  100.     System::Integer FBitmapCount;
  101.     System::Integer FPanelBitmap;
  102.     System::Integer FSaveBitmap;
  103.     System::Integer FPanelDC;
  104.     TDBCtrlGridOrientation FOrientation;
  105.     TDBCtrlGridBorder FPanelBorder;
  106.     System::Boolean FAllowInsert;
  107.     System::Boolean FAllowDelete;
  108.     System::Boolean FShowFocus;
  109.     System::Boolean FFocused;
  110.     TPaintPanelEvent FOnPaintPanel;
  111.     System::Boolean __fastcall AcquireFocus(void);
  112.     void __fastcall AdjustSize(void);
  113.     void __fastcall CreatePanelBitmap(void);
  114.     void __fastcall DataSetChanged(System::Boolean Reset);
  115.     void __fastcall DestroyPanelBitmap(void);
  116.     void __fastcall DrawPanel(System::Integer DC, System::Integer Index);
  117.     void __fastcall DrawPanelBackground(System::Integer DC, const Windows::TRect &R, System::Boolean Erase
  118.         );
  119.     Db::TDataSource *__fastcall GetDataSource(void);
  120.     System::Boolean __fastcall GetEditMode(void);
  121.     Windows::TRect __fastcall GetPanelBounds(System::Integer Index);
  122.     System::Boolean __fastcall PointInPanel(const Windows::TSmallPoint P);
  123.     void __fastcall Reset(void);
  124.     void __fastcall Scroll(System::Integer Inc, System::Boolean ScrollLock);
  125.     void __fastcall ScrollMessage(Messages::TWMScroll &Message);
  126.     void __fastcall SelectNext(System::Boolean GoForward);
  127.     void __fastcall SetColCount(System::Integer Value);
  128.     void __fastcall SetDataSource(Db::TDataSource *Value);
  129.     void __fastcall SetEditMode(System::Boolean Value);
  130.     void __fastcall SetOrientation(TDBCtrlGridOrientation Value);
  131.     void __fastcall SetPanelBorder(TDBCtrlGridBorder Value);
  132.     void __fastcall SetPanelHeight(System::Integer Value);
  133.     void __fastcall SetPanelIndex(System::Integer Value);
  134.     void __fastcall SetPanelWidth(System::Integer Value);
  135.     void __fastcall SetRowCount(System::Integer Value);
  136.     void __fastcall UpdateDataLinks(Controls::TControl *Control, System::Boolean Inserting);
  137.     MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  138.     MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  139.     MESSAGE void __fastcall WMHScroll(Messages::TWMScroll &Message);
  140.     MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &Message);
  141.     MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  142.     MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  143.     MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  144.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  145.     MESSAGE void __fastcall CMChildKey(Controls::TCMChildKey &Message);
  146.     
  147. protected:
  148.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  149.     virtual void __fastcall CreateWnd(void);
  150.     virtual Classes::TComponent *__fastcall GetChildParent(void);
  151.     virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
  152.     virtual void __fastcall PaintPanel(System::Integer Index);
  153.     virtual void __fastcall PaintWindow(System::Integer DC);
  154.     virtual void __fastcall ReadState(Classes::TReader *Reader);
  155.     virtual void __fastcall SetBounds(System::Integer ALeft, System::Integer ATop, System::Integer AWidth
  156.         , System::Integer AHeight);
  157.     
  158. public:
  159.     __fastcall virtual TDBCtrlGrid(Classes::TComponent *AOwner);
  160.     __fastcall virtual ~TDBCtrlGrid(void);
  161.     void __fastcall DoKey(TDBCtrlGridKey Key);
  162.     virtual void __fastcall GetTabOrderList(Classes::TList *List);
  163.     virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);
  164.     __property Graphics::TCanvas * Canvas = {read=FCanvas, nodefault};
  165.     __property System::Boolean EditMode = {read=GetEditMode, write=SetEditMode, nodefault};
  166.     __property System::Integer PanelCount = {read=FPanelCount, nodefault};
  167.     __property System::Integer PanelIndex = {read=FPanelIndex, write=SetPanelIndex, nodefault};
  168.     
  169. __published:
  170.     __property System::Boolean AllowDelete = {read=FAllowDelete, write=FAllowDelete, default=1};
  171.     __property System::Boolean AllowInsert = {read=FAllowInsert, write=FAllowInsert, default=1};
  172.     __property System::Integer ColCount = {read=FColCount, write=SetColCount, nodefault};
  173.     __property Color ;
  174.     __property Db::TDataSource * DataSource = {read=GetDataSource, write=SetDataSource, nodefault};
  175.     __property DragCursor ;
  176.     __property DragMode ;
  177.     __property Enabled ;
  178.     __property Font ;
  179.     __property TDBCtrlGridOrientation Orientation = {read=FOrientation, write=SetOrientation, default=0
  180.         };
  181.     __property TDBCtrlGridBorder PanelBorder = {read=FPanelBorder, write=SetPanelBorder, default=1};
  182.     __property System::Integer PanelHeight = {read=FPanelHeight, write=SetPanelHeight, nodefault};
  183.     __property System::Integer PanelWidth = {read=FPanelWidth, write=SetPanelWidth, nodefault};
  184.     __property ParentColor ;
  185.     __property ParentFont ;
  186.     __property ParentShowHint ;
  187.     __property PopupMenu ;
  188.     __property TabOrder ;
  189.     __property TabStop ;
  190.     __property System::Integer RowCount = {read=FRowCount, write=SetRowCount, nodefault};
  191.     __property System::Boolean ShowFocus = {read=FShowFocus, write=FShowFocus, default=1};
  192.     __property ShowHint ;
  193.     __property Visible ;
  194.     __property OnClick ;
  195.     __property OnDblClick ;
  196.     __property OnDragDrop ;
  197.     __property OnDragOver ;
  198.     __property OnEndDrag ;
  199.     __property OnEnter ;
  200.     __property OnExit ;
  201.     __property OnKeyDown ;
  202.     __property OnKeyPress ;
  203.     __property OnKeyUp ;
  204.     __property OnMouseDown ;
  205.     __property OnMouseMove ;
  206.     __property OnMouseUp ;
  207.     __property TPaintPanelEvent OnPaintPanel = {read=FOnPaintPanel, write=FOnPaintPanel};
  208.     __property OnStartDrag ;
  209. };
  210.  
  211. class __declspec(pascalimplementation) TDBCtrlGridLink : public Db::TDataLink
  212. {
  213.     typedef TDBCtrlGridLink ThisClass;
  214.     typedef Db::TDataLink inherited;
  215.     
  216. private:
  217.     TDBCtrlGrid *FDBCtrlGrid;
  218.     
  219. protected:
  220.     virtual void __fastcall ActiveChanged(void);
  221.     virtual void __fastcall DataSetChanged(void);
  222.     
  223. public:
  224.     __fastcall TDBCtrlGridLink(TDBCtrlGrid *DBCtrlGrid);
  225. public:
  226.     /* !! TDataLink.Destroy */ __fastcall virtual ~TDBCtrlGridLink(void) { }
  227.     
  228. };
  229.  
  230. //-- var, const, procedure ---------------------------------------------------
  231.  
  232. }    /* namespace Dbcgrids */
  233. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  234. using namespace Dbcgrids;
  235. #endif
  236. //-- end unit ----------------------------------------------------------------
  237. #endif    // DBCGrids
  238.