home *** CD-ROM | disk | FTP | other *** search
/ Megazine / Megazine-1.iso / PROGRAMA / CLIPPER / CALC223 / NANMOUSE.PRG < prev    next >
Encoding:
Text File  |  1993-12-16  |  12.6 KB  |  196 lines

  1. * ┌─ Program ────────────────────────────────────────────────────────────────┐
  2. * │  Application: Calculator 2.0                                             │
  3. * │    File Name: NANMOUSE.PRG  Nanforum Mouse Interface for Calculator 2.0  │
  4. * │       Author: Jim Gale                                                   │
  5. * │ Date created: 10-03-93                                                   │
  6. * │ Time created: 11:06:04pm                                                 │
  7. * │    Make File:                                                            │
  8. * │    Exec File:                                                            │
  9. * │    Copyright: 1993 by Touchstone Business Creations                      │
  10. * └──────────────────────────────────────────────────────────────────────────┘
  11.  
  12. Static lIsMouse
  13.  
  14. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  15. * │  Description: Determime if a mouse if present in the system.             │
  16. * │       Author: Jim Gale                                                   │
  17. * │ Date created: 10-30-93                                                   │
  18. * │ Time created: 09:35:00am                                                 │
  19. * │    Copyright: Touchstone Business Creations                              │
  20. * ├──────────────────────────────────────────────────────────────────────────┤
  21. * │     Function: CM_IsMouse()                                               │
  22. * │                                                                          │
  23. * │    Arguments: none                                                       │
  24. * │                                                                          │
  25. * │ Return Value: lMouseExists - logical value representing if a mouse is    │
  26. * │                              present.                                    │
  27. * │     See Also:                                                            │
  28. * │                                                                          │
  29. * └──────────────────────────────────────────────────────────────────────────┘
  30. Function CM_IsMouse()
  31.    If ValType(lIsMouse)#"L"
  32.       lIsMouse:=(FT_MInit())
  33.    Endif
  34. Return lIsMouse
  35.  
  36. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  37. * │  Description: Report which mouse button is being pressed.                │
  38. * │       Author: Jim Gale                                                   │
  39. * │ Date created: 10-30-93                                                   │
  40. * │ Time created: 09:35:52am                                                 │
  41. * │    Copyright: Touchstone Business Creations                              │
  42. * ├──────────────────────────────────────────────────────────────────────────┤
  43. * │     Function: CM_Button()                                                │
  44. * │                                                                          │
  45. * │    Arguments: none                                                       │
  46. * │                                                                          │
  47. * │ Return Value: nButtonPressed - numeric representing which mouse button   │
  48. * │                                was pressed:                              │
  49. * │                                                                          │
  50. * │               Valid Values are:                                          │
  51. * │                                                                          │
  52. * │                  0 = no button pressed (or mouse not present)            │
  53. * │                  1 = left button pressed                                 │
  54. * │                  2 = right button pressed                                │
  55. * │                                                                          │
  56. * │     See Also:                                                            │
  57. * │                                                                          │
  58. * └──────────────────────────────────────────────────────────────────────────┘
  59. Function CM_Button()
  60. Return FT_MButPrs()
  61.  
  62. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  63. * │  Description: Report the mouse cursor row.                               │
  64. * │       Author: Jim Gale                                                   │
  65. * │ Date created: 10-30-93                                                   │
  66. * │ Time created: 09:39:26am                                                 │
  67. * │    Copyright: Touchstone Business Creations                              │
  68. * ├──────────────────────────────────────────────────────────────────────────┤
  69. * │     Function: CM_Row()                                                   │
  70. * │                                                                          │
  71. * │    Arguments: none                                                       │
  72. * │                                                                          │
  73. * │ Return Value: nMouseRow - numeric representing text row of mouse.        │
  74. * │     See Also:                                                            │
  75. * │                                                                          │
  76. * └──────────────────────────────────────────────────────────────────────────┘
  77. Function CM_Row()
  78. Return FT_MGetX()
  79.  
  80. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  81. * │  Description: Report the mouse cursor column.                            │
  82. * │       Author: Jim Gale                                                   │
  83. * │ Date created: 10-30-93                                                   │
  84. * │ Time created: 09:39:58am                                                 │
  85. * │    Copyright: Touchstone Business Creations                              │
  86. * ├──────────────────────────────────────────────────────────────────────────┤
  87. * │     Function: CM_Col()                                                   │
  88. * │                                                                          │
  89. * │    Arguments: none                                                       │
  90. * │                                                                          │
  91. * │ Return Value: nMouseCol - numeric representing text column of mouse.     │
  92. * │     See Also:                                                            │
  93. * │                                                                          │
  94. * └──────────────────────────────────────────────────────────────────────────┘
  95. Function CM_Col()
  96. Return FT_MGetY()
  97.  
  98. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  99. * │  Description: Turn the mouse cursor on.                                  │
  100. * │       Author: Jim Gale                                                   │
  101. * │ Date created: 10-30-93                                                   │
  102. * │ Time created: 09:40:26am                                                 │
  103. * │    Copyright: Touchstone Business Creations                              │
  104. * ├──────────────────────────────────────────────────────────────────────────┤
  105. * │     Function: CM_On()                                                    │
  106. * │                                                                          │
  107. * │    Arguments: none                                                       │
  108. * │                                                                          │
  109. * │ Return Value: n/a                                                        │
  110. * │     See Also:                                                            │
  111. * │                                                                          │
  112. * └──────────────────────────────────────────────────────────────────────────┘
  113. Function CM_On()
  114. Return FT_MShowCrs()
  115.  
  116. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  117. * │  Description: Turn the mouse cursor off.                                 │
  118. * │       Author: Jim Gale                                                   │
  119. * │ Date created: 10-30-93                                                   │
  120. * │ Time created: 09:42:50am                                                 │
  121. * │    Copyright: Touchstone Business Creations                              │
  122. * ├──────────────────────────────────────────────────────────────────────────┤
  123. * │     Function: CM_Off()                                                   │
  124. * │                                                                          │
  125. * │    Arguments: none                                                       │
  126. * │                                                                          │
  127. * │ Return Value: n/a                                                        │
  128. * │     See Also:                                                            │
  129. * │                                                                          │
  130. * └──────────────────────────────────────────────────────────────────────────┘
  131. Function CM_Off()
  132. Return FT_MHideCrs()
  133.  
  134. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  135. * │  Description: Report the state of the cursor and optionally set it.      │
  136. * │       Author: Jim Gale                                                   │
  137. * │ Date created: 10-30-93                                                   │
  138. * │ Time created: 09:44:29am                                                 │
  139. * │    Copyright: Touchstone Business Creations                              │
  140. * ├──────────────────────────────────────────────────────────────────────────┤
  141. * │     Function: CM_Cursor([<lState>])                                      │
  142. * │                                                                          │
  143. * │    Arguments: [<lState>] - new state of cursor (on/off) - optional       │
  144. * │                                                                          │
  145. * │ Return Value: lOldState - old state of cursor (on/off)                   │
  146. * │     See Also:                                                            │
  147. * │                                                                          │
  148. * └──────────────────────────────────────────────────────────────────────────┘
  149. Function CM_Cursor(lNew)
  150. Return FT_MCursor(lNew)
  151.  
  152. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  153. * │  Description: Initialize/Reset mouse system for calculator               │
  154. * │       Author: Jim Gale                                                   │
  155. * │ Date created: 10-30-93                                                   │
  156. * │ Time created: 09:44:42am                                                 │
  157. * │    Copyright: Touchstone Business Creations                              │
  158. * ├──────────────────────────────────────────────────────────────────────────┤
  159. * │     Function: CM_Init()                                                  │
  160. * │                                                                          │
  161. * │    Arguments: none                                                       │
  162. * │                                                                          │
  163. * │ Return Value: NIL                                                        │
  164. * │     See Also:                                                            │
  165. * └──────────────────────────────────────────────────────────────────────────┘
  166. Function CM_Init()
  167.    FT_MInit()
  168.    FT_MShowCrs()
  169.    FT_MHideCrs()
  170. Return NIL
  171.  
  172. * ┌─ Function ───────────────────────────────────────────────────────────────┐
  173. * │  Description: Provide any needed exit support for the mouse.             │
  174. * │       Author: Jim Gale                                                   │
  175. * │ Date created: 10-30-93                                                   │
  176. * │ Time created: 10:23:22am                                                 │
  177. * │    Copyright: Touchstone Business Creations                              │
  178. * ├──────────────────────────────────────────────────────────────────────────┤
  179. * │     Function: CM_Exit()                                                  │
  180. * │                                                                          │
  181. * │    Arguments: none                                                       │
  182. * │                                                                          │
  183. * │ Return Value: NIL                                                        │
  184. * │     See Also:                                                            │
  185. * │                                                                          │
  186. * └──────────────────────────────────────────────────────────────────────────┘
  187. Function CM_Wait(n,lMousekey)
  188. Local nKey:=0
  189.    If lMousekey
  190.       While FT_MButPrs()#n .and. (nKey:=Inkey())=0
  191.       Enddo
  192.    Else
  193.       nKey:=Inkey(.2)
  194.    Endif
  195. Return nKey
  196.