home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual dBase Pro v7.0 / DATA1.CAB / Sample_Include / Vdbase.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-20  |  9.4 KB  |  324 lines

  1. //--------------------------------------------------------------
  2. //
  3. //  VDBASE.H
  4. //
  5. //  This is a header file containing definitions for various
  6. //  numeric constants used by Visual dBASE commands and
  7. //  functions as well as numeric properties of form controls.
  8. //
  9. //  This file replaces UTIL.H, ENUM.H, and MESSDLG.H which
  10. //  appeared in prior versions of Visual dBASE.
  11. //
  12. //  Visual dBASE Samples Group
  13. //
  14. //  $Revision:   1.2  $
  15. //
  16. //  Copyright (c) 1997, Borland International, Inc. 
  17. //  All rights reserved.
  18. //
  19. //--------------------------------------------------------------
  20.  
  21. //  Defines happen once, even if file is #included multiple times
  22.  
  23. #ifndef VDBASE_H
  24. #define VDBASE_H
  25.  
  26. // Define basic constants and macros
  27.  
  28. #define CFALSE 0
  29. #define CTRUE  1
  30.  
  31.  
  32. //  Common macros
  33.  
  34. #define ALLTRIM(s)  ltrim(rtrim(s))
  35. #define TRIMSTR(n)  ltrim(str(n))
  36.  
  37. //  Macros for creating typed NULLs
  38.  
  39. #define BOOKMARK_NULL         (bookmark( NULL ))
  40. #define CHARACTER_NULL        (upper( NULL ))
  41. #define DATE_NULL             (ctod( NULL ))
  42. #define LOGICAL_NULL          (isupper( NULL ))
  43. #define NUMERIC_NULL          (abs( NULL ))
  44.  
  45.  
  46. //  Constants used by Visual dBASE Commands and Functions
  47.  
  48. // Constants for ADEL(), AGROW(), AINS(), ALEN(), ASUBSCRIPT()
  49. // Also used by the Array class methods of similar names
  50. #define ARRAY_ELEMENT 0        // Used only by ALEN()
  51. #define ARRAY_ROW     1
  52. #define ARRAY_COLUMN  2
  53.  
  54. // Constants for ARESIZE()
  55. #define ARRAY_REARRANGE   0
  56. #define ARRAY_NOREARRANGE 1
  57.  
  58. // Constants for ASORT()
  59. #define ARRAY_ASCENDING  0
  60. #define ARRAY_DESCENDING 1
  61.  
  62. // Constants for BEGINTRANS()
  63. #define ISO_DEFAULT         0
  64. #define ISO_DIRTY_READ      1
  65. #define ISO_READ_COMMITTED  2
  66. #define ISO_REPEATABLE_READ 3
  67.  
  68. // Constants for BINTYPE(), REPLACE BINARY,
  69. #define BIN_AUDIO 32768
  70. #define BIN_IMAGE 32769
  71.  
  72. // Constants for DISKSPACE()
  73. #define DISK_SYSTEM  -1
  74. #define DISK_DEFAULT 0
  75. #define DISK_A       1
  76. #define DISK_B       2
  77. #define DISK_C       3
  78. #define DISK_D       4
  79. #define DISK_E       5
  80. #define DISK_F       6
  81. #define DISK_G       7
  82. #define DISK_H       8
  83. #define DISK_I       9
  84. #define DISK_J       10
  85. #define DISK_K       11
  86. #define DISK_L       12
  87. #define DISK_M       13
  88. #define DISK_N       14
  89. #define DISK_O       15
  90. #define DISK_P       16
  91. #define DISK_Q       17
  92. #define DISK_R       18
  93. #define DISK_S       19
  94. #define DISK_T       20
  95. #define DISK_U       21
  96. #define DISK_V       22
  97. #define DISK_W       23
  98. #define DISK_X       24
  99. #define DISK_Y       25
  100. #define DISK_Z       26
  101.  
  102. // Constants returned by FCREATE(), 
  103. // FOPEN(), FPUTS(), FSEEK(), FWRITE()
  104. #define FERROR_ERROR -1
  105.  
  106. // Constants for FPUTS()
  107. #define FERROR_UNSUCCESSFUL 0
  108.  
  109. // Constants returned by FERROR()
  110. #define FERROR_FILENOTFOUND      2
  111. #define FERROR_BADPATH           3
  112. #define FERROR_NOFILEHANDLES     4
  113. #define FERROR_CANNOTACCESS      5
  114. #define FERROR_BADFILEHANDLE     6
  115. #define FERROR_DIRECTORYFULL     8
  116. #define FERROR_BADFILEPOINTER    9
  117. #define FERROR_DISKFULL         13
  118. #define FERROR_ENDOFFILE        14
  119.  
  120. // Constants for FKLABEL()
  121. #define FK_F1    0
  122. #define FK_F2    1
  123. #define FK_F3    2
  124. #define FK_F4    3
  125. #define FK_F5    4
  126. #define FK_F6    5
  127. #define FK_F7    6
  128. #define FK_F8    7
  129. #define FK_F9    8
  130. #define FK_F10   9
  131. #define FK_CTRL  10        // Used in combination with FK_F1, FK_F2, ...
  132. #define FK_SHIFT 20        // Used in combination with FK_F1, FK_F2, ...
  133.  
  134. // Constants for FSEEK()
  135. #define FILE_BEGIN   0
  136. #define FILE_CURRENT 1
  137. #define FILE_END     2
  138.  
  139. // Constants for LKSYS()
  140. #define LOCK_BUFFER_TIME   0
  141. #define LOCK_BUFFER_DATE   1
  142. #define LOCK_BUFFER_USER   2
  143. #define LOCK_LAST_TIME     3
  144. #define LOCK_LAST_DATE     4
  145. #define LOCK_LAST_USER     5
  146.  
  147. // Constants for MSGBOX()
  148. #define OK_BUTTON                   0
  149. #define OK_CANCEL_BUTTONS           1
  150. #define ABORT_RETRY_IGNORE_BUTTONS  2
  151. #define YES_NO_CANCEL_BUTTONS       3
  152. #define YES_NO_BUTTONS              4
  153. #define RETRY_CANCEL_BUTTONS        5
  154.  
  155. #define PLAIN_MESSAGE               0  // ok/cancel
  156. #define WARNING_MESSAGE            16
  157. #define CONFIRMATION_MESSAGE       32
  158. #define ALERT_MESSAGE              48
  159. #define INFORMATION_MESSAGE        64
  160.  
  161. #define BUTTON_OK     1
  162. #define BUTTON_CANCEL 2
  163. #define BUTTON_ABORT  3
  164. #define BUTTON_RETRY  4
  165. #define BUTTON_IGNORE 5
  166. #define BUTTON_YES    6
  167. #define BUTTON_NO     7
  168. //
  169. //  The following appeared in messdlg.h in prior versions of
  170. //  Visual dBASE. The simple button names conflict with Visual
  171. //  dBASE commands, so they have been replaced with the button
  172. //  constants above. You can uncomment these if existing applications
  173. //  need them and they will not conflict in your application.
  174. //
  175. //#define OK                         1
  176. //#define CANCEL                     2
  177. //#define ABORT                      3
  178. //#define RETRY                      4
  179. //#define IGNORE                     5
  180. //#define YES                        6
  181. //#define NO                         7
  182.  
  183. //  Shortcut macros for common message boxes (from old messdlg.h)
  184. //  m is message, t is title
  185. #define PlainMessage(m,t)           msgBox(m,t,PLAIN_MESSAGE + OK_BUTTON)
  186. #define WarningMessage(m,t)         msgBox(m,t,WARNING_MESSAGE + OK_CANCEL_BUTTONS)
  187. #define ConfirmationMessage(m,t)    msgBox(m,t,CONFIRMATION_MESSAGE + YES_NO_BUTTONS)
  188. #define ConfirmOrCancelMessage(m,t) msgBox(m,t,CONFIRMATION_MESSAGE + YES_NO_CANCEL_BUTTONS)
  189. #define AlertMessage(m,t)           msgBox(m,t,ALERT_MESSAGE + OK_BUTTON)
  190. #define InformationMessage(m,t)     msgBox(m,t,INFORMATION_MESSAGE + OK_BUTTON)
  191.  
  192. // Constants for OS()
  193. #define OS_SYSTEM
  194. #define OS_WINDOWS 1
  195.  
  196. // Constants for PROGRAM()
  197. #define PROGRAM_NOPATH
  198. #define PROGRAM_WITHPATH 1
  199.  
  200. // Constants for RUN()
  201. #define RUN_WINDOWS .T.
  202. #define RUN_DOS     .F.
  203.  
  204. // Constants for SHELL()
  205. #define SHELL_HIDE    .F.
  206. #define SHELL_RESTORE .T.
  207. #define SHELL_DISABLE .F.,.T.
  208.  
  209. //
  210. //  Constants for the enumerated properties of stock objects
  211. //
  212.  
  213. // Image Class Alignment property values
  214. #define I_ALIGNMENT_STRETCH         0
  215. #define I_ALIGNMENT_TOP_LEFT        1
  216. #define I_ALIGNMENT_CENTER          2
  217. #define I_ALIGNMENT_ASPECT_STRETCH  3
  218.  
  219. // Text Class Alignment property values
  220. #define ALIGNMENT_TOP_LEFT      0
  221. #define ALIGNMENT_TOP_CENTER    1
  222. #define ALIGNMENT_TOP_RIGHT     2
  223. #define ALIGNMENT_CENTER_LEFT   3
  224. #define ALIGNMENT_CENTER        4
  225. #define ALIGNMENT_CENTER_RIGHT  5
  226. #define ALIGNMENT_BOTTOM_LEFT   6
  227. #define ALIGNMENT_BOTTOM_CENTER 7
  228. #define ALIGNMENT_BOTTOM_RIGHT  8
  229. #define ALIGNMENT_WRAP_LEFT     9
  230. #define ALIGNMENT_WRAP_CENTER   10
  231. #define ALIGNMENT_WRAP_RIGHT    11
  232.  
  233. // Tabbox Class Anchor property values
  234. #define ANCHOR_BOTTOM 1
  235.  
  236. // Rectangle Class BorderStyle property values
  237. #define BORDERSTYLE_NORMAL      0
  238. #define BORDERSTYLE_RAISED      1
  239. #define BORDERSTYLE_LOWERED     2
  240.  
  241. // Browse Class Mode property values
  242. #define MODE_BROWSE             0
  243. #define MODE_FORM_EDIT          1
  244. #define MODE_COLUMNAR_EDIT      2
  245.  
  246. // Different control classes MousePointer property values
  247. #define MOUSE_POINTER_DEFAULT   0
  248. #define MOUSE_POINTER_ARROW     1
  249. #define MOUSE_POINTER_CROSS     2
  250. #define MOUSE_POINTER_IBEAM     3
  251. #define MOUSE_POINTER_ICON      4
  252. #define MOUSE_POINTER_SIZE      5
  253. #define MOUSE_POINTER_SIZE_NECW 6    && Error from prior version
  254. #define MOUSE_POINTER_SIZE_NESW 6
  255. #define MOUSE_POINTER_SIZE_S    7
  256. #define MOUSE_POINTER_SIZE_NWSE 8
  257. #define MOUSE_POINTER_SIZE_E    9
  258. #define MOUSE_POINTER_UP_ARROW  10
  259. #define MOUSE_POINTER_WAIT      11
  260.  
  261. // Rectangle Class Patternstyle property values
  262. #define PATTERNSTYLE_SOLID      0
  263. #define PATTERNSTYLE_BDIAGONAL  1
  264. #define PATTERNSTYLE_CROSS      2
  265. #define PATTERNSTYLE_DIAGCROSS  3
  266. #define PATTERNSTYLE_FDIAGONAL  4
  267. #define PATTERNSTYLE_HORIZONTAL 5
  268. #define PATTERNSTYLE_VERTICAL   6
  269.  
  270. // Line Class Pen property values
  271. // Shape Class PenStyle property values
  272. #define PEN_SOLID               0
  273. #define PEN_DASH                1
  274. #define PEN_DOT                 2
  275. #define PEN_DASH_DOT            3
  276. #define PEN_DASH_DOT_DOT        4
  277.  
  278.  
  279. // Form/Editor class Scrollbar property values
  280. #define SCROLLBAR_OFF           0
  281. #define SCROLLBAR_ON            1
  282. #define SCROLLBAR_AUTO          2
  283. #define SCROLLBAR_DISABLED      3
  284.  
  285. // Shape Class ShapeStyle property values
  286. #define SHAPE_ROUND_RECTANGLE   0
  287. #define SHAPE_RECTANGLE         1
  288. #define SHAPE_ELLIPSE           2
  289. #define SHAPE_CIRCLE            3
  290. #define SHAPE_ROUND_SQUARE      4
  291. #define SHAPE_SQUARE            5
  292.  
  293. // Combobox class Style property values
  294. #define STYLE_SIMPLE            0
  295. #define STYLE_DROPDOWN          1
  296. #define STYLE_DROPDOWN_LIST     2
  297.  
  298. // Form class WindowState property values
  299. #define WINDOWSTATE_NORMAL      0
  300. #define WINDOWSTATE_MINIMIZED   1
  301. #define WINDOWSTATE_MAXIMIZED   2
  302.  
  303. //
  304. //   Constants and Macros for the stock object events
  305. //
  306.  
  307. // NType parameter setting for the OnSize event handler of forms
  308. #define SIZE_RESTORED   0
  309. #define SIZE_MINIMIZED  1
  310. #define SIZE_MAXIMIZED  2
  311. #define SIZE_MAX_OTHER  3
  312. #define SIZE_MIN_OTHER  4
  313. #define SIZE_MAXSHOW    SIZE_MAX_OTHER
  314. #define SIZE_MAXHIDE    SIZE_MIN_OTHER
  315.  
  316. // Mouse and keyboard event flags, these macros evaluate to a logical type
  317. #define FLAG_LEFT_MOUSE(f)      (BITSET(f,0))
  318. #define FLAG_RIGHT_MOUSE(f)     (BITSET(f,1))
  319. #define FLAG_SHIFT(f)           (BITSET(f,2))
  320. #define FLAG_CTRL(f)            (BITSET(f,3))
  321. #define FLAG_MIDDLE_MOUSE(f)    (BITSET(f,4))
  322.  
  323. #endif
  324.