home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wpentk.zip / WBPENTK1.DSK / SKETSAMP.IPF < prev    next >
Text File  |  1994-10-06  |  29KB  |  801 lines

  1. .*****************************************************************************/
  2. .*                                                                           */
  3. .*  File Name   : SKETSAMP.IPF                                               */
  4. .*                                                                           */
  5. .*  Description : Sketch Controls Sample Program Information File            */
  6. .*                                                                           */
  7. .*                                                                           */
  8. .*  Copyright (C) 1993 IBM Corporation                                       */
  9. .*                                                                           */
  10. .*      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is          */
  11. .*      sample code created by IBM Corporation. This sample code is not      */
  12. .*      part of any standard or IBM product and is provided to you solely    */
  13. .*      for  the purpose of assisting you in the development of your         */
  14. .*      applications.  The code is provided "AS IS", without                 */
  15. .*      warranty of any kind.  IBM shall not be liable for any damages       */
  16. .*      arising out of your use of the sample code, even if they have been   */
  17. .*      advised of the possibility of such damages.                          */
  18. .*                                                                           */
  19. .*****************************************************************************/
  20. :userdoc
  21. .****************************************************************/
  22. .*  Help from Sketch Window                                     */
  23. .*  PANEL_SKETCH                                                */
  24. .****************************************************************/
  25. :h1 res=804.Sketch Input Window
  26. You can draw or sketch to this window.
  27. Press "SELECT CONTROL" to display a list box containing a list of
  28. SKETCH control messages to choose from.  To execute a particular control
  29. message, highlight an item from the list box and press "OK".  To get help
  30. for a particular control message, highlight an item from the list box and press
  31. "HELP".
  32. .****************************************************************/
  33. .*  Help for Control Message Selection                          */
  34. .*  PANEL_MESSAGE      F1                                       */
  35. .****************************************************************/
  36. :h1 res=805.Control Message Selection
  37. Highlight an item from the list box and press "HELP" to display help for
  38. a particular Control Message.
  39. :p.
  40. Highlight an item from the list box and press "OK" to execute the Message.
  41. .****************************************************************/
  42. .*  Help for Auxiliary Data choice dialog                       */
  43. .*  PANEL_AUX                                                   */
  44. .****************************************************************/
  45. :h1 res=806.Auxiliary Data
  46. Choose "No Auxiliary Data" to send a zero value with SKM_SET_CTL_AUXDATA_MODE
  47. and retrieve no auxiliary data for subsequent strokes.
  48. Choose "All Auxiliary Data" to send a value of ADF_ALL with
  49. SKM_SET_CTL_AUXDATA_MODE and retrieve all auxiliary data for subsequent
  50. strokes.
  51. .****************************************************************/
  52. .*  Help for SKM_DELETE_ALL_STROKES                             */
  53. .*  PANEL_SKM_DELETE_ALL_STROKES                                */
  54. .****************************************************************/
  55. :h1 res=815.SKM_DELETE_ALL_STROKES
  56. This Control Message is sent to the control to request deletion of all
  57. strokes in the stroke database.
  58. :lines.
  59. Returns:
  60. TRUE  - Success (All strokes deleted)
  61. FALSE - No strokes in the stroke database to delete.
  62. :elines.
  63. :p.
  64. :hp4.Example:
  65. :xmp.
  66. :font facename=Helv size=10x10.
  67. BOOL      rc;
  68. :p.
  69. rc = (BOOL) WinSendMsg(hSKETCHControl,
  70.                        SKM_DELETE_ALL_STROKES,
  71.                        NULL,
  72.                        NULL);
  73. :ehp4.
  74. :font facename=default.
  75. :exmp.
  76. :p.
  77. Press "OK" to execute control message SKM_DELETE_ALL_STROKES.
  78. .****************************************************************/
  79. .*  Help for SKM_UNDO_LAST_STROKE                               */
  80. .*  PANEL_SKM_UNDO_LAST_STROKE                                  */
  81. .****************************************************************/
  82. :h1 res=816.SKM_UNDO_LAST_STROKE
  83. This message tells the control to clear the ink of the last stroke
  84. and to delete it from the stroke database.
  85. :lines.
  86. Returns:
  87. TRUE  - Success (Last stroke deleted)
  88. FALSE - No strokes in the stroke database to undo.
  89. :elines.
  90. :p.
  91. :hp4.Example:
  92. :xmp.
  93. :font facename=Helv size=10x10.
  94. BOOL      rc;
  95. :p.
  96. rc = (BOOL) WinSendMsg(hSKETCHControl,
  97.                        SKM_UNDO_LAST_STROKE,
  98.                        NULL,
  99.                        NULL);
  100. :ehp4.
  101. :font facename=default.
  102. :exmp.
  103. :p.
  104. Press "OK" to execute control message SKM_UNDO_LAST_STROKE.
  105. .****************************************************************/
  106. .*  Help for SKM_QUERY_CTL_DRAW_POINTER                         */
  107. .*  PANEL_SKM_QUERY_CTL_DRAW_POINTER                            */
  108. .****************************************************************/
  109. :h1 res=817.SKM_QUERY_CTL_DRAW_POINTER
  110. This message returns the drawing pointer handle.
  111. :p.
  112. :hp4.Example:
  113. :xmp.
  114. :font facename=Helv size=10x10.
  115. HPOINTER  DrawPtr;
  116. :p.
  117. DrawPtr = (HPOINTER) WinSendMsg(hSKETCHControl,
  118.                                 SKM_QUERY_CTL_DRAW_POINTER,
  119.                                 NULL,
  120.                                 NULL);
  121. :ehp4.
  122. :font facename=default.
  123. :exmp.
  124. :p.
  125. Press "OK" to execute control message SKM_QUERY_CTL_DRAW_POINTER.
  126. .****************************************************************/
  127. .*  Help for SKM_QUERY_CTL_INK_WIDTH                            */
  128. .*  PANEL_SKM_QUERY_INK_CTL_WIDTH                               */
  129. .****************************************************************/
  130. :h1 res=818.SKM_QUERY_CTL_INK_WIDTH
  131. This message returns the control's current ink width.
  132. :lines.
  133. Returns:
  134. ULONG ulWidth - Control Ink Width
  135. FALSE         - Failure
  136. :elines.
  137. :p.
  138. :hp4.Example:
  139. :xmp.
  140. :font facename=Helv size=10x10.
  141. ULONG ulWidth;
  142. :p.
  143. ulWidth = (ULONG) WinSendMsg(hSKETCHControl,
  144.                              SKM_QUERY_CTL_INK_WIDTH,
  145.                              NULL,
  146.                              NULL);
  147. :ehp4.
  148. :font facename=default.
  149. :exmp.
  150. :p.
  151. Press "OK" to execute control message SKM_QUERY_CTL_INK_WIDTH.
  152. .****************************************************************/
  153. .*  Help for SKM_QUERY_CTL_INK_COLOR                            */
  154. .*  PANEL_SKM_QUERY_CTL_INK_COLOR                               */
  155. .****************************************************************/
  156. :h1 res=819.SKM_QUERY_CTL_INK_COLOR
  157. This message returns the control's current ink color.
  158. :lines.
  159. Returns:
  160. LONG lColor - Control Ink Color
  161. CLR_ERROR -   Failure
  162. :elines.
  163. :p.
  164. :hp4.Example:
  165. :xmp.
  166. :font facename=Helv size=10x10.
  167. LONG  lColor;
  168. :p.
  169. lColor = (LONG) WinSendMsg(hSKETCHControl,
  170.                            SKM_QUERY_CTL_INK_COLOR,
  171.                            NULL,
  172.                            NULL);
  173. :ehp4.
  174. :font facename=default.
  175. :exmp.
  176. :p.
  177. Press "OK" to execute control message SKM_QUERY_CTL_INK_COLOR.
  178. .****************************************************************/
  179. .*  Help for SKM_QUERY_CTL_INVISIBLE_MODE                       */
  180. .*  PANEL_SKM_QUERY_CTL_INVISIBLE_MODE                          */
  181. .****************************************************************/
  182. :h1 res=820.SKM_QUERY_CTL_INVISIBLE_MODE
  183. This message queries the display mode of the ink, whether it is visible or
  184. invisible.
  185. :lines.
  186. Returns:
  187. TRUE  - Ink is invisible.
  188. FALSE - Ink is visible.
  189. :elines.
  190. :p.
  191. :hp4.Example:
  192. :xmp.
  193. :font facename=Helv size=10x10.
  194. USHORT    usInvisible;
  195. :p.
  196. usInvisible = (USHORT) WinSendMsg(hSKETCHControl,
  197.                                   SKM_QUERY_CTL_INVISIBLE_MODE,
  198.                                   NULL,
  199.                                   NULL);
  200. :ehp4.
  201. :font facename=default.
  202. :exmp.
  203. :p.
  204. Press "OK" to execute control message SKM_QUERY_CTL_INVISIBLE_MODE.
  205. .****************************************************************/
  206. .*  Help for SKM_SET_CTL_DRAW_POINTER                           */
  207. .*  PANEL_SKM_SET_CTL_DRAW_POINTER                              */
  208. .****************************************************************/
  209. :h1 res=821.SKM_SET_CTL_DRAW_POINTER
  210. This message sets the drawing pointer handle and returns the previous pointer.
  211. :p.
  212. :hp4.Example:
  213. :xmp.
  214. :font facename=Helv size=10x10.
  215. HPOINTER OldDrawPtr;
  216. HPOINTER NewDrawPtr;
  217. POINTER   PTR_PEN   blackpen.ptr
  218. :p.
  219. NewDrawPtr = WinLoadPointer(HWND_DESKTOP, 0L, PTR_PEN);
  220. OldDrawPtr = (HPOINTER)WinSendMsg(hSKETCHControl,
  221.                                   SKM_SET_CTL_DRAW_POINTER,
  222.                                   MPFROMLONG(NewDrawPtr),
  223.                                   NULL);
  224. :ehp4.
  225. :font facename=default.
  226. :exmp.
  227. :p.
  228. Press "OK" to execute control message SKM_SET_CTL_DRAW_POINTER.
  229. .****************************************************************/
  230. .*  Help for SKM_SET_CTL_INK_WIDTH                              */
  231. .*  PANEL_SKM_SET_CTL_INK_WIDTH                                 */
  232. .****************************************************************/
  233. :h1 res=822.SKM_SET_CTL_INK_WIDTH
  234. This message sets the drawing stroke ink width for the control.
  235. Strokes created after this message will have the newly set width.
  236. The choices for the width are one or two pels.  The default ink
  237. width is one pel.
  238. :lines.
  239. Returns:
  240. TRUE  - Success
  241. FALSE - Ink width cannot be set.
  242. :elines.
  243. :p.
  244. :hp4.Example:
  245. :xmp.
  246. :font facename=Helv size=10x10.
  247. BOOL  rc;
  248. ULONG ulWidth = 2;
  249. :p.
  250. rc = (BOOL) WinSendMsg(hSKETCHControl,
  251.                        SKM_SET_CTL_INK_WIDTH,
  252.                        MPFROMLONG(ulWidth2),
  253.                        NULL);
  254. :ehp4.
  255. :font facename=default.
  256. :exmp.
  257. :p.
  258. Press "OK" to execute control message SKM_SET_CTL_INK_WIDTH.
  259. .****************************************************************/
  260. .*  Help for SKM_SET_CTL_INK_COLOR                              */
  261. .*  PANEL_SKM_SET_CTL_INK_COLOR                                 */
  262. .****************************************************************/
  263. :h1 res=823.SKM_SET_CTL_INK_COLOR
  264. This message sets the drawing stroke color for the control.
  265. Strokes created after this message will have the newly set color.
  266. :lines.
  267. Returns:
  268. TRUE  - Success
  269. FALSE - Ink color cannot be set.
  270. :elines.
  271. :p.
  272. :hp4.Example:
  273. :xmp.
  274. :font facename=Helv size=10x10.
  275. BOOL      rc;
  276. :p.
  277. rc = (BOOL) WinSendMsg(hSKETCHControl,
  278.                        SKM_SET_CTL_INK_COLOR,
  279.                        MPFROMLONG(CLR_RED),
  280.                        NULL);
  281. :ehp4.
  282. :font facename=default.
  283. :exmp.
  284. :p.
  285. Press "OK" to execute control message SKM_SET_CTL_INK_COLOR.
  286. .****************************************************************/
  287. .*  Help for SKM_SET_CTL_INVISIBLE_MODE                         */
  288. .*  PANEL_SKM_SET_CTL_INVISIBLE_MODE                            */
  289. .****************************************************************/
  290. :h1 res=824.SKM_SET_CTL_INVISIBLE_MODE
  291. This message sets the ink color to be invisible or visible.
  292. Set param1 to TRUE if you wish to select invisible ink.
  293. Set param1 to FALSE if you wish to select visible ink.
  294. :lines.
  295. Returns:
  296. TRUE  - Success
  297. FALSE - Failure
  298. :elines.
  299. :p.
  300. :hp4.Example:
  301. :xmp.
  302. :font facename=Helv size=10x10.
  303. BOOL   rc;
  304. USHORT usInvisible = TRUE;
  305. :p.
  306. rc =  (BOOL) WinSendMsg(hSKETCHControl,
  307.                         SKM_SET_CTL_INVISIBLE_MODE
  308.                         MPFROMSHORT(usInvisible),
  309.                         NULL);
  310. :ehp4.
  311. :font facename=default.
  312. :exmp.
  313. :p.
  314. Press "OK" to select invisible or visible mode and execute.
  315. .****************************************************************/
  316. .*  Help for SKM_RENDER_TO_CLIPBOARD                            */
  317. .*  PANEL_SKM_RENDER_TO_CLIPBOARD                               */
  318. .****************************************************************/
  319. :h1 res=825.SKM_RENDER_TO_CLIPBOARD
  320. This message copies the screen resolution bitmap image from the sketch
  321. control to the Clipboard.
  322. :lines.
  323. Returns:
  324. TRUE  - Success
  325. FALSE - Failure
  326. :elines.
  327. :p.
  328. :hp4.Example:
  329. :xmp.
  330. :font facename=Helv size=10x10.
  331. BOOL      rc;
  332. :p.
  333. rc = (BOOL) WinSendMsg(hSKETCHControl,
  334.                        SKM_RENDER_TO_CLIPBOARD,
  335.                        NULL,
  336.                        NULL);
  337. :ehp4.
  338. :font facename=default.
  339. :exmp.
  340. :p.
  341. Press "OK" to execute control message SKM_RENDER_TO_CLIPBOARD.
  342. .****************************************************************/
  343. .*  Help for SKM_QUERY_CTL_STROKE_COUNT                         */
  344. .*  PANEL_SKM_QUERY_CTL_STROKE_COUNT                            */
  345. .****************************************************************/
  346. :h1 res=826.SKM_QUERY_CTL_STROKE_COUNT
  347. This message is used to get the count of strokes in the stroke database.
  348. :p.
  349. :hp4.Example:
  350. :xmp.
  351. :font facename=Helv size=10x10.
  352. ULONG  ulStrokeCount;
  353. :p.
  354. ulStrokeCount =  (ULONG) WinSendMsg(hSKETCHControl,
  355.                                     SKM_QUERY_CTL_STROKE_COUNT,
  356.                                     NULL,
  357.                                     NULL);
  358. :ehp4.
  359. :font facename=default.
  360. :exmp.
  361. :p.
  362. Press "OK" to execute control message SKM_QUERY_CTL_STROKE_COUNT.
  363. .****************************************************************/
  364. .*  Help for SKM_SET_STROKE_INK_COLOR                           */
  365. .*  PANEL_SKM_SET_STROKE_INK_COLOR                              */
  366. .****************************************************************/
  367. :h1 res=827.SKM_SET_STROKE_INK_COLOR
  368. This message is used to reset the color attribute of stroke(i) in the
  369. stroke database.  Parameter mp1 specifies the stroke number(1..n), and mp2
  370. is the value for stroke(i) ink color.
  371. :lines.
  372. Returns:
  373. TRUE  - Success
  374. FALSE - Failure
  375. :elines.
  376. :p.
  377. :hp4.Example:
  378. :xmp.
  379. :font facename=Helv size=10x10.
  380. BOOL   rc;
  381. LONG   lStrokeColor = CLR_RED;
  382. ULONG  ulStrokeNumber = 1;
  383. :p.
  384. rc = (BOOL) WinSendMsg(hSKETCHControl,
  385.                        SKM_SET_STROKE_INK_COLOR,
  386.                        MPFROMLONG(ulStrokeNumber),
  387.                        MPFROMP(lStrokeColor) );
  388. :ehp4.
  389. :font facename=default.
  390. :exmp.
  391. :p.
  392. Press "OK" to execute control message SKM_SET_STROKE_INK_COLOR.
  393. .****************************************************************/
  394. .*  Help for SKM_SET_STROKE_INK_WIDTH                           */
  395. .*  PANEL_SKM_SET_STROKE_INK_WIDTH                              */
  396. .****************************************************************/
  397. :h1 res=828.SKM_SET_STROKE_INK_WIDTH
  398. .****************************************************************/
  399. This message is used to reset the width attribute of stroke(i) in the
  400. stroke database.  Parameter mp1 specifies the stroke number(1..n), and mp2
  401. is the value for stroke(i) ink width.
  402. :lines.
  403. Returns:
  404. TRUE  - Success
  405. FALSE - Failure
  406. :elines.
  407. :p.
  408. :hp4.Example:
  409. :xmp.
  410. :font facename=Helv size=10x10.
  411. BOOL   rc;
  412. ULONG  ulStrokeWidth = 2;
  413. ULONG  ulStrokeNumber = 1;
  414. :p.
  415. rc = (BOOL) WinSendMsg(hSKETCHControl,
  416.                        SKM_SET_STROKE_INK_WIDTH,
  417.                        MPFROMLONG(ulStrokeNumber),
  418.                        MPFROMLONG(ulStrokeWidth) );
  419. :ehp4.
  420. :font facename=default.
  421. :exmp.
  422. :p.
  423. Press "OK" to execute control message SKM_SET_STROKE_INK_WIDTH.
  424. .****************************************************************/
  425. .*  Help for SKN_INK_COLOR_CHANGE                               */
  426. .*  PANEL_SKN_INK_COLOR_CHANGE                                  */
  427. .****************************************************************/
  428. :h1 res=829.SKN_INK_COLOR_CHANGE
  429. This Notification Message is sent to the parent by the control whenever
  430. the ink color for the drawing stroke has been changed.  Parameter
  431. mp2 will contain the value of the color changed to.
  432. :p.
  433. :hp4.Example:
  434. :xmp.
  435. :font facename=Helv size=10x10.
  436. LONG  lColor;
  437. :p.
  438. case WM_CONTROL:
  439.        switch(SHORT2FROMMP(mp1))
  440.          {
  441.            case SKN_INK_COLOR_CHANGE:
  442.              lColor = LONGFROMMP(mp2);
  443.              break;
  444.          }
  445. :ehp4.
  446. :font facename=default.
  447. :exmp.
  448. :p.
  449. Press "OK" to change the ink color and receive Notification Message
  450. SKN_INK_COLOR_CHANGE.
  451. .****************************************************************/
  452. .*  Help for SKN_STROKE_ADD                                     */
  453. .*  PANEL_SKN_STROKE_ADD                                        */
  454. .****************************************************************/
  455. :h1 res=830.SKN_STROKE_ADD
  456. This Notification Message is sent to the parent by the control when a stroke
  457. is about to be added to the stroke database.  Parameter mp2 will contain the
  458. stroke number of the stroke about to be added.  If the parent returns TRUE to
  459. the message, the stroke will not be added.  If the parent returns FALSE, the
  460. stroke will be added.
  461. :p.
  462. :hp4.Example:
  463. :xmp.
  464. :font facename=Helv size=10x10.
  465. ULONG  ulStrokeNumber;
  466. BOOL   AddTheStroke = TRUE;
  467. :p.
  468. case WM_CONTROL:
  469.        switch(SHORT2FROMMP(mp1))
  470.          {
  471.            case SKN_STROKE_ADD:
  472.              lStrokeNumber = LONGFROMMP(mp2);
  473.              if (AddTheStroke)
  474.                return((MRESULT) FALSE);
  475.              else
  476.                return((MRESULT) TRUE);
  477.          }
  478. :ehp4.
  479. :font facename=default.
  480. :exmp.
  481. :p.
  482. Press "OK".  When the next stroke is made in the sketch window, the
  483. Sketch Control will send Notification message SKN_STROKE_ADD.
  484. .****************************************************************/
  485. .*  Help for SKN_STROKE_UNDO                                    */
  486. .*  PANEL_SKN_STROKE_UNDO                                       */
  487. .****************************************************************/
  488. :h1 res=831.SKN_STROKE_UNDO
  489. This Notification Message is sent to the parent by the control when a stroke
  490. is about to be deleted from the stroke database.  Parameter mp2 will contain
  491. the stroke number of the stroke about to be deleted.  If the parent returns
  492. TRUE to the message, the stroke will not be deleted.  If the parent returns
  493. FALSE, the stroke will be deleted.
  494. :p.
  495. :hp4.Example:
  496. :xmp.
  497. :font facename=Helv size=10x10.
  498. ULONG  ulStrokeNumber;
  499. BOOL   UndoTheStroke = TRUE;
  500. :p.
  501. case WM_CONTROL:
  502.        switch(SHORT2FROMMP(mp1))
  503.          {
  504.            case SKN_STROKE_UNDO:
  505.              ulStrokeNumber = LONGFROMMP(mp2);
  506.              if (UndoTheStroke)
  507.                return((MRESULT) FALSE);
  508.              else
  509.                return((MRESULT) TRUE);
  510.          }
  511. :ehp4.
  512. :font facename=default.
  513. :exmp.
  514. :p.
  515. Press "OK" to undo the last stroke and receive Notification Message
  516. SKN_STROKE_UNDO.
  517. .****************************************************************/
  518. .*  Help for SKN_CONTROL_CLEARED                                */
  519. .*  PANEL_SKN_CONTROL_CLEARED                                   */
  520. .****************************************************************/
  521. :h1 res=832.SKN_CONTROL_CLEARED
  522. This Notification Message is sent to the parent by the control whenever the
  523. stroke database is about to be cleared of all strokes.  Parameter mp2 will
  524. contain the number of strokes about to be deleted.  If the parent returns
  525. TRUE to the message, the strokes will not be deleted, if the parent returns
  526. FALSE, all strokes will be deleted from the stroke database.
  527. :p.
  528. :hp4.Example:
  529. :xmp.
  530. :font facename=Helv size=10x10.
  531. ULONG  ulStrokes;
  532. BOOL   ClearAllStrokes = TRUE;
  533. :p.
  534. case WM_CONTROL:
  535.       switch(SHORT2FROMMP(mp1))
  536.         {
  537.           case SKN_CONTROL_CLEARED:
  538.             ulStrokes = LONGFROMMP(mp2);
  539.             if (ClearAllStrokes)
  540.               return((MRESULT) FALSE);
  541.             else
  542.               return((MRESULT) TRUE);
  543.         }
  544. :ehp4.
  545. :font facename=default.
  546. :exmp.
  547. :p.
  548. Press "OK" to clear all strokes and receive Notification Message
  549. SKN_CONTROL_CLEARED.
  550. .****************************************************************/
  551. .*  Help for SKM_SET_CTL_AUXDATA_MODE                           */
  552. .*  PANEL_SKM_SET_CTL_AUXDATA_MODE                              */
  553. .****************************************************************/
  554. :h1 res=833.SKM_SET_CTL_AUXDATA_MODE
  555. This message informs the control that subsequent strokes will retrieve the
  556. specified pen stroke auxiliary data if the data can be returned by the device
  557. (pen, touch, mouse).
  558. :p.
  559. Following is a list of the ADF_* flags defined in the header file penpm.h:
  560. :sl compact.
  561. :li.ADF_TIMESTAMP- Point timestamp
  562. :li.ADF_FLAGS    - Point flags
  563. :li.ADF_SCREENZ  - Z axis value
  564. :li.ADF_ANGLE    - Device angle
  565. :li.ADF_ROTATION - Device rotation
  566. :li.ADF_BUTTON   - Button status
  567. :li.ADF_OEM      - OEM spec. data byte cnt
  568. :li.ADF_USER     - always set
  569. :li.ADF_ALL      - All fields
  570. :li.ADF_OEM_COUNT_MASK - OEM valid count
  571. :esl.
  572. :p.
  573. These values can be ORed together to retrieve multiple fields of auxiliary
  574. data or a zero can be sent to reset so that no auxiliary data is retrieved
  575. for subsequent strokes.
  576. :p.
  577. :hp4.Example:
  578. :xmp.
  579. :font facename=Helv size=10x10.
  580. BOOL   rc;
  581. ULONG ulAuxData = ADF_TIMESTAMP;
  582. :p.
  583. rc =  (BOOL) WinSendMsg(hSKETCHControl,
  584.                         SKM_SET_CTL_AUXDATA_MODE,
  585.                         MPFROMLONG(ulAuxData),
  586.                         NULL);
  587. :ehp4.
  588. :font facename=default.
  589. :exmp.
  590. :p.
  591. Press "OK" to choose to have subsequent strokes retrieve all or none
  592. of the auxiliary data and execute the message.
  593. .****************************************************************/
  594. .*  Help for SKN_INK_WIDTH_CHANGE                               */
  595. .*  PANEL_SKN_INK_WIDTH_CHANGE                                  */
  596. .****************************************************************/
  597. :h1 res=834.SKN_INK_WIDTH_CHANGE
  598. This Notification Message is sent to the parent by the control whenever
  599. the ink width for the drawing stroke has been changed.  Parameter
  600. mp2 will contain the value of the width changed to.
  601. :p.
  602. :hp4.Example:
  603. :xmp.
  604. :font facename=Helv size=10x10.
  605. LONG  ulWidth;
  606. case WM_CONTROL:
  607.        switch(SHORT2FROMMP(mp1))
  608.          {
  609.            case SKN_INK_WIDTH_CHANGE:
  610.            ulWidth = LONGFROMMP(mp2);
  611.            break;
  612.          }
  613. :ehp4.
  614. :font facename=default.
  615. :exmp.
  616. :p.
  617. Press "OK" to change the ink width and receive a SKN_INK_WIDTH_CHANGE
  618. notification message.
  619. .****************************************************************/
  620. .*  Help for SKM_GET_BITMAP                                     */
  621. .*  PANEL_SKM_GET_BITMAP                                        */
  622. .****************************************************************/
  623. :h1 res=835.SKM_GET_BITMAP
  624. This message creates a screen resolution bitmap image from the sketch
  625. control and returns its handle.
  626. :p.
  627. :hp4.Example:
  628. :xmp.
  629. :font facename=Helv size=10x10.
  630. HBITMAP   hBitmap;
  631.  
  632. hBitmap = (HBITMAP) WinSendMsg(hSKETCHControl,
  633.                     SKM_GET_BITMAP,
  634.                     NULL,
  635.                     NULL);
  636. :ehp4.
  637. :font facename=default.
  638. :exmp.
  639. :p.
  640. The handle returned can be used to save the bitmap to a file on disk.
  641. Press "OK" to execute control message SKM_GET_BITMAP.  The bitmap handle
  642. will be displayed and you may choose to save the bitmap to a file.
  643. .****************************************************************/
  644. .*  Help for SKM_QUERY_BITMAP_SIZE                              */
  645. .*  PANEL_SKM_QUERY_BITMAP_SIZE                                 */
  646. .****************************************************************/
  647. :h1 res=836.SKM_QUERY_BITMAP_SIZE
  648. This message returns the size of the bitmap that could be returned with
  649. the SKM_GET_BITMAP or the SKM_RENDER_TO_CLIPBOARD messages.  The returned
  650. values are dependent on whether the control has a border.  If the control
  651. does not contain a border, the bitmap's size is the same size as the
  652. control's window.  If the control does contain a border, the bitmap's size
  653. will be reduced by 2 pixels in the X and Y directions.
  654. :lines.
  655. Returns:  size(ULONG)
  656. LOUSHORT = Size in pixels in the X direction.
  657. HIUSHORT = Size in pixels in the Y direction.
  658. FALSE    = An error occured.
  659. :elines.
  660. :p.
  661. :hp4.Example:
  662. :xmp.
  663. :font facename=Helv size=10x10.
  664. ULONG     ulSize;
  665. SHORT     sSizeX;
  666. SHORT     sSizeY;
  667.  
  668. ulSize = (ULONG) WinSendMsg(hSKETCHControl,
  669.                  SKM_QUERY_BITMAP_SIZE,
  670.                  NULL,
  671.                  NULL);
  672.  
  673. sSizeX = LOUSHORT(lSize);
  674. sSizeY = HIUSHORT(lSize);
  675. :ehp4.
  676. :font facename=default.
  677. :exmp.
  678. :p.
  679. Press "OK" to execute control message SKM_QUERY_BITMAP_SIZE.
  680. .****************************************************************/
  681. .*  Help for SKM_QUERY_STROKE_LENGTH                            */
  682. .*  PANEL_SKM_QUERY_STROKE_LENGTH                               */
  683. .****************************************************************/
  684. :h1 res=837.SKM_QUERY_STROKE_LENGTH
  685. This message is used to retrieve the size, in bytes, of stroke(i).
  686. A zero return code signals an error, such as stroke not available.
  687. :p.
  688. :hp4.Example:
  689. :xmp.
  690. :font facename=Helv size=10x10.
  691. ULONG   ulLength;
  692. ULONG   ulStrokeNumber = 1;
  693. :p.
  694. ulLength = (ULONG) WinSendMsg(hSKETCHControl,
  695.                               SKM_QUERY_STROKE_LENGTH,
  696.                               MPFROMLONG(ulStrokeNumber),
  697.                               NULL);
  698. :ehp4.
  699. :font facename=default.
  700. :exmp.
  701. :p.
  702. Press "OK" to execute control message SKM_QUERY_STROKE_INK_WIDTH.
  703. .****************************************************************/
  704. .*  Help for SKM_QUERY_STROKE_DATA                              */
  705. .*  PANEL_SKM_QUERY_STROKE_DATA                                 */
  706. .****************************************************************/
  707. :h1 res=838.SKM_QUERY_STROKE_DATA
  708. This message is used to retrieve stroke(i) from the stroke database.  MP1
  709. specifies the stroke(1..n), MP2 is a pointer to a buffer to hold the contents
  710. of the stroke, including any aux data.  The buffer size is determined by
  711. a SKM_QUERY_STROKE_LENGTH.
  712. :lines.
  713. Returns:
  714. TRUE  - Success
  715. FALSE - Failure
  716. :elines.
  717. :p.
  718. :hp4.Example:
  719. :xmp.
  720. :font facename=Helv size=10x10.
  721. ULONG  ulLength;
  722. ULONG  ulStrokeNumber = 1;
  723. BOOL   rc;
  724. PSKETCHSTROKEDEF pStrokeData;
  725.  
  726. ulLength = (LONG) WinSendMsg(hSKETCHControl,
  727.                              SKM_QUERY_STROKE_LENGTH,
  728.                              MPFROMLONG(ulStrokeNumber),
  729.                              NULL);
  730.  
  731. pStrokeData = malloc(ulLength);
  732. rc = (BOOL) WinSendMsg(hSKETCHControl,
  733.                        SKM_QUERY_STROKE_DATA,
  734.                        MPFROMLONG(ulStrokeNumber),
  735.                        MPFROMP(pStrokeData) );
  736.  
  737.  
  738. free(pStrokeData);
  739. :ehp4.
  740. :font facename=default.
  741. :exmp.
  742. :p.
  743. Press "OK" to execute control message SKM_QUERY_STROKE_DATA.
  744. .****************************************************************/
  745. .*  Help for SKM_QUERY_STROKE_INK_COLOR                         */
  746. .*  PANEL_SKM_QUERY_STROKE_INK_COLOR                            */
  747. .****************************************************************/
  748. :h1 res=839.SKM_QUERY_STROKE_INK_COLOR
  749. This message returns the color attribute of stroke(i) in the stroke database.
  750. Parameter mp1 specifies the stroke number(1..n) to query.
  751. :lines.
  752. Returns:
  753. LONG lColor - color of stroke number(1..n)
  754. CLR_ERROR -    Failure
  755. :elines.
  756. :p.
  757. :hp4.Example:
  758. :xmp.
  759. :font facename=Helv size=10x10.
  760. LONG  lColor;
  761. ULONG  ulStrokeNumber = 1;
  762. :p.
  763. lColor = (LONG) WinSendMsg(hSKETCHControl,
  764.                            SKM_QUERY_STROKE_INK_COLOR,
  765.                            MPFROMLONG(ulStrokeNumber),
  766.                            NULL );
  767. :ehp4.
  768. :font facename=default.
  769. :exmp.
  770. :p.
  771. Press "OK" to execute control message SKM_QUERY_STROKE_INK_COLOR.
  772. .****************************************************************/
  773. .*  Help for SKM_QUERY_STROKE_INK_WIDTH                         */
  774. .*  PANEL_SKM_QUERY_STROKE_INK_WIDTH                            */
  775. .****************************************************************/
  776. :h1 res=840.SKM_QUERY_STROKE_INK_WIDTH
  777. This message returns the width attribute of stroke(i) in the stroke database.
  778. Parameter mp1 specifies the stroke number(1..n) to query.
  779. :lines.
  780. Returns:
  781. ULONG ulWidth - width of stroke number(1..n)
  782. FALSE         - Failure
  783. :elines.
  784. :p.
  785. :hp4.Example:
  786. :xmp.
  787. :font facename=Helv size=10x10.
  788. ULONG   ulWidth;
  789. ULONG   ulStrokeNumber = 1;
  790. :p.
  791. ulWidth = (LONG) WinSendMsg(hSKETCHControl,
  792.                             SKM_QUERY_STROKE_INK_WIDTH,
  793.                             MPFROMLONG(ulStrokeNumber),
  794.                             NULL );
  795. :ehp4.
  796. :font facename=default.
  797. :exmp.
  798. :p.
  799. Press "OK" to execute control message SKM_QUERY_STROKE_INK_WIDTH.
  800. :euserdoc.
  801.