home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / AWARE_H.PAK / DBGRID.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  10.0 KB  |  285 lines

  1. //--------------------------------------------------------
  2. // DBGRID.H generated from VTSSONLY.VBX
  3. // Copyrights (C) 1996 Borland International
  4. //--------------------------------------------------------
  5.  
  6. #if !defined(DBGRID_H_)
  7. #define  DBGRID_H_
  8.  
  9. #include <vdbt/dbcontrl.h>
  10.  
  11. //--------------------------------------------------------
  12. // DBGrid (VB3)
  13. //--------------------------------------------------------
  14.  
  15. // properties
  16. #define Prop_TDBGrid_Name 0
  17. #define Prop_TDBGrid_Enabled 1
  18. #define Prop_TDBGrid_Height 2
  19. #define Prop_TDBGrid_HelpContextID 3
  20. #define Prop_TDBGrid_hWnd 4
  21. #define Prop_TDBGrid_Index 5
  22. #define Prop_TDBGrid_Left 6
  23. #define Prop_TDBGrid_Parent 7
  24. #define Prop_TDBGrid_TabOrder 8
  25. #define Prop_TDBGrid_TabStop 9
  26. #define Prop_TDBGrid_Tag 10
  27. #define Prop_TDBGrid_Top 11
  28. #define Prop_TDBGrid_Visible 12
  29. #define Prop_TDBGrid_Width 13
  30. #define Prop_TDBGrid_ReadFile 14
  31. #define Prop_TDBGrid_SS 15
  32. #define Prop_TDBGrid_WriteFile 17
  33. #define Prop_TDBGrid_BackColor 18
  34. #define Prop_TDBGrid_BorderStyle 19
  35. #define Prop_TDBGrid_Col 20
  36. #define Prop_TDBGrid_Row 21
  37. #define Prop_TDBGrid_ShowHScrollBar 22
  38. #define Prop_TDBGrid_Text 23
  39. #define Prop_TDBGrid_Number 24
  40. #define Prop_TDBGrid_Formula 25
  41. #define Prop_TDBGrid_FixedCol 26
  42. #define Prop_TDBGrid_FixedCols 27
  43. #define Prop_TDBGrid_FixedRow 28
  44. #define Prop_TDBGrid_FixedRows 29
  45. #define Prop_TDBGrid_ShowGridLines 30
  46. #define Prop_TDBGrid_ShowRowHeading 31
  47. #define Prop_TDBGrid_ShowSelections 32
  48. #define Prop_TDBGrid_LeftCol 33
  49. #define Prop_TDBGrid_MaxCol 34
  50. #define Prop_TDBGrid_MaxRow 35
  51. #define Prop_TDBGrid_TopRow 36
  52. #define Prop_TDBGrid_AllowResize 37
  53. #define Prop_TDBGrid_AllowSelections 38
  54. #define Prop_TDBGrid_AllowFormulas 39
  55. #define Prop_TDBGrid_AllowInCellEditing 40
  56. #define Prop_TDBGrid_ShowVScrollBar 41
  57. #define Prop_TDBGrid_AllowFillRange 42
  58. #define Prop_TDBGrid_AllowMoveRange 43
  59. #define Prop_TDBGrid_SelStartCol 44
  60. #define Prop_TDBGrid_SelStartRow 45
  61. #define Prop_TDBGrid_SelEndCol 46
  62. #define Prop_TDBGrid_SelEndRow 47
  63. #define Prop_TDBGrid_ExtraColor 48
  64. #define Prop_TDBGrid_EditName 49
  65. #define Prop_TDBGrid_FileName 50
  66. #define Prop_TDBGrid_AutoRecalc 51
  67. #define Prop_TDBGrid_AllowAppLaunch 53
  68. #define Prop_TDBGrid_PrintGridLines 54
  69. #define Prop_TDBGrid_PrintRowHeading 55
  70. #define Prop_TDBGrid_PrintHCenter 56
  71. #define Prop_TDBGrid_PrintVCenter 57
  72. #define Prop_TDBGrid_PrintLeftToRight 58
  73. #define Prop_TDBGrid_PrintHeader 59
  74. #define Prop_TDBGrid_PrintFooter 60
  75. #define Prop_TDBGrid_PrintLeftMargin 61
  76. #define Prop_TDBGrid_PrintTopMargin 62
  77. #define Prop_TDBGrid_PrintRightMargin 63
  78. #define Prop_TDBGrid_PrintBottomMargin 64
  79. #define Prop_TDBGrid_PrintArea 65
  80. #define Prop_TDBGrid_PrintTitles 66
  81. #define Prop_TDBGrid_PrintNoColor 67
  82. #define Prop_TDBGrid_Selection 68
  83. #define Prop_TDBGrid_DataSource 69
  84. #define Prop_TDBGrid_DataChanged 70
  85. #define Prop_TDBGrid_TableName 71
  86. #define Prop_TDBGrid_DataField 72
  87. #define Prop_TDBGrid_DataFields 73
  88. #define Prop_TDBGrid_DoCancelEdit 74
  89. #define Prop_TDBGrid_DoSelChange 75
  90. #define Prop_TDBGrid_DoStartEdit 76
  91. #define Prop_TDBGrid_DoEndEdit 77
  92. #define Prop_TDBGrid_DoStartRecalc 78
  93. #define Prop_TDBGrid_DoEndRecalc 79
  94. #define Prop_TDBGrid_DoClick 80
  95. #define Prop_TDBGrid_DoDblClick 81
  96. #define Prop_TDBGrid_DataSetMaxRow 82
  97. #define Prop_TDBGrid_DataFieldChanged 83
  98. #define Prop_TDBGrid_DataFieldNumber 84
  99. #define Prop_TDBGrid_DataFieldCount 85
  100. #define Prop_TDBGrid_DataRowCount 86
  101. #define Prop_TDBGrid_DataSetColumnNames 87
  102. #define Prop_TDBGrid_DataSetMaxCol 88
  103. #define Prop_TDBGrid_ShowColHeading 89
  104. #define Prop_TDBGrid_PrintColHeading 90
  105. #define Prop_TDBGrid_DataSetColumnWidths 91
  106. #define Prop_TDBGrid_About_Formula_One 92
  107. #define Prop_TDBGrid_Entry 93
  108. #define Prop_TDBGrid_DataRowsBuffered 94
  109. #define Prop_TDBGrid_DataRowBase 95
  110. #define Prop_TDBGrid_DoDataRowLoad 96
  111. #define Prop_TDBGrid_DoDataNewRow 97
  112. #define Prop_TDBGrid_Repaint 98
  113. #define Prop_TDBGrid_AllowArrows 99
  114. #define Prop_TDBGrid_AllowTabs 100
  115. #define Prop_TDBGrid_FormattedText 101
  116. #define Prop_TDBGrid_MousePointer 102
  117. #define Prop_TDBGrid_RowMode 103
  118. #define Prop_TDBGrid_DataConnected 104
  119. #define Prop_TDBGrid_DataAutoAddNew 105
  120. #define Prop_TDBGrid_AllowDelete 106
  121. #define Prop_TDBGrid_DataHdrField 107
  122. #define Prop_TDBGrid_EnableProtection 108
  123. #define Prop_TDBGrid_WriteExcel4 109
  124. #define Prop_TDBGrid_DataSetColumnFormats 110
  125. #define Prop_TDBGrid_DragIcon 111
  126. #define Prop_TDBGrid_DragMode 112
  127. #define Prop_TDBGrid_MinCol 113
  128. #define Prop_TDBGrid_MinRow 114
  129. #define Prop_TDBGrid_DoTopLeftChanged 115
  130. #define Prop_TDBGrid_AllowEditHeaders 116
  131. #define Prop_TDBGrid_Application_Designer 117
  132.  
  133. // events
  134. #define Event_TDBGrid_Click 0
  135. #define Event_TDBGrid_DblClick 1
  136. #define Event_TDBGrid_DragDrop 2
  137. #define Event_TDBGrid_DragOver 3
  138. #define Event_TDBGrid_GotFocus 4
  139. #define Event_TDBGrid_KeyDown 5
  140. #define Event_TDBGrid_KeyPress 6
  141. #define Event_TDBGrid_KeyUp 7
  142. #define Event_TDBGrid_LostFocus 8
  143. #define Event_TDBGrid_CancelEdit 9
  144. #define Event_TDBGrid_SelChange 10
  145. #define Event_TDBGrid_StartEdit 11
  146. #define Event_TDBGrid_EndEdit 12
  147. #define Event_TDBGrid_StartRecalc 13
  148. #define Event_TDBGrid_EndRecalc 14
  149. #define Event_TDBGrid_DataRowLoad 15
  150. #define Event_TDBGrid_DataNewRow 16
  151. #define Event_TDBGrid_TopLeftChanged 17
  152.  
  153.  
  154. //----------------------------------------------------------------------
  155. // Event Response Table Macros
  156. //----------------------------------------------------------------------
  157. #define EV_VBXEVENT_GRID_DRAGDROP \
  158.   {WM_VBXBASE+Event_TDBGrid_DragDrop,0,(TAnyDispatcher)::DragEvent_Dispatch}
  159.  
  160. #define EV_VBXEVENT_GRID_DRAGOVER \
  161.   {WM_VBXBASE+Event_TDBGrid_DragOver,0,(TAnyDispatcher)::DragOver_Dispatch}
  162.  
  163.  
  164. class _DBAWARECLASS TDBGrid : public TVbxControl {
  165.   DBPMECLASS( TDBGrid );
  166.  
  167.   public:
  168.  
  169.     // constructors
  170.     TDBGrid(TWindow*, int, LPCSTR, int, int, int, int, TModule* =0);
  171.     TDBGrid(TWindow* parent, int resourceId, TModule* =0);
  172.  
  173.   public:
  174.     // Properties
  175.     DECLARE_DB_PROP_RW2( string,   Name );
  176.     DECLARE_DB_PROP_RW0( Bool,     Enabled,        Prop_TDBGrid_Enabled );
  177.     DECLARE_DB_PROP_RW0( long,     Height,         Prop_TDBGrid_Height );
  178.     DECLARE_DB_PROP_RW0( long,     HelpContext,    Prop_TDBGrid_HelpContextID );
  179.     DECLARE_DB_PROP_RW0( int,      ComponentIndex, Prop_TDBGrid_Index );
  180.     DECLARE_DB_PROP_RW0( long,     Left,           Prop_TDBGrid_Left );
  181.     DECLARE_DB_PROP_RW0( int,      TabOrder,       Prop_TDBGrid_TabOrder );
  182.     DECLARE_DB_PROP_RW0( Bool,     TabStop,        Prop_TDBGrid_TabStop );
  183.     DECLARE_DB_PROP_RW2( string,   Tag );
  184.     DECLARE_DB_PROP_RW0( long,     Top,            Prop_TDBGrid_Top );
  185.     DECLARE_DB_PROP_RW0( Bool,     Visible,        Prop_TDBGrid_Visible );
  186.     DECLARE_DB_PROP_RW0( long,     Width,          Prop_TDBGrid_Width );
  187.     DECLARE_DB_PROP_RW0( COLORREF, BackColor,      Prop_TDBGrid_BackColor );
  188.     DECLARE_DB_PROP_RW0( ENUM,     BorderStyle,    Prop_TDBGrid_BorderStyle );
  189.     DECLARE_DB_PROP_RW2( TDataSource, DataSource );
  190.     DECLARE_DB_PROP_RW2( TField,      DataField );
  191.     DECLARE_DB_PROP_RW0( ENUM,     Cursor,         Prop_TDBGrid_MousePointer );
  192.     DECLARE_DB_PROP_RW0( HPIC,     DragIcon,       Prop_TDBGrid_DragIcon );
  193.     DECLARE_DB_PROP_RW0( ENUM,     DragMode,       Prop_TDBGrid_DragMode );
  194. // Options Flags
  195.     DECLARE_DB_PROP_RW0( Bool,     ColumnResize,   Prop_TDBGrid_AllowResize  );
  196.     DECLARE_DB_PROP_RW0( Bool,     Titles,         Prop_TDBGrid_ShowRowHeading );
  197.     DECLARE_DB_PROP_RW0( Bool,     Indicators,     Prop_TDBGrid_ShowColHeading );
  198.     DECLARE_DB_PROP_RW0( Bool,     Lines,          Prop_TDBGrid_ShowGridLines );
  199.     DECLARE_DB_PROP_RW0( Bool,     Tabs,           Prop_TDBGrid_AllowTabs );
  200.     DECLARE_DB_PROP_RW0( Bool,     Editing,        Prop_TDBGrid_AllowInCellEditing );
  201.  
  202.   private:
  203.     void FireOnClick()
  204.     {
  205.       OnClickSource( *this );
  206.     }
  207.     void FireOnDragDrop( TVbxControl& Source, SHORT x, SHORT y )
  208.     {
  209.       OnDragDropSource( *this, Source, x, y );
  210.     }
  211.     void FireOnDragOver( TVbxControl& Source, SHORT x, SHORT y, TDragState State )
  212.     {
  213.       OnDragOverSource( *this, Source, x, y, State );
  214.     }
  215.     void FireOnDblClick()
  216.     {
  217.       OnDblClickSource( *this );
  218.     }
  219.     void FireOnEnter()
  220.     {
  221.       OnEnterSource( *this );
  222.     }
  223.     void FireOnExit()
  224.     {
  225.       OnExitSource( *this );
  226.     }
  227.     void FireOnKeyDown( SHORT *Key, TShiftState State )
  228.     {
  229.       OnKeyDownSource( *this, Key, State );
  230.     }
  231.     void FireOnKeyPress( SHORT Key )
  232.     {
  233.       OnKeyPressSource( *this, Key );
  234.     }
  235.     void FireOnKeyUp( SHORT *Key, TShiftState State )
  236.     {
  237.       OnKeyUpSource( *this, Key, State );
  238.     }
  239.  
  240.   public:
  241.     // Event Source
  242.     DECLARE_SOURCE( OnClick,    TDBGridNotify );
  243.     DECLARE_SOURCE( OnDragDrop, TDBGridDrag );
  244.     DECLARE_SOURCE( OnDragOver, TDBGridDragOver );
  245.     DECLARE_SOURCE( OnDblClick, TDBGridNotify );
  246.     DECLARE_SOURCE( OnEnter,    TDBGridNotify );
  247.     DECLARE_SOURCE( OnExit,     TDBGridNotify );
  248.     DECLARE_SOURCE( OnKeyDown,  TDBGridKey );
  249.     DECLARE_SOURCE( OnKeyPress, TDBGridKeyPress );
  250.     DECLARE_SOURCE( OnKeyUp,    TDBGridKey );
  251.  
  252.     // Event Handlers
  253.     DECLARE_DB_EVENT( OnClick,    TNotifyEvent );
  254.     DECLARE_DB_EVENT( OnDblClick, TNotifyEvent );
  255.     DECLARE_DB_EVENT( OnDragOver, TDragOverEvent );
  256.     DECLARE_DB_EVENT( OnDragDrop, TDragEvent );
  257.     DECLARE_DB_EVENT( OnEnter,    TNotifyEvent );
  258.     DECLARE_DB_EVENT( OnExit,     TNotifyEvent );
  259.     DECLARE_DB_EVENT( OnKeyDown,  TKeyEvent );
  260.     DECLARE_DB_EVENT( OnKeyPress, TKeyPressEvent );
  261.     DECLARE_DB_EVENT( OnKeyUp,    TKeyEvent );
  262.  
  263.   protected:
  264.     char far* GetClassName();
  265.  
  266. #ifdef __OWL_VBXCTL_H
  267.   DECLARE_RESPONSE_TABLE( TDBGrid );
  268. #endif __OWL_VBXCTL_H
  269. };
  270.  
  271. // Inlines
  272. // Properties
  273. DEFINE_DB_PROP_DATASOURCE( TDBGrid )
  274. DEFINE_DB_PROP_DATAFIELD( TDBGrid, _TDBGrid )
  275. DEFINE_DB_PROP_STRING( TDBGrid, _TDBGrid, Name );
  276. DEFINE_DB_PROP_STRING( TDBGrid, _TDBGrid, Tag );
  277.  
  278. // Methods
  279. inline char far* TDBGrid::GetClassName()
  280. {
  281.   return "DBGRID";
  282. }
  283.  
  284. #endif DBGRID_H_
  285.