home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / WIN / Programa / VPE16_14.ZIP / SQLWIN / VPEDEMO.APT < prev    next >
Encoding:
Team Developer / SQLWindows application  |  1996-06-08  |  98.2 KB  |  2,478 lines

  1. .head 0 +  Application Description: VPE Demo for SQLWindows 5.0 (VPEDEMO.APP)
  2.  
  3. Program code by Software Development Exceleration Unlimited
  4.                                    and IDEAL Software
  5. Copyright ⌐ 1996 IDEAL Software - All rights reserved.
  6. .head 1 -  Outline Version - 4.0.26
  7. .head 1 +  Design-time Settings
  8. .head 2 -  Outline Window State: Maximized
  9. .head 2 +  Outline Window Location and Size
  10. .data VIEWINFO
  11. 0000: 6600010002001B00 0000000000000000 00001027F5140500 1D00FFFF4D61696E
  12. 0020: 00
  13. .enddata
  14. .data VIEWSIZE
  15. 0000: 2100
  16. .enddata
  17. .head 3 -  Left:   -0.013"
  18. .head 3 -  Top:    0.0"
  19. .head 3 -  Width:  8.013"
  20. .head 3 -  Height: 4.969"
  21. .head 2 +  Options Box Location
  22. .data VIEWINFO
  23. 0000: D4180909B80B1A00
  24. .enddata
  25. .data VIEWSIZE
  26. 0000: 0800
  27. .enddata
  28. .head 3 -  Visible? No
  29. .head 3 -  Left:   4.15"
  30. .head 3 -  Top:    1.885"
  31. .head 3 -  Width:  3.8"
  32. .head 3 -  Height: 2.073"
  33. .head 2 +  Class Editor Location
  34. .head 3 -  Visible? No
  35. .head 3 -  Left:   0.575"
  36. .head 3 -  Top:    0.094"
  37. .head 3 -  Width:  5.063"
  38. .head 3 -  Height: 2.719"
  39. .head 2 +  Tool Palette Location
  40. .head 3 -  Visible? No
  41. .head 3 -  Left:   6.4"
  42. .head 3 -  Top:    0.729"
  43. .head 2 -  Fully Qualified External References? No
  44. .head 2 -  Reject Multiple Window Instances? Yes
  45. .head 2 -  Enable Runtime Checks Of External References? Yes
  46. .head 2 -  Use Release 4.0 Scope Rules? No
  47. .head 1 +  Libraries
  48. .head 2 -  ! Include VPENGINE.APL for the VPE interface
  49. .head 2 -  File Include: VPENGINE.APL
  50. .head 2 -  ! -----------------------------------------------------------------------------
  51. .head 2 -  ! CSTRUCT.APL (provided by Gupta with SQLWindows) 
  52. is needed for the CStructPutInt function used by VpePolyLine.
  53. This file is automatically included by VPENGINE.APL
  54. .head 2 -  File Include: CSTRUCT.APL
  55. .head 1 +  Global Declarations
  56. .head 2 +  Window Defaults
  57. .head 3 +  Tool Bar
  58. .head 4 -  Display Style? Etched
  59. .head 4 -  Font Name: System Default
  60. .head 4 -  Font Size: System Default
  61. .head 4 -  Font Enhancement: System Default
  62. .head 4 -  Text Color: System Default
  63. .head 4 -  Background Color: System Default
  64. .head 3 +  Form Window
  65. .head 4 -  Display Style? Etched
  66. .head 4 -  Font Name: System Default
  67. .head 4 -  Font Size: System Default
  68. .head 4 -  Font Enhancement: System Default
  69. .head 4 -  Text Color: System Default
  70. .head 4 -  Background Color: System Default
  71. .head 3 +  Dialog Box
  72. .head 4 -  Display Style? Etched
  73. .head 4 -  Font Name: System Default
  74. .head 4 -  Font Size: System Default
  75. .head 4 -  Font Enhancement: System Default
  76. .head 4 -  Text Color: System Default
  77. .head 4 -  Background Color: System Default
  78. .head 3 +  Top Level Table Window
  79. .head 4 -  Font Name: System Default
  80. .head 4 -  Font Size: System Default
  81. .head 4 -  Font Enhancement: System Default
  82. .head 4 -  Text Color: System Default
  83. .head 4 -  Background Color: System Default
  84. .head 3 +  Data Field
  85. .head 4 -  Font Name: Use Parent
  86. .head 4 -  Font Size: Use Parent
  87. .head 4 -  Font Enhancement: Use Parent
  88. .head 4 -  Text Color: Use Parent
  89. .head 4 -  Background Color: Use Parent
  90. .head 3 +  Multiline Field
  91. .head 4 -  Font Name: Use Parent
  92. .head 4 -  Font Size: Use Parent
  93. .head 4 -  Font Enhancement: Use Parent
  94. .head 4 -  Text Color: Use Parent
  95. .head 4 -  Background Color: Use Parent
  96. .head 3 +  Spin Field
  97. .head 4 -  Font Name: Use Parent
  98. .head 4 -  Font Size: Use Parent
  99. .head 4 -  Font Enhancement: Use Parent
  100. .head 4 -  Text Color: Use Parent
  101. .head 4 -  Background Color: Use Parent
  102. .head 3 +  Background Text
  103. .head 4 -  Font Name: Use Parent
  104. .head 4 -  Font Size: Use Parent
  105. .head 4 -  Font Enhancement: Use Parent
  106. .head 4 -  Text Color: Use Parent
  107. .head 4 -  Background Color: Use Parent
  108. .head 3 +  Pushbutton
  109. .head 4 -  Font Name: Use Parent
  110. .head 4 -  Font Size: Use Parent
  111. .head 4 -  Font Enhancement: Use Parent
  112. .head 3 +  Radio Button
  113. .head 4 -  Font Name: Use Parent
  114. .head 4 -  Font Size: Use Parent
  115. .head 4 -  Font Enhancement: Use Parent
  116. .head 4 -  Text Color: Use Parent
  117. .head 4 -  Background Color: Use Parent
  118. .head 3 +  Check Box
  119. .head 4 -  Font Name: Use Parent
  120. .head 4 -  Font Size: Use Parent
  121. .head 4 -  Font Enhancement: Use Parent
  122. .head 4 -  Text Color: Use Parent
  123. .head 4 -  Background Color: Use Parent
  124. .head 3 +  Option Button
  125. .head 4 -  Font Name: Use Parent
  126. .head 4 -  Font Size: Use Parent
  127. .head 4 -  Font Enhancement: Use Parent
  128. .head 3 +  Group Box
  129. .head 4 -  Font Name: Use Parent
  130. .head 4 -  Font Size: Use Parent
  131. .head 4 -  Font Enhancement: Use Parent
  132. .head 4 -  Text Color: Use Parent
  133. .head 4 -  Background Color: Use Parent
  134. .head 3 +  Child Table Window
  135. .head 4 -  Font Name: Use Parent
  136. .head 4 -  Font Size: Use Parent
  137. .head 4 -  Font Enhancement: Use Parent
  138. .head 4 -  Text Color: Use Parent
  139. .head 4 -  Background Color: Use Parent
  140. .head 3 +  List Box
  141. .head 4 -  Font Name: Use Parent
  142. .head 4 -  Font Size: Use Parent
  143. .head 4 -  Font Enhancement: Use Parent
  144. .head 4 -  Text Color: Use Parent
  145. .head 4 -  Background Color: Use Parent
  146. .head 3 +  Combo Box
  147. .head 4 -  Font Name: Use Parent
  148. .head 4 -  Font Size: Use Parent
  149. .head 4 -  Font Enhancement: Use Parent
  150. .head 4 -  Text Color: Use Parent
  151. .head 4 -  Background Color: Use Parent
  152. .head 3 +  Line
  153. .head 4 -  Line Color: Use Parent
  154. .head 3 +  Frame
  155. .head 4 -  Border Color: Use Parent
  156. .head 4 -  Background Color: Use Parent
  157. .head 3 +  Picture
  158. .head 4 -  Border Color: Use Parent
  159. .head 4 -  Background Color: Use Parent
  160. .head 2 +  Formats
  161. .head 3 -  Number: 0'%'
  162. .head 3 -  Number: #0
  163. .head 3 -  Number: ###000
  164. .head 3 -  Number: ###000;'($'###000')'
  165. .head 3 -  Date/Time: hh:mm:ss AMPM
  166. .head 3 -  Date/Time: M/d/yy
  167. .head 3 -  Date/Time: MM-dd-yy
  168. .head 3 -  Date/Time: dd-MMM-yyyy
  169. .head 3 -  Date/Time: MMM d, yyyy
  170. .head 3 -  Date/Time: MMM d, yyyy hh:mm AMPM
  171. .head 3 -  Date/Time: MMMM d, yyyy hh:mm AMPM
  172. .head 2 +  External Functions
  173. .head 3 +  Library name: USER.EXE
  174. .head 4 +  Function: MoveWindow
  175. .head 5 -  Description:
  176. .head 5 -  Export Ordinal: 0
  177. .head 5 +  Returns
  178. .head 6 -  Boolean: BOOL
  179. .head 5 +  Parameters
  180. .head 6 -  Window Handle: HWND
  181. .head 6 -  Number: INT
  182. .head 6 -  Number: INT
  183. .head 6 -  Number: INT
  184. .head 6 -  Number: INT
  185. .head 6 -  Boolean: BOOL
  186. .head 2 +  Constants
  187. .data CCDATA
  188. 0000: 3000000000000000 0000000000000000 00000000
  189. .enddata
  190. .data CCSIZE
  191. 0000: 1400
  192. .enddata
  193. .head 3 +  System
  194. .head 4 -  Number: WM_SIZE = 0x0005
  195. .head 4 -  Number: WM_KEYDOWN = 0x0100
  196. .head 4 -  Number: WM_COMMAND = 0x0111
  197. .head 3 +  User
  198. .head 4 -  String: DEMO_TEXT = "The moment of impact bursts through the silence and in a roar of sound, the " ||
  199. "final second is prolonged in a world of echoes as if the concrete and clay of " ||
  200. "Broadway itself was reliving its memories.
  201. " || "The last great march past. Newsman stands limp as a whimper as audience and " ||
  202. "event are locked as one. Bing Crosby coos 'You don't have to feel pain " ||
  203. "to sing the blues, you don't have to holla - you don't feel a thing in your " ||
  204. "dollar collar.' Martin Luther cries 'Everbody Sing!' and rings the grand old " ||
  205. "liberty bell. Leary, weary of his prison cell, walks on heaven, talks on hell.
  206. " || "Who needs Medicare and the 35c flat rate fare, when Fred Astaire and " ||
  207. "Ginger Rogers are dancing through the air? From Broadway Melody stereotypes " ||
  208. "the band returns to 'Stars and Stripes' bringing a tear to the moonshiner, " ||
  209. "who's been pouring out his spirit from the illegal still. The pawn broker " ||
  210. "clears the noisy till and clutches his lucky dollar bill.
  211. " || "Then the blackout.
  212.  
  213. " || "[Genesis, 'The Lamb lies down on Broadway']"
  214. .head 4 -  Number: HEADLINE = 1 ! ordinal for storing a setting
  215. .head 4 -  String: RPT_PATH = 'journal.rpt'
  216. .head 2 -  Resources
  217. .head 2 +  Variables
  218. .head 3 -  Window Handle: ghWndMain
  219. .head 3 -  Sql Handle: ghSql
  220. .head 3 -  Number: gnPrecision
  221. .head 3 -  Number: gnPBackGnd
  222. .head 3 -  Number: gnGraph
  223. .head 3 -  Number: gnSpeed
  224. .head 3 -  Number: gnColors
  225. .head 3 -  Number: gnReport
  226. .head 3 -  Number: gnAutoRender
  227. .head 3 -  !
  228. .head 3 -  Number: gnSumAmount
  229. .head 3 -  Number: gnSumProratedAmt
  230. .head 3 -  Number: gnSumTaxAmt
  231. .head 3 -  Boolean: gbTableCreated
  232. .head 2 +  Internal Functions
  233. .head 3 +  Function: page1
  234. .head 4 -  Description: Page 1 of Precision demo
  235. .head 4 -  Returns
  236. .head 4 +  Parameters
  237. .head 5 -  Number: hDoc
  238. .head 4 -  Static Variables
  239. .head 4 +  Local variables
  240. .head 5 -  Number: nY
  241. .head 4 +  Actions
  242. .head 5 -  Set nY = VpeWriteBox( hDoc, 575, 200, 1625, -1, 
  243. "[Center PenSize 3]This demo shows the capabilities and precision of VPE.
  244. Print this page and compare not only the positions of the frames, but the positions of each letter that can be seen.
  245. (Switch the grid on.)
  246. This is true WYSIWYG!!!
  247. ('What you see is what you get')
  248. Note that the nearest result can be seen at a scaling of 1:1.
  249. With every other scaling you get 'best results' in comparison to execution speed." )
  250. .head 5 -  Set nY = VpeWriteBox( hDoc, 100, nY + 75, 2000, -1, 
  251. "['Arial' FontSize 14 Left Bold Italic Underline PenSize 0]RIGHT ALIGNED, 0.25 cm blue frame, light-blue backgr., red bold text, Arial 9 pt" )
  252. .head 5 -  Call VpeStoreSet( hDoc, HEADLINE )
  253. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 9 )
  254. .head 5 -  Call VpeSetPen( hDoc, 25, _VPE_PS_SOLID, COLOR_Blue )
  255. .head 5 -  Call VpeSetTextColor( hDoc, COLOR_Red )
  256. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_RIGHT, 1, 0, 0 )
  257. .head 5 -  Call VpeSetTransparentMode( hDoc, 0 )
  258. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  259. .head 5 -  ! nY + 30 because frame = 0.25 cm --> frame drawn around center of coordinates
  260. .head 5 -  ! we also want a little gap between the headline and the frame
  261. .head 5 -  Set nY = VpeWriteBox( hDoc, 150, nY + 30, 1850, -1, DEMO_TEXT )
  262. .head 5 -  Call VpeSetTransparentMode( hDoc, 1 )
  263. .head 5 -  Call VpeUseSet( hDoc, HEADLINE )
  264. .head 5 -  Set nY = VpeWrite( hDoc, 250, nY + 75, 2000, -1, "JUSTIFIED, no frame, Times New Roman 11pt" )
  265. .head 5 -  Call VpeSelectFont( hDoc, 'Times New Roman', 11 )
  266. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_JUSTIFIED, 0, 0 , 0 )
  267. .head 5 -  Set nY = VpeWriteBox( hDoc, 250, nY + 20, 1550, -1, DEMO_TEXT )
  268. .head 5 -  Call VpeUseSet( hDoc, HEADLINE )
  269. .head 5 -  Set nY = VpeWriteBox( hDoc, 250, nY + 75, 2000, -1, "CENTERED, thin yellow frame, Times New Roman 11pt" )
  270. .head 5 -  Call VpeSelectFont( hDoc, 'Times New Roman', 11 )
  271. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 0, 0, 0 )
  272. .head 5 -  Call VpeSetPen( hDoc, 5, _VPE_PS_SOLID, COLOR_Yellow )
  273. .head 5 -  Set nY = VpeWriteBox( hDoc, 150, nY + 20, 1850, -1, DEMO_TEXT )
  274. .head 3 +  Function: page2
  275. .head 4 -  Description:
  276. .head 4 -  Returns
  277. .head 4 +  Parameters
  278. .head 5 -  Number: hDoc
  279. .head 4 -  Static Variables
  280. .head 4 +  Local variables
  281. .head 5 -  Number: nY
  282. .head 5 -  Number: nXR
  283. .head 5 -  Number: nXStep
  284. .head 5 -  Number: nYR
  285. .head 5 -  Number: nX
  286. .head 5 -  String: s
  287. .head 5 -  Number: nIndex
  288. .head 5 -  Number: nSkip
  289. .head 5 -  Number: nFirst
  290. .head 5 -  Number: nXX
  291. .head 5 -  Number: nOldY
  292. .head 5 -  Number: nSegments
  293. .head 5 -  : p[*]
  294. .head 6 -  Class: POINT
  295. .head 5 -  : points[*]
  296. .head 6 -  Class: POINT
  297. .head 5 -  Number: hP
  298. .head 5 -  Boolean: bContinue
  299. .head 4 +  Actions
  300. .head 5 -  ! Call VpePageBreak( hDoc ) ! only needed if page2 is put back into Precision(  )
  301. .head 5 -  Call VpeUseSet( hDoc, HEADLINE )
  302. .head 5 -  Set nY = VpeWriteBox( hDoc, 200, 200, 2000, -1, "An example of drawing (better to turn the grid off here):" )
  303. .head 5 -  Call VpeSetPen( hDoc, 8, _VPE_PS_SOLID, COLOR_Black )
  304. .head 5 -  Call VpeBox( hDoc, 200, 300, 1700, 1800 )
  305. .head 5 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  306. .head 5 -  Set nXR = 6
  307. .head 5 -  Set nXStep = nXR / 750
  308. .head 5 -  Set nYR = 18
  309. .head 5 -  Set nX = -nXR
  310. .head 5 -  Set nSkip = 0
  311. .head 5 -  Call VpeSetPen( hDoc, 2, _VPE_PS_SOLID, COLOR_Blue )
  312. .head 5 -  Set hP = VpePolyLineInit( hDoc, 1500 )
  313. .head 5 -  Set nXX = 200
  314. .head 5 +  While nXX < 1700
  315. .head 6 -  Set nY = 1050 - ( ( SalNumberPower( nX, 3 ) - 2 * SalNumberPower( nX, 2 ) - 8 * nX ) / ( nYR / 750 ) )
  316. .head 6 -  Set nX = nX + nXStep
  317. .head 6 -  Set bContinue = FALSE
  318. .head 6 +  If nY < 300
  319. .head 7 -  Set nY = 300
  320. .head 7 -  Set nSkip = 1
  321. .head 7 -  Set bContinue = TRUE
  322. .head 6 +  Else If nY > 1800
  323. .head 7 -  Set nY = 1800
  324. .head 7 -  Set nSkip = 1
  325. .head 7 -  Set bContinue = TRUE
  326. .head 6 +  If NOT bContinue
  327. .head 7 +  If nSkip = 1
  328. .head 8 -  Call VpeAddPolyPoint( hDoc, hP, -1, -1 )
  329. .head 8 -  Set nOldY = nY
  330. .head 8 -  Set nSkip = 2
  331. .head 7 +  Else
  332. .head 8 +  If nSkip = 2
  333. .head 9 -  Call VpeAddPolyPoint( hDoc, hP, nXX - 1, nOldY )
  334. .head 9 -  Set nSkip = 0
  335. .head 8 -  Call VpeAddPolyPoint( hDoc, hP, nXX, nY )
  336. .head 8 -  Set nSegments = nSegments + 1
  337. .head 6 -  Set nXX = nXX + 1
  338. .head 5 -  ! The following graph is created directly with VpePolyLine(  )
  339. .head 5 -  Set nX = -nXR
  340. .head 5 -  Set nFirst = 1
  341. .head 5 -  Call VpeSetPen( hDoc, 2, _VPE_PS_SOLID, COLOR_Red )
  342. .head 5 -  Set nIndex = 0
  343. .head 5 -  Set nXX = 200
  344. .head 5 +  While nXX < 1700
  345. .head 6 -  Set nY = 1050 - ( 3 * SalNumberPower( nX, 2 ) - 4 * nX - 8 ) / ( nYR / 750 )
  346. .head 6 -  Set nX = nX + nXStep
  347. .head 6 -  Set bContinue = FALSE
  348. .head 6 +  If nY < 300
  349. .head 7 -  Set nY = 300
  350. .head 7 -  Set nSkip = 1
  351. .head 7 -  Set bContinue = TRUE
  352. .head 6 +  Else If nY > 1800
  353. .head 7 -  Set nY = 1800
  354. .head 7 -  Set nSkip = 1
  355. .head 7 -  Set bContinue = TRUE
  356. .head 6 +  If NOT bContinue
  357. .head 7 +  If nSkip = 1
  358. .head 8 +  If nIndex > 0 ! Array must not begin with -1,-1 pair
  359. .head 9 -  Set points[nIndex].nX = -1
  360. .head 9 -  Set points[nIndex].nY = -1
  361. .head 8 -  ! don't increment index here, so we don't have multiple
  362. .head 8 -  ! (redundant and FORBIDDEN) -1,-1 pairs in the array
  363. .head 8 -  Set nOldY = nY
  364. .head 8 -  Set nSkip = 2
  365. .head 7 +  Else
  366. .head 8 +  If nSkip = 2
  367. .head 9 +  If nIndex > 0
  368. .head 10 -  Set nIndex = nIndex + 1
  369. .head 9 -  Set points[nIndex].nX = nXX - 1
  370. .head 9 -  Set points[nIndex].nY = nOldY
  371. .head 9 -  Set nIndex = nIndex + 1
  372. .head 9 -  Set nSkip = 0
  373. .head 8 -  Set points[nIndex].nX = nXX
  374. .head 8 -  Set points[nIndex].nY = nY
  375. .head 8 -  Set nIndex = nIndex + 1
  376. .head 8 -  Set nSegments = nSegments + 1
  377. .head 6 -  Set nXX = nXX + 1
  378. .head 5 -  Call VpePolyLine( hDoc, points, nIndex )
  379. .head 5 -  ! The following graph is created 'manually' VpeLine(  )
  380. .head 5 -  ! Never use it for such tasks, it's slow and memory exhausting
  381. .head 5 -  ! in comparison to VpePolyLine
  382. .head 5 -  Set nX = -nXR
  383. .head 5 -  Set nFirst = 1
  384. .head 5 -  Call VpeSetPen( hDoc, 2, _VPE_PS_SOLID, COLOR_Green )
  385. .head 5 -  Set nXX = 200
  386. .head 5 +  While nXX < 1700
  387. .head 6 -  Set nY = 1050 - ( 3 * nX - 4 ) / ( nYR / 750 )
  388. .head 6 -  Set nX = nX + nXStep
  389. .head 6 -  Set bContinue = FALSE
  390. .head 6 +  If nY < 300
  391. .head 7 -  Set nY = 300
  392. .head 7 -  Set nFirst = 1
  393. .head 7 -  Set bContinue = TRUE
  394. .head 6 +  Else If nY > 1800
  395. .head 7 -  Set nY = 1800
  396. .head 7 -  Set nFirst = 1
  397. .head 7 -  Set bContinue = TRUE
  398. .head 6 +  If NOT bContinue
  399. .head 7 +  If nFirst
  400. .head 8 -  Set nOldY = nY
  401. .head 7 +  Else
  402. .head 8 -  Call VpeLine( hDoc, nXX - 1, nOldY, nXX, nY )
  403. .head 8 -  Set nSegments = nSegments + 1
  404. .head 8 -  Set nOldY = nY
  405. .head 7 -  Set nFirst = 0
  406. .head 6 -  Set nXX = nXX + 1
  407. .head 5 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  408. .head 5 -  Call VpeLine( hDoc, 200, 1050, 1700, 1050 )
  409. .head 5 -  Call VpeLine( hDoc, 950, 300, 950, 1800 )
  410. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 10 )
  411. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  412. .head 5 -  Call VpeSetPen( hDoc, 1, _VPE_PS_DOT, COLOR_Black )
  413. .head 5 -  Set nXX = 1
  414. .head 5 +  While nXX < nXR
  415. .head 6 -  Call VpeLine( hDoc, 950 + nXX * 750 / 6, 300, 950 + nXX * 750 / 6, 1800 )
  416. .head 6 -  Set s = SalNumberToStrX( nXX, 0 )
  417. .head 6 -  Call VpePrint( hDoc, 950 + nXX * 750 / 6, 1050, s )
  418. .head 6 -  Call VpeLine( hDoc, 950 - nXX * 750 / 6, 300, 950 - nXX * 750 / 6, 1800 )
  419. .head 6 -  Set s = SalNumberToStrX( -nXX, 0 )
  420. .head 6 -  Call VpePrint( hDoc, 950 - nXX * 750 / 6, 1050, s )
  421. .head 6 -  Set nXX = nXX + 1
  422. .head 5 -  Set nY = 2
  423. .head 5 +  While nY < nYR
  424. .head 6 -  Call VpeLine( hDoc, 200, 1050 + nY * 750 / nYR, 1700, 1050 + nY * 750 / nYR )
  425. .head 6 -  Set s = SalNumberToStrX( nY, 0 )
  426. .head 6 -  Call VpePrint( hDoc, 950, 1050 - nY * 750 / nYR, s )
  427. .head 6 -  Call VpeLine( hDoc, 200, 1050 - nY * 750 / nYR, 1700, 1050 - nY * 750 / nYR )
  428. .head 6 -  Set s = SalNumberToStrX( -nY, 0 )
  429. .head 6 -  Call VpePrint( hDoc, 950, 1050 + nY * 750 / nYR, s )
  430. .head 6 -  Set nY = nY + 2
  431. .head 5 -  Set nY = 1850
  432. .head 5 -  Set s = "[S 14]The three graphs together consist of " || SalNumberToStrX( nSegments, 0 ) || " (number determined during runtime) single lines!
  433.  
  434. VPE manages this data bulk fast for you FAST!"
  435. .head 5 -  Call VpeWrite( hDoc, 200, nY, 2000, -1, s )
  436. .head 3 +  Function: page3_4
  437. .head 4 -  Description:
  438. .head 4 -  Returns
  439. .head 4 +  Parameters
  440. .head 5 -  Number: hDoc
  441. .head 4 -  Static Variables
  442. .head 4 +  Local variables
  443. .head 5 -  Number: y
  444. .head 4 +  Actions
  445. .head 5 -  Call VpePageBreak( hDoc )
  446. .head 5 -  Call VpeNoPen( hDoc )
  447. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 0, 1, 0 )
  448. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 18 )
  449. .head 5 -  Call VpeWrite( hDoc, 0, 150, 2100, 300, 'The supported barcode-types:' )
  450. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 10 )
  451. .head 5 -  Call VpeSetBold( hDoc, 1 )
  452. .head 5 -  Call VpeWrite( hDoc, 200, 300, 550, 400, "2 of 5:" )
  453. .head 5 -  Call VpeBarcode( hDoc, 200, 360, 550, 560, BCT_2OF5, "123789", "" )
  454. .head 5 -  Call VpeWrite( hDoc, 700, 300, 1200, 400, "Interleaved 2 of 5:" )
  455. .head 5 -  Call VpeBarcode( hDoc, 700, 360, 1200, 560, BCT_INTERLEAVED2OF5, "123895783482", '' )
  456. .head 5 -  Call VpeWrite( hDoc, 1350, 300, 1750, 400, "Code 39 (text on top)" )
  457. .head 5 -  Call VpeSetBarcodeParms( hDoc, 1, 0 )
  458. .head 5 -  Call VpeBarcode( hDoc, 1350, 360, 1750, 560, BCT_CODE39, "ABC123", "" )
  459. .head 5 -  Call VpeWrite( hDoc, 200, 700, 550, 800, "Code 93 (rotated):" )
  460. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 0 )
  461. .head 5 -  Call VpeSetRotation( hDoc, 900 )
  462. .head 5 -  Call VpeBarcode( hDoc, 275, 760, -300, -200, BCT_CODE93, "DEF987", "")
  463. .head 5 -  Call VpeWrite( hDoc, 700, 700, 1200, 800, "[Rot 0]Codabar (rotated):" )
  464. .head 5 -  Call VpeSetRotation( hDoc, 1800 )
  465. .head 5 -  Call VpeBarcode( hDoc, 700, 760, -500, -200, BCT_CODABAR, "123456", "" )
  466. .head 5 -  Call VpeWrite( hDoc, 1400, 700, 1700, 800, "[Rot 0]EAN-8 (rotated):" )
  467. .head 5 -  Call VpeSetRotation( hDoc, 2700 )
  468. .head 5 -  Call VpeBarcode( hDoc, 1450, 760, -300, -200, BCT_EAN8, "40167794", "" )
  469. .head 5 -  Call VpeWrite( hDoc, 200, 1200, 500, 1400, '[Rot 0]EAN-8 + 2:' )
  470. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 1 )
  471. .head 5 -  Call VpeBarcode( hDoc, 200, 1260, 500, 1460, BCT_EAN8_2, '12345670', '12' )
  472. .head 5 -  Call VpeWrite( hDoc, 700, 1200, 1200, 1400, "EAN-8 + 5:" )
  473. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 0 )
  474. .head 5 -  Call VpeBarcode( hDoc, 700, 1260, 1200, 1460, BCT_EAN8_5, '98765430', '12345' )
  475. .head 5 -  Call VpeWrite( hDoc, 1350, 1200, 1750, 1400, "EAN-13:" )
  476. .head 5 -  Call VpeBarcode( hDoc, 1350, 1260, 1750, 1460, BCT_EAN13, '9781556153952', '' )
  477. .head 5 -  Call VpeWrite( hDoc, 200, 1600, 600, 1800, "EAN-13 + 2:" )
  478. .head 5 -  Call VpeBarcode( hDoc, 200, 1660, 600, 1860, BCT_EAN13_2, '4501645096787', '12' )
  479. .head 5 -  Call VpeWrite( hDoc, 700, 1600, 1200, 1800, "EAN-13 + 5:" )
  480. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 1 )
  481. .head 5 -  Call VpeBarcode( hDoc, 700, 1660, 1200, 1860, BCT_EAN13_5, '9781556153952', '12345' )
  482. .head 5 -  Call VpeWrite( hDoc, 1350, 1600, 1750, 1800, "EAN-128 A:" )
  483. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 0 )
  484. .head 5 -  Call VpeBarcode( hDoc, 1350, 1660, 1750, 1860, BCT_EAN128A, "EAN-128 A", '' )
  485. .head 5 -  Call VpeWrite( hDoc, 200, 2000, 600, 2200, "EAN-128 B:" )
  486. .head 5 -  Call VpeBarcode( hDoc, 200, 2060, 600, 2260, BCT_EAN128B, "ean-128 b", '' )
  487. .head 5 -  Call VpeWrite( hDoc, 700, 2000, 1200, 2200, "EAN-128 C:" )
  488. .head 5 -  Call VpeBarcode( hDoc, 700, 2060, 1200, 2260, BCT_EAN128C, "128902", '' )
  489. .head 5 -  Call VpeWrite( hDoc, 1350, 2000, 1850, 2200, "POSTNET (1.20) 5 or 9 digits" )
  490. .head 5 -  Call VpeBarcode( hDoc, 1350, 2060, 1628, 2120, BCT_POSTNET, "12345", '' )
  491. .head 5 -  Call VpeBarcode( hDoc, 1350, 2150, 1850, 2210, BCT_POSTNET, "414649623", '' )
  492. .head 5 -  Call VpePageBreak( hDoc )
  493. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 0, 1, 0 )
  494. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 18 )
  495. .head 5 -  Call VpeWrite( hDoc, 0, 150, 2100, 300, 'The supported barcode-types (continued):' )
  496. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 10 )
  497. .head 5 -  Call VpeSetBold( hDoc, 1 )
  498. .head 5 -  Call VpeWrite( hDoc, 200, 300, 550, 400, "UPC-A:" )
  499. .head 5 -  Call VpeBarcode( hDoc, 200, 360, 550, 560, BCT_UPCA, "07447079382", '' )
  500. .head 5 -  Call VpeWrite( hDoc, 700, 300, 1100, 400, "UPC-A + 2:" )
  501. .head 5 -  Call VpeBarcode( hDoc, 700, 360, 1100, 560, BCT_UPCA_2, '07447079382', '01' )
  502. .head 5 -  Call VpeWrite( hDoc, 1350, 300, 1800, 400, "UPC-A + 5:" )
  503. .head 5 -  Call VpeBarcode( hDoc, 1350, 360, 1800, 560, BCT_UPCA_5, '03126764825', '94687' )
  504. .head 5 -  Call VpeWrite( hDoc, 200, 700, 550, 900, 'UPC-E:' )
  505. .head 5 -  Call VpeBarcode( hDoc, 200, 760, 550, 960, BCT_UPCE, "0378492", '' )
  506. .head 5 -  Call VpeWrite( hDoc, 700, 700, 1100, 900, "UPC-E + 2:" )
  507. .head 5 -  Call VpeBarcode( hDoc, 700, 760, 1100, 960, BCT_UPCE_2, '0378492', '14' )
  508. .head 5 -  Call VpeWrite( hDoc, 1350, 700, 1800, 900, "UPC-E + 5:" )
  509. .head 5 -  Call VpeBarcode( hDoc, 1350, 760, 1800, 960, BCT_UPCE_5, "0364825", "79462" )
  510. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  511. .head 5 -  Set y = VpeWrite( hDoc, 200, 1100, 1800, VFREE, 
  512. "VPE supports 21 barcode types. Barcodes can be rotated in 90 degree steps, the text can be drawn on bottom or top of the barcode, and also independently the add-on text. Any of these features can be combined." )
  513. .head 5 -  !
  514. .head 5 -  Set y = VpePrint(hDoc, 500, y+100, "[S 24 U C LtYellow]Text and images")
  515. .head 5 -  Call VpePrint(hDoc, VRIGHT, VBOTTOM, "[Rot 900 C Blue] can be freely ")
  516. .head 5 -  Call VpeWriteBox(hDoc, 500, VBOTTOM, VLEFT, VFREE, "[Rot 1800 C Red CE]rotated in 90")
  517. .head 5 -  !
  518. .head 5 -  ! The WIDTH (after rotation it's the height) is the top of the last inserted text
  519. .head 5 -  ! minus the bottom of the first inserted object.
  520. .head 5 -  Call VpeWriteBox(hDoc, 400, y, -(VpeGet(hDoc, VTOP) - y), VFREE, "[Rot 2700 C Green]degree steps")
  521. .head 5 -  !
  522. .head 3 +  Function: page5
  523. .head 4 -  Description:
  524. .head 4 -  Returns
  525. .head 4 +  Parameters
  526. .head 5 -  Number: hDoc
  527. .head 4 -  Static Variables
  528. .head 4 +  Local variables
  529. .head 5 -  Number: nY
  530. .head 5 -  Number: nY2
  531. .head 5 -  Number: nX
  532. .head 5 -  Number: p
  533. .head 4 +  Actions
  534. .head 5 -  Call VpePageBreak( hDoc )
  535. .head 5 -  Call VpeUseSet( hDoc, HEADLINE )
  536. .head 5 -  Set nY = VpeWriteBox( hDoc, 100, 200, 2000, -1, 
  537. "VPE is also able to manage bitmaps for you!
  538. Place your logo wherever you want." )
  539. .head 5 -  Set nY = VpeWriteBox( hDoc, 100, nY, 1400, -1, 
  540. "[S 10 L BO IO UO] [Note: These are 256-color bitmaps, in 16-color mode it doesn't look very good)" )
  541. .head 5 -  Set nY = VpeWriteBox( hDoc, 100, nY + 50, 1400, -1, 
  542. "[N B U]VPE supports the following graphics file formats:" )
  543. .head 5 -  Call VpeWriteBox( hDoc, 100, nY, 1400, -1, 
  544. "-Windows and OS/2 Bitmaps (2 / 16 / 256 / True Color)
  545. -Windows WMF (Metafile)
  546. -AutoCAD DXF
  547. -GIF (2 / 16 / 256 Colors)
  548. -PCX (2 / 16 / 256 Colors)
  549. -JPG (256 / True Color)
  550. -TIFF 5.0 (2 / 16 / 256 / True Color, LZW / PackBits / Fax G3 / Fax G4 / Tiled Images)
  551. -Microsoft filters (feature, some restrictions and only 16-bit versions)" )
  552. .head 5 -  Call VpeSetPen( hDoc, 5, _VPE_PS_SOLID, COLOR_Black )
  553. .head 5 -  Call VpePicture( hDoc, 1400, 150, -1, -1, 'logo.bmp', PIC_KEEPIMAGE | PIC_KEEP_DIB_PAGE )
  554. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  555. .head 5 -  Set nX = VpeGet( hDoc, VRIGHT )
  556. .head 5 -  Call VpeWriteBox( hDoc, 1400, nY, nX, -1, "[N S 14 CE C White BC Red TO Italic Bold]IDEAL Software" )
  557. .head 5 -  Call VpeDefaultBitmapDPI( hDoc, 96, 96 )
  558. .head 5 -  Call VpePicture( hDoc, 1400, VpeGet( hDoc, VBOTTOM ) + 100, -1, -1, 'fruits.bmp', PIC_KEEPIMAGE | PIC_KEEP_DIB_PAGE )
  559. .head 5 -  Set nY = VpeWriteBox( hDoc, 150, nY + 400, 1500, -1, 
  560. "[S 14 CE PS 0]Scale your bitmaps as you like:" )
  561. .head 5 -  Set nY = nY + 20
  562. .head 5 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  563. .head 5 -  Call VpePicture( hDoc, 150, nY, 200, -1, 'logo.bmp', 0 )
  564. .head 5 -  Call VpePicture( hDoc, VpeGet( hDoc, VRIGHT ) + 100, nY, VpeGet( hDoc, VRIGHT ) + 250, -1, 'logo.bmp', PIC_KEEPIMAGE | PIC_KEEP_DIB_PAGE )
  565. .head 5 -  Call VpePicture( hDoc, VpeGet( hDoc, VRIGHT ) + 100, nY, VpeGet( hDoc, VRIGHT ) + 750, -1, 'logo.bmp', PIC_KEEPIMAGE | PIC_KEEP_DIB_PAGE )
  566. .head 5 -  !
  567. .head 5 -  Set nY = VpeGet(hDoc, VBOTTOM) + 300
  568. .head 5 -  Set nY = VpePrint(hDoc, 150, nY, "[N U]Draw! Set the Pen, Background Color and Hatch Style:")
  569. .head 5 -  Set nY = nY + 50
  570. .head 5 -  Call VpeSetTransparentMode(hDoc, 0)
  571. .head 5 -  Call VpeSetBkgColor(hDoc, COLOR_Blue)
  572. .head 5 -  Call VpeBox(hDoc, 150, nY, -300, -300)
  573. .head 5 -  !
  574. .head 5 -  Call VpeSetHatchStyle(hDoc, HS_BDIAGONAL)
  575. .head 5 -  Call VpeSetHatchColor(hDoc, COLOR_Blue)
  576. .head 5 -  Call VpeSetBkgColor(hDoc, COLOR_Yellow)
  577. .head 5 -  Call VpeNoPen(hDoc)
  578. .head 5 -  Set p = VpePolygonInit(hDoc, 4)
  579. .head 5 -  Call VpeAddPolygonPoint(hDoc, p, 250, nY+400)
  580. .head 5 -  Call VpeAddPolygonPoint(hDoc, p, 500, nY+600)
  581. .head 5 -  Call VpeAddPolygonPoint(hDoc, p, 300, nY+700)
  582. .head 5 -  Call VpeAddPolygonPoint(hDoc, p, 150, nY+1000)
  583. .head 5 -  !
  584. .head 5 -  Call VpeSetPen(hDoc, 6, _VPE_PS_SOLID, COLOR_Black)
  585. .head 5 -  Set p = VpePolygonInit(hDoc, 4)
  586. .head 5 -  Call VpeAddPolygonPoint(hDoc, p, 650, nY)
  587. .head 5 -  Call VpeAddPolygonPoint(hDoc, p, 1000, nY+200)
  588. .head 5 -  Call VpeAddPolygonPoint(hDoc, p, 700, nY+300)
  589. .head 5 -  Call VpeAddPolygonPoint(hDoc, p, 550, nY+600)
  590. .head 5 -  !
  591. .head 5 -  Call VpeNoPen(hDoc)
  592. .head 5 -  Call VpeSetHatchStyle(hDoc, HS_DIAGCROSS)
  593. .head 5 -  Call VpeSetHatchColor(hDoc, COLOR_Red)
  594. .head 5 -  Call VpeSetBkgColor(hDoc, COLOR_Cyan)
  595. .head 5 -  Call VpeEllipse(hDoc, 750, 2150, -500, -300)
  596. .head 5 -  !
  597. .head 5 -  Call VpeSetHatchStyle(hDoc, HS_FDIAGONAL)
  598. .head 5 -  Call VpeSetPen(hDoc, 10, _VPE_PS_SOLID, COLOR_Green)
  599. .head 5 -  Call VpeSetTransparentMode(hDoc, 1)
  600. .head 5 -  Set nY2 = VpeWrite(hDoc, 1200, nY + 200, -500, -1, "[S 12 B CE]Write text beyond,")
  601. .head 5 -  Call VpeEllipse(hDoc, 1200, nY, -500, -500)
  602. .head 5 -  Call VpeWrite(hDoc, 1200, nY2, -500, -1, "or above the hatching.")
  603. .head 5 -  !
  604. .head 5 -  Call VpeSetTransparentMode(hDoc, 0)
  605. .head 5 -  Call VpeWriteBox(hDoc, 770, 2280, -460, -1, "[PS 3 PC Black HSN BC Cyan S 10 NB]Or blank the hatching out.")
  606. .head 5 -  !
  607. .head 5 -  Call VpeSetTransparentMode(hDoc, 1)
  608. .head 5 -  !
  609. .head 3 +  Function: page6
  610. .head 4 -  Description:
  611. .head 4 -  Returns
  612. .head 4 +  Parameters
  613. .head 5 -  Number: hDoc
  614. .head 4 -  Static Variables
  615. .head 4 -  Local variables
  616. .head 4 +  Actions
  617. .head 5 -  Call VpePageBreak( hDoc )
  618. .head 5 -  Call VpeNoPen( hDoc )
  619. .head 5 -  Call VpePicture( hDoc, 0, 0, -1, -1, 'gew.tif', PIC_KEEPIMAGE | PIC_KEEP_DIB_PAGE )
  620. .head 5 -  Call VpeWrite( hDoc, 250, 110, 1200, -1, "[S 24 C LtRed L PS 0]Stadt Xhausen" )
  621. .head 5 -  Call VpeWrite( hDoc, 250, 500, 1000, -1, "[S 14 C Blue]Mustermann & Co.
  622. Feinkost im- und Export" )
  623. .head 5 -  Call VpeWrite( hDoc, 1200, 460, 1700, -1, "[S 11 B]Dⁿsseldorf" )
  624. .head 5 -  Call VpeWrite( hDoc, 250, 670, 750, -1, "Schmidt" )
  625. .head 5 -  Call VpeWrite( hDoc, 250, 840, 750, -1, "24.7.1947" )
  626. .head 5 -  Call VpeWrite( hDoc, 500, 835, 1000, -1, "Oberammergau" )
  627. .head 5 -  Call VpeWrite( hDoc, 250, 1010, 750, -1, "Zunderstr. 93" )
  628. .head 5 -  Call VpeWrite( hDoc, 1000, 1000, 1750, -1, "0 27 84 / 16 45 98" )
  629. .head 5 -  Call VpeWrite( hDoc, 250, 1255, 1750, -1, "Willi-Graf-Str. 17" )
  630. .head 5 -  Call VpeWrite( hDoc, 1000, 1255, 1750, -1, "0 27 84 / 23 54 90" )
  631. .head 5 -  Call VpeWrite( hDoc, 1220, 660, 1750, -1, "Heinz - Willi" )
  632. .head 5 -  Call VpeWrite( hDoc, 1100, 1500, 1950, -1, 
  633. "[S 10 J I]It is very important to mention here, that the bitmap form has a resolution of 96 " ||
  634. "DPI only. The print will not be very nice. Just try a 300 DPI bitmap on your own!" )
  635. .head 3 +  Function: Precision
  636. .head 4 -  Description:
  637. .head 4 -  Returns
  638. .head 4 +  Parameters
  639. .head 5 -  Number: nMode
  640. .head 4 -  Static Variables
  641. .head 4 +  Local variables
  642. .head 5 -  Number: hDoc
  643. .head 4 +  Actions
  644. .head 5 +  If nMode = 0
  645. .head 6 -  Set hDoc = VpeOpenDoc( ghWndMain, "Precision + Capabilities", -1, -1, VPE_EMBEDDED | VPE_GRID_POSSIBLE | VPE_ROUTE_HELP )
  646. .head 6 -  Set gnPrecision = hDoc
  647. .head 5 +  Else
  648. .head 6 -  Set hDoc = VpeOpenDoc( ghWndMain, "Precision + Capabilities", -1, -1, 0 )
  649. .head 6 -  Set gnPBackGnd = hDoc
  650. .head 5 -  Call VpeSetAutoBreak( hDoc, AUTO_BREAK_NO_LIMITS )
  651. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 1, 1 )
  652. .head 5 -  Call VpeSetPen( hDoc, 0, _VPE_PS_SOLID, 0 )
  653. .head 5 -  Call VpeDefineHeader( hDoc, 100, 100, 1000, 150, "Precision + Capabilities / IDEAL Software" )
  654. .head 5 -  Call VpeSetUnderlined( hDoc, 0 )
  655. .head 5 -  Call VpeDefineFooter( hDoc, 1900, 2800, 2100, 2900, "Page @PAGE" )
  656. .head 5 -  Call SalWaitCursor( TRUE )
  657. .head 5 -  Call page1( hDoc )
  658. .head 5 -  ! Call page2( hDoc )
  659. .head 5 -  Call page3_4( hDoc )
  660. .head 5 -  Call page5( hDoc )
  661. .head 5 -  Call page6( hDoc )
  662. .head 5 -  Call SalWaitCursor( FALSE )
  663. .head 5 -  Call VpeRemoveSet( hDoc, HEADLINE )
  664. .head 5 -  Call VpeGotoPage( hDoc, 1 )
  665. .head 5 +  If nMode = 0
  666. .head 6 -  Call VpePreviewDocTile( hDoc, VPE_SHOW_NORMAL )
  667. .head 5 +  Else
  668. .head 6 -  Call VpePrintDoc( hDoc, FALSE )
  669. .head 6 -  Call VpeCloseDoc( hDoc )
  670. .head 3 +  Function: Graph
  671. .head 4 -  Description:
  672. .head 4 -  Returns
  673. .head 4 -  Parameters
  674. .head 4 -  Static Variables
  675. .head 4 +  Local variables
  676. .head 5 -  Number: hDoc
  677. .head 4 +  Actions
  678. .head 5 -  Set hDoc = VpeOpenDoc( ghWndMain, "Precision + Capabilities", -1, -1, VPE_GRID_POSSIBLE)
  679. .head 5 -  Set gnGraph = hDoc
  680. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 1, 1 )
  681. .head 5 -  Call VpeSetPen( hDoc, 0, _VPE_PS_SOLID, 0 )
  682. .head 5 -  Call VpeDefineHeader( hDoc, 100, 100, 1000, 150, "Graphing / IDEAL Software" )
  683. .head 5 -  Call VpeSetUnderlined( hDoc, 0 )
  684. .head 5 -  Call SalWaitCursor( TRUE )
  685. .head 5 -  Call page2( hDoc )
  686. .head 5 -  Call SalWaitCursor( FALSE )
  687. .head 5 -  Call VpeRemoveSet( hDoc, HEADLINE )
  688. .head 5 -  Call VpeGotoPage( hDoc, 1 )
  689. .head 5 -  Call VpePreviewDocTile( hDoc, VPE_SHOW_NORMAL )
  690. .head 3 +  Function: colortest
  691. .head 4 -  Description:
  692. .head 4 -  Returns
  693. .head 4 -  Parameters
  694. .head 4 -  Static Variables
  695. .head 4 +  Local variables
  696. .head 5 -  Number: nRange
  697. .head 5 -  Number: nStep
  698. .head 5 -  Number: nColorStep
  699. .head 5 -  Number: nMinColor
  700. .head 5 -  Number: nMaxColor
  701. .head 5 -  Number: hDoc
  702. .head 5 -  Number: nX
  703. .head 5 -  Number: nY
  704. .head 5 -  Number: nR
  705. .head 5 -  Number: nG
  706. .head 5 -  Number: nB
  707. .head 5 -  Number: nDeltaR
  708. .head 5 -  Number: nDeltaG
  709. .head 5 -  Number: nDeltaB
  710. .head 5 -  Number: nXX
  711. .head 5 -  Number: nFactor
  712. .head 4 +  Actions
  713. .head 5 -  Set nRange = 1400
  714. .head 5 -  Set nStep = 1
  715. .head 5 -  Set nColorStep = 2
  716. .head 5 -  Set nMinColor = 0
  717. .head 5 -  Set nMaxColor = 255
  718. .head 5 -  Set hDoc = VpeOpenDoc( ghWndMain, 'Colors', -1, -1,
  719. VPE_NO_MOUSE_SCALE | VPE_NO_USER_MOVE | VPE_NO_USER_CLOSE | 
  720. VPE_NO_STATBAR | VPE_NO_RULER | VPE_NO_HELPBTN | VPE_NO_INFOBTN )
  721. .head 5 -  Call VpeSetScale( hDoc, 0.25 )
  722. .head 5 -  Set gnColors = hDoc
  723. .head 5 -  Call VpeSetPen( hDoc, 0, _VPE_PS_SOLID, COLOR_Black )
  724. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 30 )
  725. .head 5 -  Set nXX = -3.1415
  726. .head 5 -  Set nFactor = 2 * SalNumberAbs( nXX ) / nRange * nStep
  727. .head 5 -  Set nR = 192
  728. .head 5 -  Set nDeltaR = nColorStep
  729. .head 5 -  Set nG = nMinColor + 1
  730. .head 5 -  Set nDeltaG = nColorStep
  731. .head 5 -  Set nB = nMinColor + 1
  732. .head 5 -  Set nDeltaB = nColorStep
  733. .head 5 -  Set nX = 100
  734. .head 5 +  While nX < nRange + 100
  735. .head 6 -  Set nY = SalNumberSin( nXX ) * 500.0 + 500
  736. .head 6 -  Call VpeSetTextColor( hDoc, SalColorFromRGB( nR, nG, nB ) )
  737. .head 6 -  ! Call VpePrint( hDoc, nX, nY, 'Color Test' )
  738. .head 6 -  Call VpeWriteBox( hDoc, nX, nY, nX + 800, nY + 120, 'Color Test' )
  739. .head 6 +  If SalNumberMod( nX, 10 ) = 0
  740. .head 7 -  Set nXX = nXX + nFactor
  741. .head 7 -  Set nX = nX + nStep
  742. .head 7 -  Set nY = SalNumberSin( nXX ) * 500.0 + 500
  743. .head 7 -  Call VpeSetTextColor( hDoc, COLOR_Black )
  744. .head 7 -  Call VpeWriteBox( hDoc, nX, nY, nX + 800, nY + 120, 'Color Test' )
  745. .head 6 -  Set nXX = nXX + nFactor
  746. .head 6 +  If nR > nMinColor AND nR < nMaxColor
  747. .head 7 -  Set nR = nR + nDeltaR
  748. .head 7 +  If nR < nMinColor
  749. .head 8 -  Set nR = nMinColor
  750. .head 7 +  If nR > nMaxColor
  751. .head 8 -  Set nR = nMaxColor
  752. .head 6 +  Else If nG > nMinColor AND nG < nMaxColor 
  753. .head 7 -  Set nG = nG + nDeltaG
  754. .head 7 +  If nG < nMinColor
  755. .head 8 -  Set nG = nMinColor
  756. .head 7 +  If nG > nMaxColor
  757. .head 8 -  Set nG = nMaxColor
  758. .head 6 +  Else If nB > nMinColor AND nB < nMaxColor 
  759. .head 7 -  Set nB = nB + nDeltaB
  760. .head 7 +  If nB < nMinColor
  761. .head 8 -  Set nB = nMinColor
  762. .head 7 +  If nB > nMaxColor
  763. .head 8 -  Set nB = nMaxColor
  764. .head 6 +  If nR >= nMaxColor AND nB >= nMaxColor
  765. .head 7 -  Set nDeltaR = -nColorStep
  766. .head 7 -  Set nR = nMaxColor - 1
  767. .head 6 +  If nR >= nMinColor AND nG >= nMaxColor
  768. .head 7 -  Set nDeltaG = -nColorStep
  769. .head 7 -  Set nG = nMaxColor - 1
  770. .head 6 +  If nG = nMinColor AND nB >= nMaxColor
  771. .head 7 -  Set nDeltaB = -nColorStep
  772. .head 7 -  Set nB = nMaxColor - 1
  773. .head 6 +  If nR = nMinColor AND nG = nMinColor AND nB = nMinColor
  774. .head 7 -  Set nR = nMinColor + 1
  775. .head 7 -  Set nG = nMinColor + 1
  776. .head 7 -  Set nB = nMinColor + 1
  777. .head 7 -  Set nDeltaR = nColorStep
  778. .head 7 -  Set nDeltaG = nColorStep
  779. .head 7 -  Set nDeltaB = nColorStep
  780. .head 6 -  Call VpePreviewDoc( hDoc, 0, 0, 280, 200, VPE_SHOW_NORMAL )
  781. .head 6 -  Set nX = nX + nStep
  782. .head 3 +  Function: reporttest
  783. .head 4 -  Description: Report Demo
  784. This is all done manually, only for your eyes...
  785. .head 4 -  Returns
  786. .head 4 -  Parameters
  787. .head 4 -  Static Variables
  788. .head 4 +  Local variables
  789. .head 5 -  Number: hDoc
  790. .head 5 -  Number: nY
  791. .head 4 +  Actions
  792. .head 5 -  Set hDoc = VpeOpenDoc( ghWndMain, "Report", -1, -1, 0 )
  793. .head 5 -  Set gnReport = hDoc
  794. .head 5 -  Call VpeSetAutoBreak( hDoc, AUTO_BREAK_NO_LIMITS )
  795. .head 5 -  Call VpeSetPen( hDoc, 5, _VPE_PS_SOLID, COLOR_Black )
  796. .head 5 -  Call VpeDefaultBitmapDPI( hDoc, 96, 96 )
  797. .head 5 -  Call VpePicture( hDoc, 1650, 150, -1, -1, 'fruits.bmp', PIC_KEEPIMAGE | PIC_KEEP_DIB_PAGE )
  798. .head 5 -  Call VpeWriteBox( hDoc, 1650, VpeGet( hDoc, VBOTTOM ), VpeGet( hDoc, VRIGHT), -1, '[N S 9 CE I C Blue BC Gray TO]Fruits of Doom Software' )
  799. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 100
  800. .head 5 -  Call VpePrint( hDoc, 150, 200, '[N S 26 U]Year End Results' )
  801. .head 5 -  Call VpePrint( hDoc, 150, 400, '[N S 32]Fruits of Doom Software' )
  802. .head 5 -  Call VpeLine( hDoc, 150, nY, 2000, nY )
  803. .head 5 -  Set nY = nY + 50
  804. .head 5 -  Call VpeNoPen( hDoc )
  805. .head 5 -  Call VpePrintBox( hDoc, 150, nY, '[N S 18 C Blue]Product: Apples' )
  806. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 10
  807. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 16 C Purple]Country' )
  808. .head 5 -  Call VpePrint( hDoc, 650, nY, 'Quantity' )
  809. .head 5 -  Call VpePrint( hDoc, 1150, nY, 'Value (in $)' )
  810. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  811. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  812. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  813. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  814. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  815. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 14 C Black]Germany' )
  816. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '[R]2.450,00' )
  817. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "120.050,00" )
  818. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  819. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  820. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  821. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  822. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  823. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Great Britain' )
  824. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '2.250,00' )
  825. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "110.250,00" )
  826. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  827. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  828. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  829. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  830. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  831. .head 5 -  Call VpePrint( hDoc, 150, nY, 'France' )
  832. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.700,00' )
  833. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "83.300,00" )
  834. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  835. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  836. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  837. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  838. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  839. .head 5 -  Call VpePrint( hDoc, 150, nY, 'USA' )
  840. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '3.200,00' )
  841. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "156.800,00" )
  842. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  843. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  844. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  845. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  846. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  847. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Australia' )
  848. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.080,00' )
  849. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "52.920,00" )
  850. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  851. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Total' )
  852. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '10.680,00' )
  853. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "523.320,00" )
  854. .head 5 -  Set nY = nY + 210
  855. .head 5 -  Call VpePrintBox( hDoc, 150, nY, '[N S 18 C Blue]Product: Oranges' )
  856. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 10
  857. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 16 C Purple]Country' )
  858. .head 5 -  Call VpePrint( hDoc, 650, nY, 'Quantity' )
  859. .head 5 -  Call VpePrint( hDoc, 1150, nY, 'Value (in $)' )
  860. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  861. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  862. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  863. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  864. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  865. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 14 C Black]Germany' )
  866. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '[R]2.450,00' )
  867. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "120.050,00" )
  868. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  869. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  870. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  871. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  872. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  873. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Great Britain' )
  874. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '2.250,00' )
  875. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "110.250,00" )
  876. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  877. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  878. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  879. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  880. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  881. .head 5 -  Call VpePrint( hDoc, 150, nY, 'France' )
  882. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.700,00' )
  883. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "83.300,00" )
  884. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  885. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  886. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  887. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  888. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  889. .head 5 -  Call VpePrint( hDoc, 150, nY, 'USA' )
  890. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '3.200,00' )
  891. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "156.800,00" )
  892. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  893. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  894. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  895. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  896. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  897. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Australia' )
  898. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.080,00' )
  899. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "52.920,00" )
  900. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  901. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Total' )
  902. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '10.680,00' )
  903. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "523.320,00" )
  904. .head 5 -  Set nY = nY + 210
  905. .head 5 -  Call VpePrintBox( hDoc, 150, nY, '[N S 18 C Blue]Product: Bananas' )
  906. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 10
  907. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 16 C Purple]Country' )
  908. .head 5 -  Call VpePrint( hDoc, 650, nY, 'Quantity' )
  909. .head 5 -  Call VpePrint( hDoc, 1150, nY, 'Value (in $)' )
  910. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  911. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  912. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  913. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  914. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  915. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 14 C Black]Germany' )
  916. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '[R]2.450,00' )
  917. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "120.050,00" )
  918. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  919. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  920. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  921. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  922. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  923. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Great Britain' )
  924. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '2.250,00' )
  925. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "110.250,00" )
  926. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  927. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  928. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  929. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  930. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  931. .head 5 -  Call VpePrint( hDoc, 150, nY, 'France' )
  932. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.700,00' )
  933. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "83.300,00" )
  934. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  935. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  936. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  937. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  938. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  939. .head 5 -  Call VpePrint( hDoc, 150, nY, 'USA' )
  940. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '3.200,00' )
  941. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "156.800,00" )
  942. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  943. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  944. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  945. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  946. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  947. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Australia' )
  948. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.080,00' )
  949. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "52.920,00" )
  950. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  951. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Total' )
  952. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '10.680,00' )
  953. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "523.320,00" )
  954. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 210
  955. .head 5 -  Call VpePrint( hDoc, 150, nY, '[N S 20 U]Yearly Country Sales Total: $1.569.960,00' )
  956. .head 5 -  !
  957. .head 5 -  ! Draw a pie
  958. .head 5 -  ! use the VpeGet()-stuff to easily position this anywhere on the paper
  959. .head 5 -  Call VpePageBreak(hDoc)
  960. .head 5 -  Call VpeSelectFont(hDoc, "Times New Roman", 12)
  961. .head 5 -  Call VpePrint(hDoc, 200, VBOTTOM, "[N S 18 U]Analyze of Paradise:")
  962. .head 5 -  Call VpeSetPen(hDoc, 3, _VPE_PS_SOLID, COLOR_Black)
  963. .head 5 -  Call VpeSetTransparentMode(hDoc, FALSE)
  964. .head 5 -  Call VpeSetBkgColor(hDoc, COLOR_Red)
  965. .head 5 -  !
  966. .head 5 -  Call VpePie(hDoc, 200, VpeGet(hDoc, VBOTTOM) + 100, -600, -600, 0, 300)
  967. .head 5 -  Call VpeStorePos(hDoc)
  968. .head 5 -  Call VpeBox(hDoc, VpeGet(hDoc, VRIGHT) + 200, VpeGet(hDoc, VTOP) + 20, -30, -30)
  969. .head 5 -  Call VpePrint(hDoc, VpeGet(hDoc, VRIGHT) + 30, VpeGet(hDoc, VTOP) - 10, "[N T]Apples")
  970. .head 5 -  !
  971. .head 5 -  Call VpeRestorePos(hDoc)
  972. .head 5 -  Call VpeSetBkgColor(hDoc, COLOR_Blue)
  973. .head 5 -  Call VpePie(hDoc, VLEFT, VTOP, VRIGHT, VBOTTOM, 300, 750)
  974. .head 5 -  Call VpeStorePos(hDoc)
  975. .head 5 -  Call VpeBox(hDoc, VpeGet(hDoc, VRIGHT) + 200, VpeGet(hDoc, VTOP) + 70, -30, -30)
  976. .head 5 -  Call VpePrint(hDoc, VpeGet(hDoc, VRIGHT) + 30, VpeGet(hDoc, VTOP) - 10, "[N T]Oranges")
  977. .head 5 -  !
  978. .head 5 -  Call VpeRestorePos(hDoc)
  979. .head 5 -  Call VpeSetBkgColor(hDoc, COLOR_Yellow)
  980. .head 5 -  Call VpePie(hDoc, VLEFT, VTOP, VRIGHT, VBOTTOM, 750, 1500)
  981. .head 5 -  Call VpeStorePos(hDoc)
  982. .head 5 -  Call VpeBox(hDoc, VpeGet(hDoc, VRIGHT) + 200, VpeGet(hDoc, VTOP) + 120, -30, -30)
  983. .head 5 -  Call VpePrint(hDoc, VpeGet(hDoc, VRIGHT) + 30, VpeGet(hDoc, VTOP) - 10, "[N T]Bananas")
  984. .head 5 -  !
  985. .head 5 -  Call VpeRestorePos(hDoc)
  986. .head 5 -  Call VpeSetBkgColor(hDoc, COLOR_Green)
  987. .head 5 -  Call VpePie(hDoc, VLEFT, VTOP, VRIGHT, VBOTTOM, 1500, 2900)
  988. .head 5 -  Call VpeStorePos(hDoc)
  989. .head 5 -  Call VpeBox(hDoc, VpeGet(hDoc, VRIGHT) + 200, VpeGet(hDoc, VTOP) + 170, -30, -30)
  990. .head 5 -  Call VpePrint(hDoc, VpeGet(hDoc, VRIGHT) + 30, VpeGet(hDoc, VTOP) - 10, "[N T]Cherries")
  991. .head 5 -  !
  992. .head 5 -  Call VpeRestorePos(hDoc)
  993. .head 5 -  Call VpeSetBkgColor(hDoc, COLOR_Cyan)
  994. .head 5 -  Call VpePie(hDoc, VLEFT, VTOP, VRIGHT, VBOTTOM, 2900, 0)
  995. .head 5 -  Call VpeStorePos(hDoc)
  996. .head 5 -  Call VpeBox(hDoc, VpeGet(hDoc, VRIGHT) + 200, VpeGet(hDoc, VTOP) + 220, -30, -30)
  997. .head 5 -  Call VpePrint(hDoc, VpeGet(hDoc, VRIGHT) + 30, VpeGet(hDoc, VTOP) - 10, "[N T]Coconuts")
  998. .head 5 -  !
  999. .head 5 -  Call VpeSetTransparentMode(hDoc, TRUE)
  1000. .head 5 -  !
  1001. .head 5 -  Call VpeGotoPage(hDoc, 1)
  1002. .head 5 -  Call VpePreviewDoc(hDoc, -1, -1, -1, -1, VPE_SHOW_NORMAL)
  1003. .head 5 -  !
  1004. .head 3 +  ! Function: GenerateReport
  1005. .head 4 -  Description: 
  1006. .head 4 -  Returns 
  1007. .head 4 -  Parameters 
  1008. .head 4 -  Static Variables 
  1009. .head 4 +  Local variables 
  1010. .head 5 -  File Handle: hFileRpt
  1011. .head 5 -  Number: nI
  1012. .head 5 -  Number: nStepper
  1013. .head 5 -  Number: nMin
  1014. .head 5 -  Number: nZ
  1015. .head 5 -  Number: nCount
  1016. .head 5 -  Number: nTable
  1017. .head 4 +  Actions 
  1018. .head 5 -  Set nCount = 0
  1019. .head 5 -  Set nTable = 1
  1020. .head 5 -  ! Call SalNumberRandInit(  )
  1021. .head 5 -  Call dlgVpeDemo.Status( 'Generating pseudo report-file...' )
  1022. .head 5 -  Call SalFileOpen( hFileRpt, RPT_PATH, OF_Create | OF_Write | OF_Text)
  1023. .head 5 -  Call SalFilePutStr( hFileRpt, "Test-Document" )
  1024. .head 5 -  Call SalFilePutStr( hFileRpt, "1996
  1025. " )
  1026. .head 5 -  Set nZ = 0
  1027. .head 5 +  While nCount < 20000
  1028. .head 6 +  If nZ < SalNumberMod( SalNumberRandom(  ), 5 ) + 10
  1029. .head 7 -  Set nStepper = 4
  1030. .head 7 -  Set nMin = 3
  1031. .head 7 -  Set nZ = nZ + 1
  1032. .head 6 +  Else 
  1033. .head 7 -  Set nStepper = 21
  1034. .head 7 -  Set nMin = 20
  1035. .head 7 -  Set nZ = 0
  1036. .head 6 -  Call SalFilePutStr( hFileRpt, '@Table ' || SalNumberToStrX( nTable, 0 ) )
  1037. .head 6 -  Set nTable = nTable + 1
  1038. .head 6 -  Set nI = SalNumberMod( SalNumberRandom(  ), nStepper) + nMin
  1039. .head 6 +  While nI > 0
  1040. .head 7 -  Set nI = nI - 1
  1041. .head 7 -  Call SalFilePutStr( hFileRpt, SalFmtFormatNumber( nCount, '###0' ) || '
  1042. ' || SalFmtFormatNumber( SalNumberMod( SalNumberRandom(  ), 28 ) + 1, '#0' ) || '.' || 
  1043. SalFmtFormatNumber( SalNumberMod( SalNumberRandom(  ), 12 ) + 1, '00' ) || '.95
  1044. ' || SalFmtFormatNumber( SalNumberRandom(  ) + 
  1045. ( SalNumberMod( SalNumberRandom(  ), 100 ) / 100 ), '####0.00' ) || '
  1046. ' || SalFmtFormatNumber( SalNumberRandom(  ) + 
  1047. ( SalNumberMod( SalNumberRandom(  ), 100 ) / 100 ), '####0.00' ) || '
  1048. ' || SalFmtFormatNumber( SalNumberRandom(  ) + 
  1049. ( SalNumberMod( SalNumberRandom(  ), 100 ) / 100 ), '####0.00' ) || '
  1050.  
  1051.  
  1052. ' )
  1053. .head 7 -  Set nCount = nCount + 7 
  1054. .head 5 -  Call SalFileClose( hFileRpt )
  1055. .head 5 -  Call dlgVpeDemo.Status( 'Report generation finished.' )
  1056. .head 3 +  Function: GenerateData
  1057. .head 4 -  Description:
  1058. .head 4 +  Returns
  1059. .head 5 -  Boolean:
  1060. .head 4 -  Parameters
  1061. .head 4 -  Static Variables
  1062. .head 4 +  Local variables
  1063. .head 5 -  Boolean: bRetVal
  1064. .head 5 -  Number: nI
  1065. .head 5 -  Number: nStepper
  1066. .head 5 -  Number: nMin
  1067. .head 5 -  Number: nZ
  1068. .head 5 -  Number: nCount
  1069. .head 5 -  Number: nTable
  1070. .head 5 -  String: sTableName
  1071. .head 5 -  String: sComment
  1072. .head 5 -  Date/Time: dtTableDate
  1073. .head 5 -  Number: nAmount
  1074. .head 5 -  Number: nProratedAmt
  1075. .head 5 -  Number: nTaxAmt
  1076. .head 4 +  Actions
  1077. .head 5 -  Call SalWaitCursor( TRUE )
  1078. .head 5 -  Call SalNumberRandInit( SalDateSecond( SalDateCurrent(  ) ) * SalDateMinute( SalDateCurrent(  ) ) * SalDateHour( SalDateCurrent(  ) ) )
  1079. .head 5 -  Set nTable = 1
  1080. .head 5 -  Set nZ = 0
  1081. .head 5 -  Set nCount = 0
  1082. .head 5 -  Set sComment = ''
  1083. .head 5 +  If SqlPrepare( ghSql, 'INSERT INTO #VPE_DEMO (TABLE_NAME, TABLE_COUNT, TABLE_DATE, AMOUNT, PRORATED_AMT, TAX_AMT, USER_COMMENT )
  1084. VALUES ( :sTableName, :nCount, :dtTableDate, :nAmount, :nProratedAmt, :nTaxAmt, :sComment )' )
  1085. .head 6 +  While nCount < 20000
  1086. .head 7 +  If nZ < SalNumberMod( SalNumberRandom(  ), 5 ) + 10
  1087. .head 8 -  Set nStepper = 4
  1088. .head 8 -  Set nMin = 3
  1089. .head 7 +  Else
  1090. .head 8 -  Set nStepper = 21
  1091. .head 8 -  Set nMin = 20
  1092. .head 8 -  Set nZ = 0
  1093. .head 7 -  Set nZ = nZ + 1
  1094. .head 7 -  Set sTableName = 'Table ' || SalFmtFormatNumber( nTable, '000' )
  1095. .head 7 -  Set nTable = nTable + 1
  1096. .head 7 -  Set nI = SalNumberMod( SalNumberRandom(  ), nStepper ) + nMin
  1097. .head 7 +  While nI > 0
  1098. .head 8 -  Set dtTableDate = SalDateConstruct( 1995, SalNumberMod( SalNumberRandom(  ), 12 ) + 1, SalNumberMod( SalNumberRandom(  ), 28 ) + 1, 0, 0, 0 )
  1099. .head 8 -  Set nAmount = SalNumberRandom(  ) + SalNumberRandom(  ) / 32768
  1100. .head 8 -  Set nProratedAmt = SalNumberRandom(  ) + SalNumberRandom(  ) / 32768
  1101. .head 8 -  Set nTaxAmt = SalNumberRandom(  ) + SalNumberRandom(  ) / 32768
  1102. .head 8 -  Call SqlExecute( ghSql )
  1103. .head 8 -  Set nCount = nCount + 7
  1104. .head 8 -  Set nI = nI - 1
  1105. .head 6 -  Call SqlCommit( ghSql )
  1106. .head 6 -  Set bRetVal = TRUE
  1107. .head 5 +  Else
  1108. .head 6 -  Set bRetVal = FALSE
  1109. .head 5 -  Call SalWaitCursor( FALSE )
  1110. .head 5 -  Return bRetVal
  1111. .head 3 +  ! PrintJournal routines
  1112. .head 4 -  Structure of input file
  1113. .head 4 -  ========================
  1114. .head 4 -  User-name
  1115. .head 4 -  Year
  1116. .head 4 -  Start Month (or blank)
  1117. .head 4 -  End Month (or blank)
  1118. .head 4 -  <@>Table-Name --> start a new table!!!
  1119. .head 4 -  No.
  1120. .head 4 -  Date
  1121. .head 4 -  Amount
  1122. .head 4 -  Prorated Amount
  1123. .head 4 -  Tax
  1124. .head 4 -  Remark
  1125. .head 4 -  Remark
  1126. .head 3 -  ! NOTE: In this demo Y2 has a constant value for much faster processing
  1127. .head 3 +  Function: PrintHeader
  1128. .head 4 -  Description:
  1129. .head 4 -  Returns
  1130. .head 4 +  Parameters
  1131. .head 5 -  Number: hDoc
  1132. .head 5 -  String: sTable
  1133. .head 4 -  Static Variables
  1134. .head 4 -  Local variables
  1135. .head 4 +  Actions
  1136. .head 5 -  Call VpeSetAlign( hDoc, ALIGN_CENTER )
  1137. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 14 )
  1138. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_LightGray )
  1139. .head 5 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOM, VRIGHTMARGIN, -60, sTable )
  1140. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 1, 0, 0 )
  1141. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 11 )
  1142. .head 5 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOM, -200, -50, "No." )
  1143. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -200, VBOTTOM, "Date" )
  1144. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, "Amount" )
  1145. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, "Prorated Amount" )
  1146. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, "Tax" )
  1147. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, VRIGHTMARGIN, VBOTTOM, "Remark" )
  1148. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  1149. .head 5 -  Call VpeSetBkgColor( hDoc, SalColorFromRGB( 255, 255, 255 ) )
  1150. .head 3 +  Function: PrintFooter
  1151. .head 4 -  Description:
  1152. .head 4 -  Returns
  1153. .head 4 +  Parameters
  1154. .head 5 -  Number: hDoc
  1155. .head 4 -  Static Variables
  1156. .head 4 +  Local variables
  1157. .head 5 -  String: s
  1158. .head 4 +  Actions
  1159. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 1, 0, 0 )
  1160. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_LightGray )
  1161. .head 5 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOM, -400, -50, "Sum" )
  1162. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_RIGHT, 1, 0, 0 )
  1163. .head 5 -  Set s = SalFmtFormatNumber( gnSumAmount, '###,##0.00' )
  1164. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, s )
  1165. .head 5 -  Set s = SalFmtFormatNumber( gnSumProratedAmt, '###,##0.00' )
  1166. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, s )
  1167. .head 5 -  Set s = SalFmtFormatNumber( gnSumTaxAmt, '###,##0.00' )
  1168. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, s )
  1169. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, VRIGHTMARGIN, VBOTTOM, '' )
  1170. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  1171. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_White )
  1172. .head 3 +  Function: PrintPageFooter
  1173. .head 4 -  Description:
  1174. .head 4 -  Returns
  1175. .head 4 +  Parameters
  1176. .head 5 -  Number: hDoc
  1177. .head 5 -  String: sName
  1178. .head 5 -  Number: nPage
  1179. .head 4 -  Static Variables
  1180. .head 4 -  Local variables
  1181. .head 4 +  Actions
  1182. .head 5 -  Call VpeStorePos( hDoc )
  1183. .head 5 -  Call VpeNoPen( hDoc )
  1184. .head 5 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOMMARGIN, VpeGet( hDoc, VRIGHTMARGIN ) - 400, -50, sName )
  1185. .head 5 -  Call VpeSetAlign( hDoc, ALIGN_RIGHT )
  1186. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VBOTTOMMARGIN, VRIGHTMARGIN, -50, 'Journal Page ' || SalNumberToStrX( nPage, 0 ) )
  1187. .head 5 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  1188. .head 5 -  Call VpeRestorePos( hDoc )
  1189. .head 3 +  Function: PageBreak
  1190. .head 4 -  Description:
  1191. .head 4 -  Returns
  1192. .head 4 +  Parameters
  1193. .head 5 -  Number: hDoc
  1194. .head 5 -  Number: nPage
  1195. .head 4 -  Static Variables
  1196. .head 4 -  Local variables
  1197. .head 4 +  Actions
  1198. .head 5 -  Call VpePageBreak( hDoc )
  1199. .head 5 +  If SalNumberMod( nPage, 5 ) = 0
  1200. .head 6 -  Call dlgVpeDemo.Status( 'now reading demo data and generating page ' || SalNumberToStrX( nPage, 0 ) )
  1201. .head 3 +  Function: PrintJournal
  1202. .head 4 -  Description:
  1203. .head 4 +  Returns
  1204. .head 5 -  Boolean:
  1205. .head 4 -  Parameters
  1206. .head 4 -  Static Variables
  1207. .head 4 +  Local variables
  1208. .head 5 -  Number: hDoc
  1209. .head 5 -  String: s
  1210. .head 5 -  String: sBuf
  1211. .head 5 -  String: sName
  1212. .head 5 -  String: sYear
  1213. .head 5 -  String: sPeriod
  1214. .head 5 -  String: sTableName
  1215. .head 5 -  Number: nTableCount
  1216. .head 5 -  Date/Time: dtTableDate
  1217. .head 5 -  Number: nAmount
  1218. .head 5 -  Number: nProratedAmt
  1219. .head 5 -  Number: nTaxAmt
  1220. .head 5 -  String: sComment
  1221. .head 5 -  Boolean: bFooterOk
  1222. .head 5 -  Number: nPage
  1223. .head 5 -  Boolean: bRetVal
  1224. .head 5 -  Number: nFetchResult
  1225. .head 5 -  String: sOldTableName
  1226. .head 5 -  String: sTableDate
  1227. .head 4 +  Actions
  1228. .head 5 -  Set bRetVal = FALSE
  1229. .head 5 -  Set bFooterOk = FALSE
  1230. .head 5 -  Set nPage = 1
  1231. .head 5 -  Set sOldTableName = ''
  1232. .head 5 -  Call SalWaitCursor( TRUE )
  1233. .head 5 +  When SqlError
  1234. .head 6 -  Return FALSE
  1235. .head 5 +  If SqlPrepareAndExecute( ghSql, 
  1236. 'SELECT TABLE_NAME, TABLE_COUNT, TABLE_DATE, AMOUNT, PRORATED_AMT, TAX_AMT, USER_COMMENT 
  1237. FROM #VPE_DEMO ORDER BY TABLE_NAME, TABLE_COUNT 
  1238. INTO :sTableName, :nTableCount, :dtTableDate, :nAmount, :nProratedAmt, :nTaxAmt, :sComment' )
  1239. .head 6 -  Set hDoc = VpeOpenDoc( ghWndMain, "Speed + Tables", -1, -1, VPE_GRID_POSSIBLE )
  1240. .head 6 -  Set gnSpeed = hDoc
  1241. .head 6 -  Call VpeSetTransparentMode( hDoc, FALSE )
  1242. .head 6 -  Set sName = 'VPE Test Data'
  1243. .head 6 -  Set sYear = '1995'
  1244. .head 6 -  Set s = 'Journal ' || sYear
  1245. .head 6 -  Call VpeSetPen( hDoc, 0, 0, COLOR_Black )
  1246. .head 6 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 0, 1, 0 )
  1247. .head 6 -  Call VpeSelectFont( hDoc, 'Arial', 16 )
  1248. .head 6 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VTOPMARGIN, VRIGHTMARGIN, VFREE, s )
  1249. .head 6 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  1250. .head 6 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  1251. .head 6 -  Call VpeSelectFont( hDoc, 'Arial', 11 )
  1252. .head 6 +  While SqlFetchNext( ghSql, nFetchResult )
  1253. .head 7 +  If sTableName != sOldTableName
  1254. .head 8 -  ! beginning of a new table
  1255. .head 8 +  If bFooterOk
  1256. .head 9 -  Call PrintFooter( hDoc )
  1257. .head 8 -  Set gnSumAmount = 0
  1258. .head 8 -  Set gnSumProratedAmt = 0
  1259. .head 8 -  Set gnSumTaxAmt = 0
  1260. .head 8 -  ! is the space to the bottom of the page sufficient for another table?
  1261. .head 8 +  If ( VpeGet( hDoc, VBOTTOMMARGIN) - VpeGet( hDoc, VBOTTOM ) ) < 400
  1262. .head 9 -  ! no, so add a new page
  1263. .head 9 -  Call PrintPageFooter( hDoc, sName, nPage )
  1264. .head 9 -  Call PageBreak( hDoc, nPage )
  1265. .head 9 -  Set nPage = nPage + 1
  1266. .head 8 +  Else
  1267. .head 9 -  ! begining on new table is 1 cm below previous table
  1268. .head 9 -  Call VpeSet( hDoc, VBOTTOM, VpeGet( hDoc, VBOTTOM ) + 100 )
  1269. .head 8 -  Call PrintHeader( hDoc, sTableName )
  1270. .head 8 -  Set bFooterOk = FALSE
  1271. .head 8 -  Set sOldTableName = sTableName
  1272. .head 7 +  Else
  1273. .head 8 -  ! list part
  1274. .head 8 -  Set bFooterOk = TRUE
  1275. .head 8 -  Call VpeSetTransparentMode( hDoc, 1 )
  1276. .head 8 -  Call VpeSetAlign( hDoc, ALIGN_RIGHT )
  1277. .head 8 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOM, -200, -50, SalNumberToStrX( nTableCount, 0 ) )
  1278. .head 8 -  Call SalDateToStr( dtTableDate, sTableDate )
  1279. .head 8 -  Set sTableDate = SalStrMidX( sTableDate, 2, 8 )
  1280. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -200, VBOTTOM, sTableDate )
  1281. .head 8 -  Set gnSumAmount = gnSumAmount + nAmount
  1282. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, SalNumberToStrX( nAmount, 2 ) )
  1283. .head 8 -  Set gnSumProratedAmt = gnSumProratedAmt + nProratedAmt
  1284. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, SalNumberToStrX( nProratedAmt, 2 ) )
  1285. .head 8 -  Set gnSumTaxAmt = gnSumTaxAmt + nTaxAmt
  1286. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, SalNumberToStrX( nTaxAmt, 2 ) )
  1287. .head 8 -  Call VpeSetAlign( hDoc, ALIGN_LEFT )
  1288. .head 8 -  Call VpeSelectFont( hDoc, 'Arial', 6 )
  1289. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, VRIGHTMARGIN, VBOTTOM, sComment )
  1290. .head 8 -  Call VpeSelectFont( hDoc, 'Arial', 11 )
  1291. .head 8 -  Call VpeSetTransparentMode( hDoc, 0 )
  1292. .head 8 +  If VpeGet( hDoc, VBOTTOM ) + 150 > VpeGet( hDoc, VBOTTOMMARGIN )
  1293. .head 9 -  ! bottom of page reached
  1294. .head 9 -  Call PrintFooter( hDoc )
  1295. .head 9 -  Call PrintPageFooter( hDoc, sName, nPage )
  1296. .head 9 -  Call PageBreak( hDoc, nPage )
  1297. .head 9 -  Set nPage = nPage + 1
  1298. .head 9 -  Call PrintHeader( hDoc, sTableName )
  1299. .head 6 -  Call PrintFooter( hDoc )
  1300. .head 6 -  Call PrintPageFooter( hDoc, sName, nPage )
  1301. .head 6 -  Call VpeGotoPage( hDoc, 1 )
  1302. .head 6 -  Call VpeWriteBox( hDoc, 100, 100, 1000, 150, 'Generated ' || SalNumberToStrX( VpeGetPageCount( hDoc ), 0 ) || ' pages of demo data.' )
  1303. .head 6 -  Call dlgVpeDemo.Status( '' )
  1304. .head 6 -  Call VpePreviewDoc( hDoc, 0, 0, -1, -1, VPE_SHOW_MAXIMIZED )
  1305. .head 6 -  Set bRetVal = TRUE
  1306. .head 5 +  Else
  1307. .head 6 -  Call dlgVpeDemo.Status( 'ERROR: demo data table not found!' )
  1308. .head 5 -  Call SalWaitCursor( FALSE )
  1309. .head 5 -  Return bRetVal
  1310. .head 3 +  Function: AutoRender
  1311. .head 4 -  Description:
  1312. .head 4 +  Returns
  1313. .head 5 -  Boolean:
  1314. .head 4 -  Parameters
  1315. .head 4 -  Static Variables
  1316. .head 4 +  Local variables
  1317. .head 5 -  String: sText
  1318. .head 5 -  Number: nLen
  1319. .head 5 -  File Handle: hFile
  1320. .head 5 -  Number: hDoc
  1321. .head 4 +  Actions
  1322. .head 5 +  If not SalFileOpen( hFile, "..\\c\\vpedemo.cpp", OF_Read )
  1323. .head 6 -  Call dlgVpeDemo.Status( 'ERROR: file "..\\c\\vpedemo.cpp" not found!' )
  1324. .head 6 -  Return 0
  1325. .head 5 -  Call SalWaitCursor( TRUE )
  1326. .head 5 -  Call SalStrSetBufferLength( sText, 64001 )
  1327. .head 5 -  Set nLen = SalFileRead( hFile, sText, 64000 )
  1328. .head 5 -  Call SalFileClose( hFile )
  1329. .head 5 -  Set hDoc = VpeOpenDoc( ghWndMain, "Auto Rendering", -1, -1, 0 )
  1330. .head 5 -  Set gnAutoRender = hDoc
  1331. .head 5 -  Call VpeSelectFont(hDoc, "Courier New", 10)
  1332. .head 5 -  !
  1333. .head 5 -  ! Header will be placed outside default output rectangle:
  1334. .head 5 -  Call VpeNoPen(hDoc)
  1335. .head 5 -  Call VpeSetUnderlined(hDoc, 1)
  1336. .head 5 -  Call VpeDefineHeader(hDoc, 100, 100, -700, -50, "Auto Text Break Demo - Page @PAGE")
  1337. .head 5 -  !
  1338. .head 5 -  ! On every intial page:
  1339. .head 5 -  ! VLEFT   = VLEFTMARGIN
  1340. .head 5 -  ! VTOP    = VTOPMARGIN
  1341. .head 5 -  ! VRIGHT  = VRIGHTMARGIN
  1342. .head 5 -  ! VBOTTOM = VBOTTOMMARGIN !!!!!!!!!!
  1343. .head 5 -  Call VpeSetUnderlined(hDoc, 0)
  1344. .head 5 -  Call VpeSetPen(hDoc, 3, _VPE_PS_SOLID, 0)
  1345. .head 5 -  Call VpeWriteBox(hDoc, VLEFT, VBOTTOM, VRIGHT, VFREE, "[N TO BC LtGray CE S 12 B]Start of Listing")
  1346. .head 5 -  Call VpeWriteBox(hDoc, VLEFT, VBOTTOM, VRIGHT, VFREE, sText)
  1347. .head 5 -  Call VpeWriteBox(hDoc, VLEFT, VBOTTOM, VRIGHT, VFREE, "[N TO BC LtGray CE S 12 B]End of Listing")
  1348. .head 5 -  !
  1349. .head 5 -  Call VpeGotoPage(hDoc, 1)
  1350. .head 5 -  Call SalWaitCursor( FALSE )
  1351. .head 5 -  Call VpePreviewDoc(hDoc, -1, -1, -1, -1, VPE_SHOW_MAXIMIZED)
  1352. .head 5 -  !
  1353. .head 5 -  Return 1
  1354. .head 2 -  Named Menus
  1355. .head 2 +  Class Definitions
  1356. .head 2 +  Default Classes
  1357. .head 3 -  MDI Window: cBaseMDI
  1358. .head 3 -  Form Window:
  1359. .head 3 -  Dialog Box:
  1360. .head 3 -  Table Window:
  1361. .head 3 -  Quest Window:
  1362. .head 3 -  Data Field:
  1363. .head 3 -  Spin Field:
  1364. .head 3 -  Multiline Field: cQuickMLField
  1365. .head 3 -  Pushbutton: cQuickCommander
  1366. .head 3 -  Radio Button:
  1367. .head 3 -  Option Button:
  1368. .head 3 -  Check Box:
  1369. .head 3 -  Child Table: cQuickTable
  1370. .head 3 -  Quest Child Window: cQuickDatabase
  1371. .head 3 -  List Box:
  1372. .head 3 -  Combo Box:
  1373. .head 3 -  Picture: cQuickPicture
  1374. .head 3 -  Vertical Scroll Bar:
  1375. .head 3 -  Horizontal Scroll Bar:
  1376. .head 3 -  Column:
  1377. .head 3 -  Background Text:
  1378. .head 3 -  Group Box:
  1379. .head 3 -  Line:
  1380. .head 3 -  Frame:
  1381. .head 3 -  Custom Control: cQuickGraph
  1382. .head 2 -  Application Actions
  1383. .head 1 +  Form Window: frmVpeDemo
  1384. .head 2 -  Class:
  1385. .head 2 -  Property Template:
  1386. .head 2 -  Class DLL Name:
  1387. .head 2 -  Title: VPE
  1388. .head 2 -  Icon File:
  1389. .head 2 -  Accesories Enabled? No
  1390. .head 2 -  Visible? Yes
  1391. .head 2 -  Display Settings
  1392. .head 3 -  Display Style? Standard
  1393. .head 3 -  Visible at Design time? No
  1394. .head 3 -  Automatically Created at Runtime? Yes
  1395. .head 3 -  Initial State: Normal
  1396. .head 3 -  Maximizable? Yes
  1397. .head 3 -  Minimizable? Yes
  1398. .head 3 -  System Menu? Yes
  1399. .head 3 -  Resizable? Yes
  1400. .head 3 -  Window Location and Size
  1401. .head 4 -  Left:   Default
  1402. .head 4 -  Top:    Default
  1403. .head 4 -  Width:  Default
  1404. .head 4 -  Width Editable? Yes
  1405. .head 4 -  Height: Default
  1406. .head 4 -  Height Editable? Yes
  1407. .head 3 -  Form Size
  1408. .head 4 -  Width:  Default
  1409. .head 4 -  Height: Default
  1410. .head 4 -  Number of Pages: Dynamic
  1411. .head 3 -  Font Name: Default
  1412. .head 3 -  Font Size: Default
  1413. .head 3 -  Font Enhancement: Default
  1414. .head 3 -  Text Color: Default
  1415. .head 3 -  Background Color: Default
  1416. .head 2 -  Description:
  1417. .head 2 -  Named Menus
  1418. .head 2 -  Menu
  1419. .head 2 +  Tool Bar
  1420. .head 3 -  Display Settings
  1421. .head 4 -  Display Style? Default
  1422. .head 4 -  Location? Top
  1423. .head 4 -  Visible? Yes
  1424. .head 4 -  Size: Default
  1425. .head 4 -  Size Editable? Yes
  1426. .head 4 -  Font Name: Default
  1427. .head 4 -  Font Size: Default
  1428. .head 4 -  Font Enhancement: Default
  1429. .head 4 -  Text Color: Default
  1430. .head 4 -  Background Color: Default
  1431. .head 3 -  Contents
  1432. .head 2 -  Contents
  1433. .head 2 -  Functions
  1434. .head 2 -  Window Parameters
  1435. .head 2 +  Window Variables
  1436. .head 3 -  Boolean: bNoClose
  1437. .head 2 +  Message Actions
  1438. .head 3 +  On SAM_Create
  1439. .head 4 -  Call SalCreateWindow( dlgVpeDemo, hWndForm )
  1440. .head 4 -  Set ghWndMain = hWndForm
  1441. .head 4 -  Set bNoClose = FALSE
  1442. .head 3 +  On VPE_HELP
  1443. .head 4 -  Call SalMessageBox( "User requested help!", "Note:", MB_Ok )
  1444. .head 3 +  On VPE_DESTROYWINDOW
  1445. .head 4 +  If lParam = gnPrecision
  1446. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbClosePrecision, SAM_Click, 0, 0 )
  1447. .head 4 +  Else If lParam = gnGraph
  1448. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseGraph, SAM_Click, 0, 0 )
  1449. .head 4 +  Else If lParam = gnSpeed
  1450. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseSpeed, SAM_Click, 0, 0 )
  1451. .head 4 +  Else If lParam = gnColors
  1452. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseColors, SAM_Click, 0, 0 )
  1453. .head 4 +  Else If lParam = gnReport
  1454. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseReport, SAM_Click, 0, 0 )
  1455. .head 4 +  Else If lParam = gnAutoRender
  1456. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseAutoRender, SAM_Click, 0, 0 )
  1457. .head 3 +  On VPE_PRINT
  1458. .head 4 +  If wParam
  1459. .head 5 -  Set bNoClose = TRUE
  1460. .head 4 +  Else
  1461. .head 5 -  Set bNoClose = FALSE
  1462. .head 5 +  If lParam = gnPBackGnd
  1463. .head 6 -  Call VpeCloseDoc( gnPBackGnd )
  1464. .head 6 -  Set gnPBackGnd = 0
  1465. .head 6 -  Call dlgVpeDemo.Status( 'Message: Background Processing finished.' )
  1466. .head 3 +  On VPE_PRINTCANCEL
  1467. .head 4 -  Set bNoClose = FALSE
  1468. .head 4 +  If lParam = gnPBackGnd
  1469. .head 5 -  Set gnPBackGnd = 0
  1470. .head 5 -  Call dlgVpeDemo.Status( 'Message: Background Processing aborted.' )
  1471. .head 3 +  On WM_SIZE
  1472. .head 4 +  If (gnPrecision) ! this is an embedded window
  1473. .head 5 -  Call MoveWindow( VpeWindowHandle( gnPrecision), 0, 0, SalNumberLow( lParam ), SalNumberHigh( lParam ), FALSE )
  1474. .head 5 -  Return 0
  1475. .head 4 +  Else If (gnGraph)
  1476. .head 5 -  Call MoveWindow( VpeWindowHandle( gnGraph), 0, 0, SalNumberLow( lParam ), SalNumberHigh( lParam ), FALSE )
  1477. .head 5 -  Return 0
  1478. .head 3 +  On WM_KEYDOWN
  1479. .head 4 -  ! SQLWindows has a bug sending this message.
  1480. .head 4 -  ! But also this way is not the best: better to get the top-window that has the focus
  1481. .head 4 -  ! with 
  1482. .head 4 +  If (gnPrecision) ! this is an embedded window
  1483. .head 5 -  Call SalSendMsg( VpeWindowHandle( gnPrecision ), WM_KEYDOWN, wParam, lParam )
  1484. .head 5 -  Return 0
  1485. .head 4 +  Else If (gnGraph)
  1486. .head 5 -  Call SalSendMsg( VpeWindowHandle( gnGraph ), WM_KEYDOWN, wParam, lParam )
  1487. .head 5 -  Return 0
  1488. .head 3 +  On SAM_Close
  1489. .head 4 +  If bNoClose ! can't close, because printing?
  1490. .head 5 -  Call SalMessageBox( "Can't close, job is printing!", "WARNING:", MB_Ok )
  1491. .head 5 -  Return FALSE
  1492. .head 4 +  Else
  1493. .head 5 +  If gnColors
  1494. .head 6 -  Call SalSendMsg( dlgVpeDemo.pbCloseColors, SAM_Click, 0, 0 )
  1495. .head 5 +  If gnReport
  1496. .head 6 -  Call SalSendMsg( dlgVpeDemo.pbCloseReport, SAM_Click, 0, 0 )
  1497. .head 5 +  If gnAutoRender
  1498. .head 6 -  Call SalSendMsg( dlgVpeDemo.pbCloseReport, SAM_Click, 0, 0 )
  1499. .head 5 +  If gnSpeed
  1500. .head 6 -  Call SalSendMsg( dlgVpeDemo.pbCloseSpeed, SAM_Click, 0, 0 )
  1501. .head 5 +  If gbTableCreated
  1502. .head 6 -  Call SqlPrepareAndExecute( ghSql, 'DROP TABLE #VPE_DEMO' )
  1503. .head 6 -  Call SqlCommit( ghSql )
  1504. .head 6 -  Call SqlDisconnect( ghSql )
  1505. .head 1 +  Dialog Box: dlgVpeDemo
  1506. .head 2 -  Class:
  1507. .head 2 -  Property Template:
  1508. .head 2 -  Class DLL Name:
  1509. .head 2 -  Title: Virtual Print Engine
  1510. .head 2 -  Accesories Enabled? No
  1511. .head 2 -  Visible? Yes
  1512. .head 2 -  Display Settings
  1513. .head 3 -  Display Style? Default
  1514. .head 3 -  Visible at Design time? No
  1515. .head 3 -  Type of Dialog: Modeless
  1516. .head 3 -  Window Location and Size
  1517. .head 4 -  Left:   0.763"
  1518. .head 4 -  Top:    1.208"
  1519. .head 4 -  Width:  6.367"
  1520. .head 4 -  Width Editable? Yes
  1521. .head 4 -  Height: 3.988"
  1522. .head 4 -  Height Editable? Yes
  1523. .head 3 -  Absolute Screen Location? Yes
  1524. .head 3 -  Font Name: Arial
  1525. .head 3 -  Font Size: 8
  1526. .head 3 -  Font Enhancement: Bold
  1527. .head 3 -  Text Color: Default
  1528. .head 3 -  Background Color: Default
  1529. .head 2 -  Description:
  1530. .head 2 +  Tool Bar
  1531. .head 3 -  Display Settings
  1532. .head 4 -  Display Style? Default
  1533. .head 4 -  Location? Top
  1534. .head 4 -  Visible? Yes
  1535. .head 4 -  Size: Default
  1536. .head 4 -  Size Editable? Yes
  1537. .head 4 -  Font Name: Default
  1538. .head 4 -  Font Size: Default
  1539. .head 4 -  Font Enhancement: Default
  1540. .head 4 -  Text Color: Default
  1541. .head 4 -  Background Color: Default
  1542. .head 3 -  Contents
  1543. .head 2 +  Contents
  1544. .head 3 +  Pushbutton: pbBackground
  1545. .head 4 -  Class Child Ref Key: 0
  1546. .head 4 -  Class ChildKey: 0
  1547. .head 4 -  Class:
  1548. .head 4 -  Property Template:
  1549. .head 4 -  Class DLL Name:
  1550. .head 4 -  Title: Background
  1551. .head 4 -  Window Location and Size
  1552. .head 5 -  Left:   0.433"
  1553. .head 5 -  Top:    0.143"
  1554. .head 5 -  Width:  1.333"
  1555. .head 5 -  Width Editable? Yes
  1556. .head 5 -  Height: 0.238"
  1557. .head 5 -  Height Editable? Yes
  1558. .head 4 -  Visible? Yes
  1559. .head 4 -  Keyboard Accelerator: (none)
  1560. .head 4 -  Font Name: Default
  1561. .head 4 -  Font Size: Default
  1562. .head 4 -  Font Enhancement: Default
  1563. .head 4 -  Picture File Name:
  1564. .head 4 -  Picture Transparent Color: None
  1565. .head 4 -  Image Style: Single
  1566. .head 4 -  Text Color: Default
  1567. .head 4 -  Background Color: Default
  1568. .head 4 +  Message Actions
  1569. .head 5 +  On SAM_Click
  1570. .head 6 -  Call Status( 'Here no preview is shown. Also no printer-setup is done - setting of the standard printer or of your last setup in VPE is taken' )
  1571. .head 6 -  Call SalDisableWindow( hWndItem )
  1572. .head 6 -  Call Precision( 1 )
  1573. .head 6 -  Call SalEnableWindow( hWndItem )
  1574. .head 3 +  Pushbutton: pbPrecision
  1575. .head 4 -  Class Child Ref Key: 0
  1576. .head 4 -  Class ChildKey: 0
  1577. .head 4 -  Class:
  1578. .head 4 -  Property Template:
  1579. .head 4 -  Class DLL Name:
  1580. .head 4 -  Title: Capabilities + Precision
  1581. .head 4 -  Window Location and Size
  1582. .head 5 -  Left:   1.883"
  1583. .head 5 -  Top:    0.119"
  1584. .head 5 -  Width:  2.567"
  1585. .head 5 -  Width Editable? Yes
  1586. .head 5 -  Height: 0.292"
  1587. .head 5 -  Height Editable? Yes
  1588. .head 4 -  Visible? Yes
  1589. .head 4 -  Keyboard Accelerator: (none)
  1590. .head 4 -  Font Name: Default
  1591. .head 4 -  Font Size: Default
  1592. .head 4 -  Font Enhancement: Default
  1593. .head 4 -  Picture File Name:
  1594. .head 4 -  Picture Transparent Color: None
  1595. .head 4 -  Image Style: Single
  1596. .head 4 -  Text Color: Default
  1597. .head 4 -  Background Color: Default
  1598. .head 4 +  Message Actions
  1599. .head 5 +  On SAM_Click
  1600. .head 6 +  If gnPrecision
  1601. .head 7 -  Call Status( 'Precision test is already running' )
  1602. .head 6 +  Else
  1603. .head 7 -  Call Status( 'The window titled \'VPE\' is the application\'s main window. It\'s content is an embedded window from the VPE-DLL!!! ' || 
  1604. 'You just need a few lines of code!' )
  1605. .head 7 -  Call Precision( 0 )
  1606. .head 7 -  Call SalEnableWindow( pbClosePrecision )
  1607. .head 7 -  Call SalEnableWindow( pbPreviousPage )
  1608. .head 7 -  Call SalEnableWindow( pbNextPage )
  1609. .head 3 +  Pushbutton: pbClosePrecision
  1610. .head 4 -  Class Child Ref Key: 0
  1611. .head 4 -  Class ChildKey: 0
  1612. .head 4 -  Class:
  1613. .head 4 -  Property Template:
  1614. .head 4 -  Class DLL Name:
  1615. .head 4 -  Title: Close
  1616. .head 4 -  Window Location and Size
  1617. .head 5 -  Left:   4.633"
  1618. .head 5 -  Top:    0.143"
  1619. .head 5 -  Width:  0.767"
  1620. .head 5 -  Width Editable? Yes
  1621. .head 5 -  Height: 0.238"
  1622. .head 5 -  Height Editable? Yes
  1623. .head 4 -  Visible? Yes
  1624. .head 4 -  Keyboard Accelerator: (none)
  1625. .head 4 -  Font Name: Default
  1626. .head 4 -  Font Size: Default
  1627. .head 4 -  Font Enhancement: Default
  1628. .head 4 -  Picture File Name:
  1629. .head 4 -  Picture Transparent Color: None
  1630. .head 4 -  Image Style: Single
  1631. .head 4 -  Text Color: Default
  1632. .head 4 -  Background Color: Default
  1633. .head 4 +  Message Actions
  1634. .head 5 +  On SAM_Create
  1635. .head 6 -  Call SalDisableWindow( hWndItem )
  1636. .head 5 +  On SAM_Click
  1637. .head 6 +  If NOT VpeCloseDoc( gnPrecision )
  1638. .head 7 -  Call Status( 'Can\'t close, task \'precision test\' is currently printing' )
  1639. .head 6 +  Else
  1640. .head 7 -  Call SalDisableWindow( hWndItem )
  1641. .head 7 -  Call SalDisableWindow( pbPreviousPage )
  1642. .head 7 -  Call SalDisableWindow( pbNextPage )
  1643. .head 7 -  Set gnPrecision = 0
  1644. .head 3 +  Pushbutton: pbPreviousPage
  1645. .head 4 -  Class Child Ref Key: 0
  1646. .head 4 -  Class ChildKey: 0
  1647. .head 4 -  Class:
  1648. .head 4 -  Property Template:
  1649. .head 4 -  Class DLL Name:
  1650. .head 4 -  Title: <<
  1651. .head 4 -  Window Location and Size
  1652. .head 5 -  Left:   2.6"
  1653. .head 5 -  Top:    0.476"
  1654. .head 5 -  Width:  0.483"
  1655. .head 5 -  Width Editable? Yes
  1656. .head 5 -  Height: 0.238"
  1657. .head 5 -  Height Editable? Yes
  1658. .head 4 -  Visible? Yes
  1659. .head 4 -  Keyboard Accelerator: (none)
  1660. .head 4 -  Font Name: Default
  1661. .head 4 -  Font Size: Default
  1662. .head 4 -  Font Enhancement: Default
  1663. .head 4 -  Picture File Name:
  1664. .head 4 -  Picture Transparent Color: None
  1665. .head 4 -  Image Style: Single
  1666. .head 4 -  Text Color: Default
  1667. .head 4 -  Background Color: Default
  1668. .head 4 +  Message Actions
  1669. .head 5 +  On SAM_Create
  1670. .head 6 -  Call SalDisableWindow( hWndItem )
  1671. .head 5 +  On SAM_Click
  1672. .head 6 -  Call VpeSetUpdate( gnPrecision, TRUE )
  1673. .head 6 -  Call VpeGotoPage( gnPrecision, VpeGetCurrentPage( gnPrecision ) - 1 )
  1674. .head 6 -  Call VpeSetUpdate( gnPrecision, FALSE )
  1675. .head 3 +  Pushbutton: pbNextPage
  1676. .head 4 -  Class Child Ref Key: 0
  1677. .head 4 -  Class ChildKey: 0
  1678. .head 4 -  Class:
  1679. .head 4 -  Property Template:
  1680. .head 4 -  Class DLL Name:
  1681. .head 4 -  Title: >>
  1682. .head 4 -  Window Location and Size
  1683. .head 5 -  Left:   3.133"
  1684. .head 5 -  Top:    0.476"
  1685. .head 5 -  Width:  0.483"
  1686. .head 5 -  Width Editable? Yes
  1687. .head 5 -  Height: 0.238"
  1688. .head 5 -  Height Editable? Yes
  1689. .head 4 -  Visible? Yes
  1690. .head 4 -  Keyboard Accelerator: (none)
  1691. .head 4 -  Font Name: Default
  1692. .head 4 -  Font Size: Default
  1693. .head 4 -  Font Enhancement: Default
  1694. .head 4 -  Picture File Name:
  1695. .head 4 -  Picture Transparent Color: None
  1696. .head 4 -  Image Style: Single
  1697. .head 4 -  Text Color: Default
  1698. .head 4 -  Background Color: Default
  1699. .head 4 +  Message Actions
  1700. .head 5 +  On SAM_Create
  1701. .head 6 -  Call SalDisableWindow( hWndItem )
  1702. .head 5 +  On SAM_Click
  1703. .head 6 -  Call VpeSetUpdate( gnPrecision, TRUE )
  1704. .head 6 -  Call VpeGotoPage( gnPrecision, VpeGetCurrentPage( gnPrecision ) + 1 )
  1705. .head 6 -  Call VpeSetUpdate( gnPrecision, FALSE )
  1706. .head 3 +  Pushbutton: pbGraph
  1707. .head 4 -  Class Child Ref Key: 0
  1708. .head 4 -  Class ChildKey: 0
  1709. .head 4 -  Class:
  1710. .head 4 -  Property Template:
  1711. .head 4 -  Class DLL Name:
  1712. .head 4 -  Title: Graphing
  1713. .head 4 -  Window Location and Size
  1714. .head 5 -  Left:   1.883"
  1715. .head 5 -  Top:    0.762"
  1716. .head 5 -  Width:  2.567"
  1717. .head 5 -  Width Editable? Yes
  1718. .head 5 -  Height: 0.292"
  1719. .head 5 -  Height Editable? Yes
  1720. .head 4 -  Visible? Yes
  1721. .head 4 -  Keyboard Accelerator: (none)
  1722. .head 4 -  Font Name: Default
  1723. .head 4 -  Font Size: Default
  1724. .head 4 -  Font Enhancement: Default
  1725. .head 4 -  Picture File Name:
  1726. .head 4 -  Picture Transparent Color: None
  1727. .head 4 -  Image Style: Single
  1728. .head 4 -  Text Color: Default
  1729. .head 4 -  Background Color: Default
  1730. .head 4 +  Message Actions
  1731. .head 5 +  On SAM_Click
  1732. .head 6 +  If gnGraph
  1733. .head 7 -  Call Status( 'Graphing demo already running' )
  1734. .head 6 +  Else
  1735. .head 7 -  Call Status( 'A demonstration of VPE\'s graphing capabilities will appear in the main window. The calculations take a short time. Once computed, VPE can display the graph incredibly fast.' )
  1736. .head 7 -  Call Graph(  )
  1737. .head 7 -  Call SalEnableWindow( pbCloseGraph )
  1738. .head 3 +  Pushbutton: pbCloseGraph
  1739. .head 4 -  Class Child Ref Key: 0
  1740. .head 4 -  Class ChildKey: 0
  1741. .head 4 -  Class:
  1742. .head 4 -  Property Template:
  1743. .head 4 -  Class DLL Name:
  1744. .head 4 -  Title: Close
  1745. .head 4 -  Window Location and Size
  1746. .head 5 -  Left:   4.633"
  1747. .head 5 -  Top:    0.786"
  1748. .head 5 -  Width:  0.767"
  1749. .head 5 -  Width Editable? Yes
  1750. .head 5 -  Height: 0.238"
  1751. .head 5 -  Height Editable? Yes
  1752. .head 4 -  Visible? Yes
  1753. .head 4 -  Keyboard Accelerator: (none)
  1754. .head 4 -  Font Name: Default
  1755. .head 4 -  Font Size: Default
  1756. .head 4 -  Font Enhancement: Default
  1757. .head 4 -  Picture File Name:
  1758. .head 4 -  Picture Transparent Color: None
  1759. .head 4 -  Image Style: Single
  1760. .head 4 -  Text Color: Default
  1761. .head 4 -  Background Color: Default
  1762. .head 4 +  Message Actions
  1763. .head 5 +  On SAM_Create
  1764. .head 6 -  Call SalDisableWindow( hWndItem )
  1765. .head 5 +  On SAM_Click
  1766. .head 6 +  If NOT VpeCloseDoc( gnGraph )
  1767. .head 7 -  Call Status( 'Can\'t close, task \'Graphing\' is currently printing' )
  1768. .head 6 +  Else
  1769. .head 7 -  Call SalDisableWindow( hWndItem )
  1770. .head 7 -  Set gnGraph = 0
  1771. .head 3 +  ! Pushbutton: pbGenerateReport
  1772. .winattr
  1773. .head 4 -  Class Child Ref Key: 0
  1774. .head 4 -  Class ChildKey: 0
  1775. .head 4 -  Class:
  1776. .head 4 -  Property Template:
  1777. .head 4 -  Class DLL Name:
  1778. .head 4 -  Title: Generate Report
  1779. .head 4 -  Window Location and Size
  1780. .head 5 -  Left:   0.183"
  1781. .head 5 -  Top:    0.726"
  1782. .head 5 -  Width:  1.613"
  1783. .head 5 -  Width Editable? Yes
  1784. .head 5 -  Height: 0.238"
  1785. .head 5 -  Height Editable? Yes
  1786. .head 4 -  Visible? Yes
  1787. .head 4 -  Keyboard Accelerator: (none)
  1788. .head 4 -  Font Name: Default
  1789. .head 4 -  Font Size: Default
  1790. .head 4 -  Font Enhancement: Default
  1791. .head 4 -  Picture File Name:
  1792. .head 4 -  Picture Transparent Color: None
  1793. .head 4 -  Image Style: Single
  1794. .head 4 -  Text Color: Default
  1795. .head 4 -  Background Color: Default
  1796. .end
  1797. .head 4 +  Message Actions 
  1798. .head 5 +  On SAM_Click
  1799. .head 6 -  Call GenerateReport(  )
  1800. .head 3 +  ! Pushbutton: pbDeleteReport
  1801. .winattr
  1802. .head 4 -  Class Child Ref Key: 0
  1803. .head 4 -  Class ChildKey: 0
  1804. .head 4 -  Class:
  1805. .head 4 -  Property Template:
  1806. .head 4 -  Class DLL Name:
  1807. .head 4 -  Title: Delete Report
  1808. .head 4 -  Window Location and Size
  1809. .head 5 -  Left:   0.183"
  1810. .head 5 -  Top:    0.976"
  1811. .head 5 -  Width:  1.617"
  1812. .head 5 -  Width Editable? Yes
  1813. .head 5 -  Height: 0.238"
  1814. .head 5 -  Height Editable? Yes
  1815. .head 4 -  Visible? Yes
  1816. .head 4 -  Keyboard Accelerator: (none)
  1817. .head 4 -  Font Name: Default
  1818. .head 4 -  Font Size: Default
  1819. .head 4 -  Font Enhancement: Default
  1820. .head 4 -  Picture File Name:
  1821. .head 4 -  Picture Transparent Color: None
  1822. .head 4 -  Image Style: Single
  1823. .head 4 -  Text Color: Default
  1824. .head 4 -  Background Color: Default
  1825. .end
  1826. .head 4 +  Message Actions 
  1827. .head 5 +  On SAM_Click
  1828. .head 6 -  Call SalFileOpen( hFileRpt, RPT_PATH, OF_Delete )
  1829. .head 3 +  Pushbutton: pbSpeed
  1830. .head 4 -  Class Child Ref Key: 0
  1831. .head 4 -  Class ChildKey: 0
  1832. .head 4 -  Class:
  1833. .head 4 -  Property Template:
  1834. .head 4 -  Class DLL Name:
  1835. .head 4 -  Title: Speed + Tables...
  1836. .head 4 -  Window Location and Size
  1837. .head 5 -  Left:   1.883"
  1838. .head 5 -  Top:    1.119"
  1839. .head 5 -  Width:  2.567"
  1840. .head 5 -  Width Editable? Yes
  1841. .head 5 -  Height: 0.292"
  1842. .head 5 -  Height Editable? Yes
  1843. .head 4 -  Visible? Yes
  1844. .head 4 -  Keyboard Accelerator: (none)
  1845. .head 4 -  Font Name: Default
  1846. .head 4 -  Font Size: Default
  1847. .head 4 -  Font Enhancement: Default
  1848. .head 4 -  Picture File Name:
  1849. .head 4 -  Picture Transparent Color: None
  1850. .head 4 -  Image Style: Single
  1851. .head 4 -  Text Color: Default
  1852. .head 4 -  Background Color: Default
  1853. .head 4 +  Message Actions
  1854. .head 5 +  On SAM_Click
  1855. .head 6 +  If gnSpeed
  1856. .head 7 -  Call Status( 'Speed and Tables demo already running' )
  1857. .head 6 +  Else
  1858. .head 7 +  If NOT gbTableCreated
  1859. .head 8 -  Set sDatabase = 'GUPTA'
  1860. .head 8 -  Set sUser = 'SYSADM'
  1861. .head 8 -  Set sPassword = 'SYSADM'
  1862. .head 8 +  If SalModalDialog( dlgVpeLogin, hWndForm, sDatabase, sUser, sPassword )
  1863. .head 9 -  Set SqlDatabase = sDatabase
  1864. .head 9 -  Set SqlUser = sUser
  1865. .head 9 -  Set SqlPassword = sPassword
  1866. .head 9 +  When SqlError
  1867. .head 10 -  Call SalMessageBox( 'Database connection failed. Please ensure you are using a valid combination of database name, user name and password with the rights to create a table.', 'VPE Demo Database Login', MB_Ok )
  1868. .head 10 -  Return FALSE
  1869. .head 9 +  If SqlConnect( ghSql )
  1870. .head 10 +  When SqlError
  1871. .head 11 -  Return FALSE
  1872. .head 10 -  Set sSql = 
  1873. 'CREATE TABLE #VPE_DEMO (TABLE_NAME VARCHAR(9), TABLE_COUNT INT, TABLE_DATE DATE, AMOUNT DECIMAL(8,2), PRORATED_AMT DECIMAL(8,2), TAX_AMT DECIMAL(8,2), USER_COMMENT VARCHAR(200) )'
  1874. .head 10 +  If SqlPrepareAndExecute( ghSql, sSql )
  1875. .head 11 -  Call SqlCommit( ghSql )
  1876. .head 11 -  Call Status( 'Generating report demo data. This data will be deleted when you exit the demo. Please wait.' )
  1877. .head 11 -  Call GenerateData(  )
  1878. .head 11 -  Set gbTableCreated = TRUE
  1879. .head 10 +  Else
  1880. .head 11 -  Call SalMessageBox( 'VPE Demo was unable to create the table in the database for setting up the demo data. Please ensure that the user ID has sufficient rights to create a table in the database.', 'VPE Demo CREATE TABLE failed', MB_Ok )
  1881. .head 7 +  If gbTableCreated
  1882. .head 8 -  Call Status( 'Creating report from the database.' )
  1883. .head 8 -  Call PrintJournal(  )
  1884. .head 8 -  Call SalEnableWindow( pbCloseSpeed )
  1885. .head 3 +  Pushbutton: pbCloseSpeed
  1886. .head 4 -  Class Child Ref Key: 0
  1887. .head 4 -  Class ChildKey: 0
  1888. .head 4 -  Class:
  1889. .head 4 -  Property Template:
  1890. .head 4 -  Class DLL Name:
  1891. .head 4 -  Title: Close
  1892. .head 4 -  Window Location and Size
  1893. .head 5 -  Left:   4.633"
  1894. .head 5 -  Top:    1.143"
  1895. .head 5 -  Width:  0.767"
  1896. .head 5 -  Width Editable? Yes
  1897. .head 5 -  Height: 0.238"
  1898. .head 5 -  Height Editable? Yes
  1899. .head 4 -  Visible? Yes
  1900. .head 4 -  Keyboard Accelerator: (none)
  1901. .head 4 -  Font Name: Default
  1902. .head 4 -  Font Size: Default
  1903. .head 4 -  Font Enhancement: Default
  1904. .head 4 -  Picture File Name:
  1905. .head 4 -  Picture Transparent Color: None
  1906. .head 4 -  Image Style: Single
  1907. .head 4 -  Text Color: Default
  1908. .head 4 -  Background Color: Default
  1909. .head 4 +  Message Actions
  1910. .head 5 +  On SAM_Create
  1911. .head 6 -  Call SalDisableWindow( hWndItem )
  1912. .head 5 +  On SAM_Click
  1913. .head 6 +  If NOT VpeCloseDoc( gnSpeed )
  1914. .head 7 -  Call Status( 'Can\'t close, task \'Speed and Tables\' is currently printing' )
  1915. .head 6 +  Else
  1916. .head 7 -  Call SalDisableWindow( hWndItem )
  1917. .head 7 -  Set gnSpeed = 0
  1918. .head 3 +  Pushbutton: pbColors
  1919. .head 4 -  Class Child Ref Key: 0
  1920. .head 4 -  Class ChildKey: 0
  1921. .head 4 -  Class:
  1922. .head 4 -  Property Template:
  1923. .head 4 -  Class DLL Name:
  1924. .head 4 -  Title: Colors
  1925. .head 4 -  Window Location and Size
  1926. .head 5 -  Left:   1.883"
  1927. .head 5 -  Top:    1.476"
  1928. .head 5 -  Width:  2.567"
  1929. .head 5 -  Width Editable? Yes
  1930. .head 5 -  Height: 0.292"
  1931. .head 5 -  Height Editable? Yes
  1932. .head 4 -  Visible? Yes
  1933. .head 4 -  Keyboard Accelerator: (none)
  1934. .head 4 -  Font Name: Default
  1935. .head 4 -  Font Size: Default
  1936. .head 4 -  Font Enhancement: Default
  1937. .head 4 -  Picture File Name:
  1938. .head 4 -  Picture Transparent Color: None
  1939. .head 4 -  Image Style: Single
  1940. .head 4 -  Text Color: Default
  1941. .head 4 -  Background Color: Default
  1942. .head 4 +  Message Actions
  1943. .head 5 +  On SAM_Click
  1944. .head 6 +  If gnColors
  1945. .head 7 -  Call Status( 'Color test is already running' )
  1946. .head 6 +  Else
  1947. .head 7 -  Call SalWaitCursor( TRUE )
  1948. .head 7 -  Call colortest(  )
  1949. .head 7 -  Call SalWaitCursor( FALSE )
  1950. .head 7 -  Call SalEnableWindow( pbCloseColors )
  1951. .head 3 +  Pushbutton: pbCloseColors
  1952. .head 4 -  Class Child Ref Key: 0
  1953. .head 4 -  Class ChildKey: 0
  1954. .head 4 -  Class:
  1955. .head 4 -  Property Template:
  1956. .head 4 -  Class DLL Name:
  1957. .head 4 -  Title: Close
  1958. .head 4 -  Window Location and Size
  1959. .head 5 -  Left:   4.633"
  1960. .head 5 -  Top:    1.5"
  1961. .head 5 -  Width:  0.767"
  1962. .head 5 -  Width Editable? Yes
  1963. .head 5 -  Height: 0.238"
  1964. .head 5 -  Height Editable? Yes
  1965. .head 4 -  Visible? Yes
  1966. .head 4 -  Keyboard Accelerator: (none)
  1967. .head 4 -  Font Name: Default
  1968. .head 4 -  Font Size: Default
  1969. .head 4 -  Font Enhancement: Default
  1970. .head 4 -  Picture File Name:
  1971. .head 4 -  Picture Transparent Color: None
  1972. .head 4 -  Image Style: Single
  1973. .head 4 -  Text Color: Default
  1974. .head 4 -  Background Color: Default
  1975. .head 4 +  Message Actions
  1976. .head 5 +  On SAM_Create
  1977. .head 6 -  Call SalDisableWindow( hWndItem )
  1978. .head 5 +  On SAM_Click
  1979. .head 6 +  If NOT VpeCloseDoc( gnColors )
  1980. .head 7 -  Call Status( 'Can\'t close, task \'color test\' is currently printing' )
  1981. .head 6 +  Else
  1982. .head 7 -  Call SalDisableWindow( hWndItem )
  1983. .head 7 -  Set gnColors = 0
  1984. .head 3 +  Pushbutton: pbReport
  1985. .head 4 -  Class Child Ref Key: 0
  1986. .head 4 -  Class ChildKey: 0
  1987. .head 4 -  Class:
  1988. .head 4 -  Property Template:
  1989. .head 4 -  Class DLL Name:
  1990. .head 4 -  Title: Report
  1991. .head 4 -  Window Location and Size
  1992. .head 5 -  Left:   1.883"
  1993. .head 5 -  Top:    1.821"
  1994. .head 5 -  Width:  2.567"
  1995. .head 5 -  Width Editable? Yes
  1996. .head 5 -  Height: 0.292"
  1997. .head 5 -  Height Editable? Yes
  1998. .head 4 -  Visible? Yes
  1999. .head 4 -  Keyboard Accelerator: (none)
  2000. .head 4 -  Font Name: Default
  2001. .head 4 -  Font Size: Default
  2002. .head 4 -  Font Enhancement: Default
  2003. .head 4 -  Picture File Name:
  2004. .head 4 -  Picture Transparent Color: None
  2005. .head 4 -  Image Style: Single
  2006. .head 4 -  Text Color: Default
  2007. .head 4 -  Background Color: Default
  2008. .head 4 +  Message Actions
  2009. .head 5 +  On SAM_Click
  2010. .head 6 +  If gnReport
  2011. .head 7 -  Call Status( 'Report test is already running' )
  2012. .head 6 +  Else
  2013. .head 7 -  Call reporttest(  )
  2014. .head 7 -  Call SalEnableWindow( pbCloseReport )
  2015. .head 3 +  Pushbutton: pbCloseReport
  2016. .head 4 -  Class Child Ref Key: 0
  2017. .head 4 -  Class ChildKey: 0
  2018. .head 4 -  Class:
  2019. .head 4 -  Property Template:
  2020. .head 4 -  Class DLL Name:
  2021. .head 4 -  Title: Close
  2022. .head 4 -  Window Location and Size
  2023. .head 5 -  Left:   4.633"
  2024. .head 5 -  Top:    1.845"
  2025. .head 5 -  Width:  0.767"
  2026. .head 5 -  Width Editable? Yes
  2027. .head 5 -  Height: 0.238"
  2028. .head 5 -  Height Editable? Yes
  2029. .head 4 -  Visible? Yes
  2030. .head 4 -  Keyboard Accelerator: (none)
  2031. .head 4 -  Font Name: Default
  2032. .head 4 -  Font Size: Default
  2033. .head 4 -  Font Enhancement: Default
  2034. .head 4 -  Picture File Name:
  2035. .head 4 -  Picture Transparent Color: None
  2036. .head 4 -  Image Style: Single
  2037. .head 4 -  Text Color: Default
  2038. .head 4 -  Background Color: Default
  2039. .head 4 +  Message Actions
  2040. .head 5 +  On SAM_Create
  2041. .head 6 -  Call SalDisableWindow( hWndItem )
  2042. .head 5 +  On SAM_Click
  2043. .head 6 +  If NOT VpeCloseDoc( gnReport )
  2044. .head 7 -  Call Status( 'Can\'t close, task \'report test\' is currently printing' )
  2045. .head 6 +  Else
  2046. .head 7 -  Call SalDisableWindow( hWndItem )
  2047. .head 7 -  Set gnReport = 0
  2048. .head 3 +  Pushbutton: pbAutoRender
  2049. .head 4 -  Class Child Ref Key: 0
  2050. .head 4 -  Class ChildKey: 0
  2051. .head 4 -  Class:
  2052. .head 4 -  Property Template:
  2053. .head 4 -  Class DLL Name:
  2054. .head 4 -  Title: Auto Rendering
  2055. .head 4 -  Window Location and Size
  2056. .head 5 -  Left:   1.9"
  2057. .head 5 -  Top:    2.19"
  2058. .head 5 -  Width:  2.567"
  2059. .head 5 -  Width Editable? Yes
  2060. .head 5 -  Height: 0.292"
  2061. .head 5 -  Height Editable? Yes
  2062. .head 4 -  Visible? Yes
  2063. .head 4 -  Keyboard Accelerator: (none)
  2064. .head 4 -  Font Name: Default
  2065. .head 4 -  Font Size: Default
  2066. .head 4 -  Font Enhancement: Default
  2067. .head 4 -  Picture File Name:
  2068. .head 4 -  Picture Transparent Color: None
  2069. .head 4 -  Image Style: Single
  2070. .head 4 -  Text Color: Default
  2071. .head 4 -  Background Color: Default
  2072. .head 4 +  Message Actions
  2073. .head 5 +  On SAM_Click
  2074. .head 6 +  If gnAutoRender
  2075. .head 7 -  Call Status( 'Auto Render Demo is already running' )
  2076. .head 6 +  Else
  2077. .head 7 +  If AutoRender(  )
  2078. .head 8 -  Call SalEnableWindow( pbCloseAutoRender )
  2079. .head 3 +  Pushbutton: pbCloseAutoRender
  2080. .head 4 -  Class Child Ref Key: 0
  2081. .head 4 -  Class ChildKey: 0
  2082. .head 4 -  Class:
  2083. .head 4 -  Property Template:
  2084. .head 4 -  Class DLL Name:
  2085. .head 4 -  Title: Close
  2086. .head 4 -  Window Location and Size
  2087. .head 5 -  Left:   4.65"
  2088. .head 5 -  Top:    2.214"
  2089. .head 5 -  Width:  0.767"
  2090. .head 5 -  Width Editable? Yes
  2091. .head 5 -  Height: 0.238"
  2092. .head 5 -  Height Editable? Yes
  2093. .head 4 -  Visible? Yes
  2094. .head 4 -  Keyboard Accelerator: (none)
  2095. .head 4 -  Font Name: Default
  2096. .head 4 -  Font Size: Default
  2097. .head 4 -  Font Enhancement: Default
  2098. .head 4 -  Picture File Name:
  2099. .head 4 -  Picture Transparent Color: None
  2100. .head 4 -  Image Style: Single
  2101. .head 4 -  Text Color: Default
  2102. .head 4 -  Background Color: Default
  2103. .head 4 +  Message Actions
  2104. .head 5 +  On SAM_Create
  2105. .head 6 -  Call SalDisableWindow( hWndItem )
  2106. .head 5 +  On SAM_Click
  2107. .head 6 +  If NOT VpeCloseDoc( gnAutoRender )
  2108. .head 7 -  Call Status( "Can't close, task 'Auto Render Demo' is currently printing" )
  2109. .head 6 +  Else
  2110. .head 7 -  Call SalDisableWindow( hWndItem )
  2111. .head 7 -  Set gnAutoRender = 0
  2112. .head 3 +  Pushbutton: pbExit
  2113. .head 4 -  Class Child Ref Key: 0
  2114. .head 4 -  Class ChildKey: 0
  2115. .head 4 -  Class:
  2116. .head 4 -  Property Template:
  2117. .head 4 -  Class DLL Name:
  2118. .head 4 -  Title: Exit
  2119. .head 4 -  Window Location and Size
  2120. .head 5 -  Left:   2.617"
  2121. .head 5 -  Top:    2.643"
  2122. .head 5 -  Width:  1.1"
  2123. .head 5 -  Width Editable? Yes
  2124. .head 5 -  Height: 0.292"
  2125. .head 5 -  Height Editable? Yes
  2126. .head 4 -  Visible? Yes
  2127. .head 4 -  Keyboard Accelerator: (none)
  2128. .head 4 -  Font Name: Default
  2129. .head 4 -  Font Size: Default
  2130. .head 4 -  Font Enhancement: Default
  2131. .head 4 -  Picture File Name:
  2132. .head 4 -  Picture Transparent Color: None
  2133. .head 4 -  Image Style: Single
  2134. .head 4 -  Text Color: Default
  2135. .head 4 -  Background Color: Default
  2136. .head 4 +  Message Actions
  2137. .head 5 +  On SAM_Click
  2138. .head 6 -  Call SalSendMsg( ghWndMain, SAM_Close, 0, 0 )
  2139. .head 3 +  Multiline Field: mlStatus
  2140. .head 4 -  Class Child Ref Key: 0
  2141. .head 4 -  Class ChildKey: 0
  2142. .head 4 -  Class:
  2143. .head 4 -  Property Template:
  2144. .head 4 -  Class DLL Name:
  2145. .head 4 -  Data
  2146. .head 5 -  Maximum Data Length: 1000
  2147. .head 5 -  String Type: String
  2148. .head 5 -  Editable? Yes
  2149. .head 4 -  Display Settings
  2150. .head 5 -  Border? No
  2151. .head 5 -  Word Wrap? Yes
  2152. .head 5 -  Vertical Scroll? No
  2153. .head 5 -  Window Location and Size
  2154. .head 6 -  Left:   0.233"
  2155. .head 6 -  Top:    3.012"
  2156. .head 6 -  Width:  5.85"
  2157. .head 6 -  Width Editable? Yes
  2158. .head 6 -  Height: 0.643"
  2159. .head 6 -  Height Editable? Yes
  2160. .head 5 -  Visible? Yes
  2161. .head 5 -  Font Name: Default
  2162. .head 5 -  Font Size: Default
  2163. .head 5 -  Font Enhancement: Default
  2164. .head 5 -  Text Color: Default
  2165. .head 5 -  Background Color: Gray
  2166. .head 4 +  Message Actions
  2167. .head 5 +  On SAM_Create
  2168. .head 6 -  Call SalDisableWindow( hWndItem )
  2169. .head 2 +  Functions
  2170. .head 3 +  Function: Status
  2171. .head 4 -  Description:
  2172. .head 4 -  Returns
  2173. .head 4 +  Parameters
  2174. .head 5 -  String: sStatusText
  2175. .head 4 -  Static Variables
  2176. .head 4 -  Local variables
  2177. .head 4 +  Actions
  2178. .head 5 -  Set mlStatus = sStatusText
  2179. .head 2 -  Window Parameters
  2180. .head 2 +  Window Variables
  2181. .head 3 -  String: sDatabase
  2182. .head 3 -  String: sUser
  2183. .head 3 -  String: sPassword
  2184. .head 3 -  String: sSql
  2185. .head 2 +  Message Actions
  2186. .head 3 +  On WM_COMMAND
  2187. .head 4 -  Call Status( '' )
  2188. .head 3 +  On WM_KEYDOWN
  2189. .head 4 +  If (gnPrecision) ! this is an embedded window
  2190. .head 5 -  Call SalSendMsg( VpeWindowHandle( gnPrecision ), WM_KEYDOWN, wParam, lParam )
  2191. .head 5 -  Return 0
  2192. .head 4 +  Else If (gnGraph)
  2193. .head 5 -  Call SalSendMsg( VpeWindowHandle( gnGraph ), WM_KEYDOWN, wParam, lParam )
  2194. .head 5 -  Return 0
  2195. .head 3 +  On SAM_Create
  2196. .head 4 -  Set gbTableCreated = FALSE
  2197. .head 1 +  Dialog Box: dlgVpeLogin
  2198. .head 2 -  Class:
  2199. .head 2 -  Property Template:
  2200. .head 2 -  Class DLL Name:
  2201. .head 2 -  Title: VPE Demo Database Login
  2202. .head 2 -  Accesories Enabled? No
  2203. .head 2 -  Visible? Yes
  2204. .head 2 -  Display Settings
  2205. .head 3 -  Display Style? Default
  2206. .head 3 -  Visible at Design time? No
  2207. .head 3 -  Type of Dialog: Modal
  2208. .head 3 -  Window Location and Size
  2209. .head 4 -  Left:   1.413"
  2210. .head 4 -  Top:    1.083"
  2211. .head 4 -  Width:  6.267"
  2212. .head 4 -  Width Editable? Yes
  2213. .head 4 -  Height: 3.417"
  2214. .head 4 -  Height Editable? Yes
  2215. .head 3 -  Absolute Screen Location? No
  2216. .head 3 -  Font Name: Arial
  2217. .head 3 -  Font Size: 8
  2218. .head 3 -  Font Enhancement: Default
  2219. .head 3 -  Text Color: Default
  2220. .head 3 -  Background Color: Default
  2221. .head 2 -  Description:
  2222. .head 2 +  Tool Bar
  2223. .head 3 -  Display Settings
  2224. .head 4 -  Display Style? Default
  2225. .head 4 -  Location? Top
  2226. .head 4 -  Visible? Yes
  2227. .head 4 -  Size: Default
  2228. .head 4 -  Size Editable? Yes
  2229. .head 4 -  Font Name: Default
  2230. .head 4 -  Font Size: Default
  2231. .head 4 -  Font Enhancement: Default
  2232. .head 4 -  Text Color: Default
  2233. .head 4 -  Background Color: Default
  2234. .head 3 -  Contents
  2235. .head 2 +  Contents
  2236. .head 3 -  Background Text: This part of the VPE demo shows how VPE can be used to generate reports from a SQL database.
  2237.  
  2238. VPE Demo needs to connect to a database with a user ID that has the rights to create a new table. The table will be deleted upon completion of this part of the demo. 
  2239.  
  2240. Please provide connection information. The default values are suitable for a standard SQLWindows 5.0 installation.
  2241. .head 4 -  Resource Id: 4310
  2242. .head 4 -  Class Child Ref Key: 0
  2243. .head 4 -  Class ChildKey: 0
  2244. .head 4 -  Class:
  2245. .head 4 -  Window Location and Size
  2246. .head 5 -  Left:   0.383"
  2247. .head 5 -  Top:    0.048"
  2248. .head 5 -  Width:  5.333"
  2249. .head 5 -  Width Editable? Yes
  2250. .head 5 -  Height: 1.512"
  2251. .head 5 -  Height Editable? Yes
  2252. .head 4 -  Visible? Yes
  2253. .head 4 -  Justify: Left
  2254. .head 4 -  Font Name: Default
  2255. .head 4 -  Font Size: Default
  2256. .head 4 -  Font Enhancement: Bold
  2257. .head 4 -  Text Color: Default
  2258. .head 4 -  Background Color: Default
  2259. .head 3 -  Background Text: &Database:
  2260. .head 4 -  Resource Id: 4311
  2261. .head 4 -  Class Child Ref Key: 0
  2262. .head 4 -  Class ChildKey: 0
  2263. .head 4 -  Class:
  2264. .head 4 -  Window Location and Size
  2265. .head 5 -  Left:   1.3"
  2266. .head 5 -  Top:    1.714"
  2267. .head 5 -  Width:  0.867"
  2268. .head 5 -  Width Editable? Yes
  2269. .head 5 -  Height: 0.167"
  2270. .head 5 -  Height Editable? Yes
  2271. .head 4 -  Visible? Yes
  2272. .head 4 -  Justify: Left
  2273. .head 4 -  Font Name: Default
  2274. .head 4 -  Font Size: Default
  2275. .head 4 -  Font Enhancement: Default
  2276. .head 4 -  Text Color: Default
  2277. .head 4 -  Background Color: Default
  2278. .head 3 +  Data Field: dfDatabase
  2279. .head 4 -  Class Child Ref Key: 0
  2280. .head 4 -  Class ChildKey: 0
  2281. .head 4 -  Class:
  2282. .head 4 -  Property Template:
  2283. .head 4 -  Class DLL Name:
  2284. .head 4 -  Data
  2285. .head 5 -  Maximum Data Length: Default
  2286. .head 5 -  Data Type: String
  2287. .head 5 -  Editable? Yes
  2288. .head 4 -  Display Settings
  2289. .head 5 -  Window Location and Size
  2290. .head 6 -  Left:   2.667"
  2291. .head 6 -  Top:    1.679"
  2292. .head 6 -  Width:  1.983"
  2293. .head 6 -  Width Editable? Yes
  2294. .head 6 -  Height: 0.25"
  2295. .head 6 -  Height Editable? Yes
  2296. .head 5 -  Visible? Yes
  2297. .head 5 -  Border? Yes
  2298. .head 5 -  Justify: Left
  2299. .head 5 -  Format: Unformatted
  2300. .head 5 -  Country: Default
  2301. .head 5 -  Font Name: Default
  2302. .head 5 -  Font Size: Default
  2303. .head 5 -  Font Enhancement: Default
  2304. .head 5 -  Text Color: Default
  2305. .head 5 -  Background Color: Default
  2306. .head 5 -  Input Mask: Unformatted
  2307. .head 4 -  Message Actions
  2308. .head 3 -  Background Text: &User:
  2309. .head 4 -  Resource Id: 4312
  2310. .head 4 -  Class Child Ref Key: 0
  2311. .head 4 -  Class ChildKey: 0
  2312. .head 4 -  Class:
  2313. .head 4 -  Window Location and Size
  2314. .head 5 -  Left:   1.3"
  2315. .head 5 -  Top:    2.024"
  2316. .head 5 -  Width:  0.867"
  2317. .head 5 -  Width Editable? Yes
  2318. .head 5 -  Height: 0.167"
  2319. .head 5 -  Height Editable? Yes
  2320. .head 4 -  Visible? Yes
  2321. .head 4 -  Justify: Left
  2322. .head 4 -  Font Name: Default
  2323. .head 4 -  Font Size: Default
  2324. .head 4 -  Font Enhancement: Default
  2325. .head 4 -  Text Color: Default
  2326. .head 4 -  Background Color: Default
  2327. .head 3 +  Data Field: dfUser
  2328. .head 4 -  Class Child Ref Key: 0
  2329. .head 4 -  Class ChildKey: 0
  2330. .head 4 -  Class:
  2331. .head 4 -  Property Template:
  2332. .head 4 -  Class DLL Name:
  2333. .head 4 -  Data
  2334. .head 5 -  Maximum Data Length: Default
  2335. .head 5 -  Data Type: String
  2336. .head 5 -  Editable? Yes
  2337. .head 4 -  Display Settings
  2338. .head 5 -  Window Location and Size
  2339. .head 6 -  Left:   2.667"
  2340. .head 6 -  Top:    1.988"
  2341. .head 6 -  Width:  1.983"
  2342. .head 6 -  Width Editable? Yes
  2343. .head 6 -  Height: 0.25"
  2344. .head 6 -  Height Editable? Yes
  2345. .head 5 -  Visible? Yes
  2346. .head 5 -  Border? Yes
  2347. .head 5 -  Justify: Left
  2348. .head 5 -  Format: Unformatted
  2349. .head 5 -  Country: Default
  2350. .head 5 -  Font Name: Default
  2351. .head 5 -  Font Size: Default
  2352. .head 5 -  Font Enhancement: Default
  2353. .head 5 -  Text Color: Default
  2354. .head 5 -  Background Color: Default
  2355. .head 5 -  Input Mask: Unformatted
  2356. .head 4 -  Message Actions
  2357. .head 3 -  Background Text: &Password:
  2358. .head 4 -  Resource Id: 4313
  2359. .head 4 -  Class Child Ref Key: 0
  2360. .head 4 -  Class ChildKey: 0
  2361. .head 4 -  Class:
  2362. .head 4 -  Window Location and Size
  2363. .head 5 -  Left:   1.3"
  2364. .head 5 -  Top:    2.333"
  2365. .head 5 -  Width:  0.867"
  2366. .head 5 -  Width Editable? Yes
  2367. .head 5 -  Height: 0.167"
  2368. .head 5 -  Height Editable? Yes
  2369. .head 4 -  Visible? Yes
  2370. .head 4 -  Justify: Left
  2371. .head 4 -  Font Name: Default
  2372. .head 4 -  Font Size: Default
  2373. .head 4 -  Font Enhancement: Default
  2374. .head 4 -  Text Color: Default
  2375. .head 4 -  Background Color: Default
  2376. .head 3 +  Data Field: dfPassword
  2377. .head 4 -  Class Child Ref Key: 0
  2378. .head 4 -  Class ChildKey: 0
  2379. .head 4 -  Class:
  2380. .head 4 -  Property Template:
  2381. .head 4 -  Class DLL Name:
  2382. .head 4 -  Data
  2383. .head 5 -  Maximum Data Length: Default
  2384. .head 5 -  Data Type: String
  2385. .head 5 -  Editable? Yes
  2386. .head 4 -  Display Settings
  2387. .head 5 -  Window Location and Size
  2388. .head 6 -  Left:   2.667"
  2389. .head 6 -  Top:    2.298"
  2390. .head 6 -  Width:  1.983"
  2391. .head 6 -  Width Editable? Yes
  2392. .head 6 -  Height: 0.25"
  2393. .head 6 -  Height Editable? Yes
  2394. .head 5 -  Visible? Yes
  2395. .head 5 -  Border? Yes
  2396. .head 5 -  Justify: Left
  2397. .head 5 -  Format: Invisible
  2398. .head 5 -  Country: Default
  2399. .head 5 -  Font Name: Default
  2400. .head 5 -  Font Size: Default
  2401. .head 5 -  Font Enhancement: Default
  2402. .head 5 -  Text Color: Default
  2403. .head 5 -  Background Color: Default
  2404. .head 5 -  Input Mask: Unformatted
  2405. .head 4 -  Message Actions
  2406. .head 3 +  Pushbutton: pbLogin
  2407. .head 4 -  Class Child Ref Key: 0
  2408. .head 4 -  Class ChildKey: 0
  2409. .head 4 -  Class:
  2410. .head 4 -  Property Template:
  2411. .head 4 -  Class DLL Name:
  2412. .head 4 -  Title: &Login
  2413. .head 4 -  Window Location and Size
  2414. .head 5 -  Left:   1.85"
  2415. .head 5 -  Top:    2.631"
  2416. .head 5 -  Width:  1.2"
  2417. .head 5 -  Width Editable? Yes
  2418. .head 5 -  Height: 0.298"
  2419. .head 5 -  Height Editable? Yes
  2420. .head 4 -  Visible? Yes
  2421. .head 4 -  Keyboard Accelerator: Enter
  2422. .head 4 -  Font Name: Default
  2423. .head 4 -  Font Size: Default
  2424. .head 4 -  Font Enhancement: Default
  2425. .head 4 -  Picture File Name:
  2426. .head 4 -  Picture Transparent Color: None
  2427. .head 4 -  Image Style: Single
  2428. .head 4 -  Text Color: Default
  2429. .head 4 -  Background Color: Default
  2430. .head 4 +  Message Actions
  2431. .head 5 +  On SAM_Click
  2432. .head 6 -  Call SalSendMsg( hWndForm, SAM_Close, TRUE, 0 )
  2433. .head 3 +  Pushbutton: pbCancel
  2434. .head 4 -  Class Child Ref Key: 0
  2435. .head 4 -  Class ChildKey: 0
  2436. .head 4 -  Class:
  2437. .head 4 -  Property Template:
  2438. .head 4 -  Class DLL Name:
  2439. .head 4 -  Title: Cancel
  2440. .head 4 -  Window Location and Size
  2441. .head 5 -  Left:   3.183"
  2442. .head 5 -  Top:    2.631"
  2443. .head 5 -  Width:  1.2"
  2444. .head 5 -  Width Editable? Yes
  2445. .head 5 -  Height: 0.298"
  2446. .head 5 -  Height Editable? Yes
  2447. .head 4 -  Visible? Yes
  2448. .head 4 -  Keyboard Accelerator: Esc
  2449. .head 4 -  Font Name: Default
  2450. .head 4 -  Font Size: Default
  2451. .head 4 -  Font Enhancement: Default
  2452. .head 4 -  Picture File Name:
  2453. .head 4 -  Picture Transparent Color: None
  2454. .head 4 -  Image Style: Single
  2455. .head 4 -  Text Color: Default
  2456. .head 4 -  Background Color: Default
  2457. .head 4 +  Message Actions
  2458. .head 5 +  On SAM_Click
  2459. .head 6 -  Call SalSendMsg( hWndForm, SAM_Close, FALSE, 0 )
  2460. .head 2 -  Functions
  2461. .head 2 +  Window Parameters
  2462. .head 3 -  String: p_sDatabase
  2463. .head 3 -  String: p_sUser
  2464. .head 3 -  String: p_sPassword
  2465. .head 2 -  Window Variables
  2466. .head 2 +  Message Actions
  2467. .head 3 +  On SAM_Create
  2468. .head 4 -  Call SalCenterWindow( hWndForm )
  2469. .head 4 -  Set dfDatabase = p_sDatabase
  2470. .head 4 -  Set dfUser = p_sUser
  2471. .head 4 -  Set dfPassword = p_sPassword
  2472. .head 3 +  On SAM_Close
  2473. .head 4 +  If wParam
  2474. .head 5 -  Set p_sDatabase = dfDatabase
  2475. .head 5 -  Set p_sUser = dfUser
  2476. .head 5 -  Set p_sPassword = dfPassword
  2477. .head 4 -  Call SalEndDialog( hWndForm, wParam )
  2478.