home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / lckowl15 / datatbl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-16  |  12.6 KB  |  348 lines

  1. /***************************************************************************\
  2.  
  3.    (c) 1992, ProtoView Development Co. and Atlantic Information 
  4.              Management, Inc., All rights reserved
  5. \***************************************************************************/
  6.  
  7. /***************************************************\
  8. *   Data Table Custom Control Constants and Types   *
  9. \***************************************************/
  10.  
  11. #ifndef DATATBL_INCLUDED
  12. #define DATATBL_INCLUDED
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. #ifndef RC_INVOKED
  19. #ifndef __SQLVIEW__
  20.  
  21. //***** Typedefs *****
  22. typedef DWORD ROWNUM;
  23. typedef WORD ROWSTAT;
  24. typedef WORD ROWLEN;
  25. typedef WORD COLNUM;
  26. typedef WORD COLSTAT;
  27. typedef WORD COLTYPE;
  28. typedef WORD COLSTYLE;
  29. typedef WORD COLLEN;
  30. typedef WORD CHARNUM;
  31. typedef WORD ACCMODE;
  32.  
  33. #endif   /* ifndef __SQLVIEW__ */
  34. #endif   /* ifndef RC_INVOKED */
  35.  
  36. //***** Window Styles *****
  37. #define DTS_EDIT        0x0004
  38. #define DTS_RESIZE      0x0008
  39. #define DTS_NONE        0x0000
  40. #define DTS_NUMBERS     0x0010
  41. #define DTS_LETTERS     0x0020
  42. #define DTS_OWNERDEF    0x0030
  43. #define DTS_HGRID       0x0040
  44. #define DTS_VGRID       0x0080
  45. #define DTS_ROWSELECT   0x0100
  46. #define DTS_MULTIROW    0x0200
  47. #define DTS_COLSELECT   0x0400
  48. #define DTS_MULTICOL    0x0800
  49. #define DTS_SMALLDATA   0x0000
  50. #define DTS_LARGEDATA   0x1000
  51. #define DTS_ROWBUTTONS  0x2000
  52. #define DTS_ROWNUMBERS  0x4000
  53. #define DTS_DROPDOWN    0x8000l
  54. #define DTS_AUTODROPDN  0x8002l
  55.  
  56. /****** Column Styles ******/
  57. #define DTCS_RESIZE     0x0001
  58. #define DTCS_FIXED      0x0002 
  59. #define DTCS_EDIT       0x0004
  60. #define DTCS_PROTECT    0x0008
  61. #define DTCS_NOSCROLL   0x0010  /* not supported */
  62. #define DTCS_HIDDEN     0x0020
  63. #define DTCS_LEFT       0x0000
  64. #define DTCS_CENTER     0x0040
  65. #define DTCS_RIGHT      0x0080
  66. #define DTCS_HEADLEFT   0x0000
  67. #define DTCS_HEADCENTER 0x0100
  68. #define DTCS_HEADRIGHT  0x0200
  69. #define DTCS_CHECKBOX   0x1000  /* not supported */
  70.  
  71. /****** Column Data Types ******/
  72. #define DTT_INT1           0x81
  73. #define DTT_INT2           0x82
  74. #define DTT_INT4           0x83
  75. #define DTT_REAL4          0x84
  76. #define DTT_REAL8          0x85
  77. #define DTT_CHAR           0x86
  78. #define DTT_ZSTRING        0x87
  79. #define DTT_FILEDATE       0x88
  80. #define DTT_FILETIME       0x89
  81. #define DTT_CDATETIME      0x8A
  82. #define DTT_UINT1          0x91
  83. #define DTT_UINT2          0x92
  84. #define DTT_UINT4          0x93
  85.  
  86. #define DTT_SQLINT1        0x30
  87. #define DTT_SQLINT2        0x34
  88. #define DTT_SQLINT4        0x38
  89. #define DTT_SQLBIT         0x32
  90. #define DTT_SQLFLT8        0x3E
  91. #define DTT_SQLMONEY       0x3C
  92. #define DTT_SQLDATETIME    0x3D
  93. #define DTT_SQLCHAR        0x2F
  94. #define DTT_SQLVARCHAR     0x27
  95.  
  96. /****** Messages ******/
  97. #define DTM_RESETALL       (WM_USER+0)
  98. #define DTM_RESETDATA      (WM_USER+1)
  99. #define DTM_GETWNDSTYLE    (WM_USER+2)
  100. #define DTM_SETWNDSTYLE    (WM_USER+3)
  101. #define DTM_GETCONFIGSIZE  (WM_USER+4)
  102. #define DTM_GETCONFIG      (WM_USER+5)
  103. #define DTM_SETCONFIG      (WM_USER+6)
  104. #define DTM_GETCOLCOUNT    (WM_USER+7)
  105. #define DTM_SETCOLCOUNT    (WM_USER+8)
  106. #define DTM_GETCOLSTYLE    (WM_USER+9)
  107. #define DTM_SETCOLSTYLE    (WM_USER+10)
  108. #define DTM_GETCOLTYPE     (WM_USER+11)
  109. #define DTM_SETCOLTYPE     (WM_USER+12)
  110. #define DTM_GETCOLDATALEN  (WM_USER+13)
  111. #define DTM_SETCOLDATALEN  (WM_USER+14)  
  112. #define DTM_GETCOLWIDTH    (WM_USER+15)
  113. #define DTM_SETCOLWIDTH    (WM_USER+16)
  114. #define DTM_GETCOLFORMAT   (WM_USER+17)
  115. #define DTM_SETCOLFORMAT   (WM_USER+18)
  116. #define DTM_GETCOLHEAD     (WM_USER+19)
  117. #define DTM_SETCOLHEAD     (WM_USER+20)
  118. #define DTM_GETCOLNAME     (WM_USER+21)
  119. #define DTM_SETCOLNAME     (WM_USER+22)
  120. #define DTM_GETCOLEXTRA1   (WM_USER+23)
  121. #define DTM_SETCOLEXTRA1   (WM_USER+24)
  122. #define DTM_GETCOLEXTRA2   (WM_USER+25)
  123. #define DTM_SETCOLEXTRA2   (WM_USER+26)
  124. #define DTM_GETCOLNUMBER   (WM_USER+27)
  125. #define DTM_SHOWDROPDOWN   (WM_USER+28)
  126. #define DTM_ISDROPDOWN     (WM_USER+29)
  127. #define DTM_GETROWCOUNT    (WM_USER+30)
  128. #define DTM_GETTOPINDEX    (WM_USER+32)
  129. #define DTM_SETTOPINDEX    (WM_USER+33)
  130. #define DTM_GETLEFTINDEX   (WM_USER+34)
  131. #define DTM_SETLEFTINDEX   (WM_USER+35)
  132. #define DTM_GETCURROW      (WM_USER+36)
  133. #define DTM_GETCURCOL      (WM_USER+37)
  134. #define DTM_SETCURCELL     (WM_USER+38)
  135. #define DTM_GETACCESSROW   (WM_USER+39)
  136. #define DTM_GETACCESSCOL   (WM_USER+40)
  137. #define DTM_SETACCESSPOS   (WM_USER+41)
  138. #define DTM_READROW        (WM_USER+42)
  139. #define DTM_UPDATEROW      (WM_USER+43)
  140. #define DTM_INSERTROW      (WM_USER+44)
  141. #define DTM_DELETEROW      (WM_USER+45)
  142. #define DTM_MOVEROWTO      (WM_USER+46)
  143. #define DTM_REPLICATEROWTO (WM_USER+47)
  144. #define DTM_READCOL        (WM_USER+48)
  145. #define DTM_UPDATECOL      (WM_USER+49)
  146. #define DTM_INSERTCOL      (WM_USER+90)
  147. #define DTM_DELETECOL      (WM_USER+50)
  148. #define DTM_MOVECOLTO      (WM_USER+51)
  149. #define DTM_REPLICATECOLTO (WM_USER+52)
  150. #define DTM_READCELL       (WM_USER+53)
  151. #define DTM_UPDATECELL     (WM_USER+54)
  152. #define DTM_READCELLRECT   (WM_USER+55)
  153. #define DTM_GETSELMODE     (WM_USER+56)
  154. #define DTM_SETSELMODE     (WM_USER+57)  /* not supported */
  155. #define DTM_GETROWSTATUS   (WM_USER+58)
  156. #define DTM_GETCURROWSEL   (WM_USER+91)
  157. #define DTM_SELROW         (WM_USER+59)
  158. #define DTM_SELROWRANGE    (WM_USER+60)
  159. #define DTM_SELALLROWS     (WM_USER+61)
  160. #define DTM_GETROWSELCOUNT (WM_USER+62)
  161. #define DTM_GETROWSELLIST  (WM_USER+63)
  162. #define DTM_GETROWSELFIRST (WM_USER+64)
  163. #define DTM_GETROWSELNEXT  (WM_USER+65)
  164. #define DTM_GETCOLSTATUS   (WM_USER+66)
  165. #define DTM_GETCURCOLSEL   (WM_USER+92)
  166. #define DTM_SELCOL         (WM_USER+67)
  167. #define DTM_SELCOLRANGE    (WM_USER+68)
  168. #define DTM_SELALLCOLS     (WM_USER+69)
  169. #define DTM_GETCOLSELCOUNT (WM_USER+70)
  170. #define DTM_GETCOLSELLIST  (WM_USER+71)
  171. #define DTM_GETCOLSELFIRST (WM_USER+72)
  172. #define DTM_GETCOLSELNEXT  (WM_USER+73)
  173. #define DTM_GETCHARSEL     (WM_USER+74)
  174. #define DTM_SETCHARSEL     (WM_USER+75)
  175. #define DTM_GETVISROWS     (WM_USER+81)
  176. #define DTM_GETVISCOLS     (WM_USER+82)
  177. #define DTM_GETNOTIFYROW   (WM_USER+83)
  178. #define DTM_GETNOTIFYCOL   (WM_USER+84)
  179. #define DTM_GETCLICKPOS    (WM_USER+85)
  180. #define DTM_GETCOLCFGSIZE  (WM_USER+87)
  181. #define DTM_GETCOLCFG      (WM_USER+88)
  182. #define DTM_SETCOLCFG      (WM_USER+89)
  183. #define DTM_GETEDITKEY     (WM_USER+93)
  184. #define DTM_SETEDITKEY     (WM_USER+94)
  185. #define DTM_EDITCURRCELL   (WM_USER+95)
  186. #define DTM_GETDTMETRICS   (WM_USER+96)
  187.                            
  188. #define DTM_FIRSTMSG (WM_USER+0)
  189. #define DTM_LASTMSG  (WM_USER+96)
  190.  
  191. /****** Notification Codes ******/
  192. #define DTN_CREATE         1
  193. #define DTN_DESTROY        2
  194. #define DTN_ERRSPACE       3
  195. #define DTN_SETFOCUS       4
  196. #define DTN_KILLFOCUS      5
  197. #define DTN_HSCROLL        6
  198. #define DTN_VSCROLL        7
  199. #define DTN_CELLFULL       8
  200. #define DTN_SELCHANGE      9
  201. #define DTN_MODECHANGE     10
  202. #define DTN_DBLCLK         11
  203. #define DTN_CHANGE         12
  204. #define DTN_UPDATE         13
  205. #define DTN_DROPDOWN       14
  206. #define DTN_POSCHANGE      15
  207. #define DTN_BEGINEDIT      16
  208. #define DTN_ABORTEDIT      17
  209. #define DTN_CLICKED        18
  210.  
  211. #define DTN_COLSIZE        20
  212. #define DTN_COLADDED       21
  213. #define DTN_COLDELETED     22
  214. #define DTN_COLMOVED       23
  215. #define DTN_COLNAMECHANGED 24
  216.  
  217. #define DTN_NOTAVAILABLE   99
  218.  
  219. //***** DTM_GETNOTIFYROW/COL return codes *****
  220. #define DTPOS_HEADINGS  (ROWNUM)(-1)   /* "row number" of heading row */
  221. #define DTPOS_LABELS    (COLNUM)(-2)   /* "column number" of label column */
  222. #define DTPOS_NOWHERE   (WORD)(-3)     /* empty area in data table */
  223.  
  224. //***** DTM_GETCLICKPOS return codes *****
  225.  
  226. #ifndef RC_INVOKED
  227. #ifndef __SQLVIEW__
  228.  
  229. typedef enum {NOWHERE, ONHEADING, ONGRIDLINE, ONCELL, ONLABEL} TABLEPOS;
  230.  
  231. #else
  232.  
  233. #define TABLEPOS_NOWHERE      0
  234. #define TABLEPOS_ONHEADING    1
  235. #define TABLEPOS_ONGRIDLINE   2
  236. #define TABLEPOS_ONCELL       3
  237. #define TABLEPOS_ONLABEL      4
  238.  
  239. #endif   /* else for ifndef __SQLVIEW__ */
  240. #endif   /* ifndef RC_INVOKED */
  241.  
  242. //***** SetAccessPos special locations *****
  243. #define DTPOS_LAST      (DWORD)(-1)  /* last row or column */
  244. #define DTPOS_AFTERLAST (DWORD)(-2)  /* after the last (insert & move only) */
  245. #define DTPOS_INVALID   (DWORD)(-3)  /* invalid pos (ie read past last row) */
  246.  
  247. //***** Row/Column Access Modes *****
  248. #define DTA_ACCESS    0x0000  /* start with position passed in SetAccessPos */
  249. #define DTA_CURRENT   0x0001  /* start with current object */
  250. #define DTA_SELFIRST  0x0002  /* start with first selected row or column */
  251. #define DTA_SELNEXT   0x0003  /* start with next selected row or column */
  252. #define DTA_AUTOINC   0x0004  /* increment after access */
  253. #define DTA_AUTODEC   0x0008  /* decrement after access */
  254. #define DTA_COLMAJOR  0x0010  /* row # changes before column # */
  255.  
  256. //***** EditCurrCell parameter values *****
  257. #define DT_BEGINEDIT 1
  258. #define DT_ENDEDIT   2
  259. #define DT_ABORTEDIT 3
  260.  
  261. //***** GetDTMetrics parameter values *****
  262. #define DT_ROWHEIGHT  1
  263. #define DT_ROWWIDTH   2
  264. #define DT_HEADINGHT  3
  265. #define DT_LABELWIDTH 4
  266.  
  267. //***** Data Table Error Codes *****
  268. #define DTE_OKAY        (DWORD)0     /* NO ERROR */
  269. #define DTE_NOTALLOWED  (DWORD)-1    /* operation not allowed */
  270. #define DTE_MESSAGENUM  (DWORD)-2    /* invalid message */
  271. #define DTE_CELLADDR    (DWORD)-3    /* invalid cell address */
  272. #define DTE_COLNUM      (DWORD)-4    /* invalid column number */
  273. #define DTE_ROWNUM      (DWORD)-5    /* invalid row number */
  274. #define DTE_NUMCOLS     (DWORD)-6    /* invalid number of columns */
  275. #define DTE_NUMROWS     (DWORD)-7    /* invalid number of rows */
  276. #define DTE_COLWIDTH    (DWORD)-8    /* invalid column width */
  277. #define DTE_COLTYPE     (DWORD)-9    /* invalid column data type */
  278. #define DTE_FIXEDLENGTH (DWORD)-10   /* column data type has fixed length */
  279. #define DTE_TRUNCATED   (DWORD)-11   /* data buffer was truncated */
  280. #define DTE_NULLPOINTER (DWORD)-12   /* null pointer passed to function*/
  281. #define DTE_NULLVALUE   (DWORD)-13   /* null parameter passed to function */
  282. #define DTE_NOMEMORY    (DWORD)-21   /* insufficient memory */
  283. #define DTE_NOMEMLOCK   (DWORD)-22   /* cant lock memory */
  284. #define DTE_STRINGTABLE (DWORD)-23   /* fatal string table size error */
  285. #define DTE_OVERFLOW    (DWORD)-24   /* exceeded max allowable length */
  286. #define DTE_NORESLOAD   (DWORD)-25   /* cant load resource */
  287. #define DTE_NORESLOCK   (DWORD)-26   /* cant lock resource */
  288.  
  289. /************** Data Table Configuration Structures ************************
  290.  Ver.   Date   Changes
  291.  ---- -------- -----------------------------------------------------------
  292.  1.0  10/16/91 New structures (did not contain version stamp)
  293.  1.1  11/05/91 Added structure lengths & version stamp
  294.  1.2  11/14/91 Added private window style bits
  295.  1.3  12/03/91 Column widths are now in dialog coords, was screen coords
  296. ***************************************************************************/
  297.  
  298. #define CFGSTRUCTVERSION 13   /* current version (1.3) */
  299. #define MINCFGSTRUCTVER  11   /* earliest supported version (1.1) */
  300.  
  301. #ifndef RC_INVOKED
  302. #ifndef __SQLVIEW__
  303.  
  304. typedef struct
  305.    {
  306.    WORD     wStructLen; // length of this structure
  307.    int      nVersion;   // version number of these structures, in tenths
  308.    COLNUM   NumCols;    // total # columns
  309.    WORD     wWndStyle;  // private window style bits
  310.    } TABLECFGSTRUCT;
  311.  
  312. typedef struct
  313.    {
  314.    WORD     wStructLen; // length of this structure, including the strings
  315.    COLSTYLE ColStyle;   // column style
  316.    COLTYPE  ColType;    // internal data type
  317.    COLLEN   DataLen;    // bytes of storage required for this type
  318.    WORD     wColWidth;  // column width in window
  319.    DWORD    dwExtra1;   // extra space for user-defined info
  320.    DWORD    dwExtra2;   // extra space for user-defined info
  321.    //       szFormat;      null-terminated format string
  322.    //       szHeading;     null-terminated column heading
  323.    //       szName;        null-terminated column name
  324.    } COLUMNCFGSTRUCT;
  325.  
  326. typedef TABLECFGSTRUCT *PTABLECFGSTRUCT;
  327. typedef TABLECFGSTRUCT far *LPTABLECFGSTRUCT;
  328.  
  329. typedef COLUMNCFGSTRUCT *PCOLUMNCFGSTRUCT;
  330. typedef COLUMNCFGSTRUCT far *LPCOLUMNCFGSTRUCT;
  331.  
  332. //***************************************************************************
  333. // Functions avaialable to applications for setting up data tables
  334.  
  335. WORD FAR PASCAL DataTblLoadLib (void);
  336. DWORD FAR PASCAL SetupDataTbl (HANDLE hInst, LPSTR szResName, HWND hCtl);
  337. DWORD FAR PASCAL SetupDlgDataTbl (HANDLE hInst, HWND hDlg, int nID, LPSTR szResName, LPSTR szDlgName);
  338. DWORD FAR PASCAL SetupMultiDataTbl (HANDLE hInst, HWND hDlg, LPSTR szDlgName);
  339.  
  340. #endif   /* ifndef __SQLVIEW__ */
  341. #endif   /* ifndef RC_INVOKED */
  342.  
  343. #ifdef __cplusplus
  344.    }
  345. #endif
  346.  
  347. #endif   /* ifndef DATATBL_INCLUDED */
  348.