home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / cuaclip.zip / MOUSE.PRG < prev    next >
Text File  |  1993-06-01  |  3KB  |  136 lines

  1. //┌────────────────────────────────────────────────────────────────────────┐
  2. //│ Copyright (c) 1992 Delcom International Software Engineering           │
  3. //└────────────────────────────────────────────────────────────────────────┘
  4. //
  5. //  Mouse.PRG
  6. //
  7. //  This file contains the remapped versions of SAVESCREEN/RESTSCREEN,
  8. //  DISPBEGIN/DISPEND, and SCROLL which are mouse-sensitive.
  9. //
  10.  
  11. #include "Mouse.ch"
  12.  
  13.  
  14. ***************************
  15. **   FUNCTION M_SetMode  **
  16. *****************************************************************************
  17. //
  18. //  This function is the mouse-sensitive version of SETMODE.
  19. //
  20.  
  21. FUNCTION M_SetMode( nRows, nCols )
  22.  
  23. LOCAL nOldMouse := SetMouse( MOUSE_OFF ), lRetCode := .F.
  24.  
  25. ClearMouse()
  26.  
  27. lRetCode := SETMODE( nRows, nCols )
  28.  
  29. InitMouse()
  30. SetMouse( nOldMouse )
  31. SetMousePos( MAXROW() / 2, MAXCOL() / 2 )
  32.  
  33. RETURN lRetCode
  34. //
  35. // EOP: M_SetMode
  36. //
  37.  
  38.  
  39. ******************************
  40. **   FUNCTION M_SaveScreen  **
  41. *****************************************************************************
  42. //
  43. //  This function is the mouse-sensitive version of SAVESCREEN.
  44. //
  45.  
  46. FUNCTION M_SaveScreen( nTop, nLeft, nBottom, nRight )
  47.  
  48. LOCAL nOldMouse := SetMouse( MOUSE_OFF ), cScreen
  49.  
  50. nTop    := IF( nTop == NIL, 0, nTop )
  51. nLeft   := IF( nLeft == NIL, 0, nLeft )
  52. nBottom := IF( nBottom == NIL, MAXROW(), nBottom )
  53. nRight  := IF( nRight == NIL, MAXCOL(), nRight )
  54.  
  55. cScreen := SAVESCREEN( nTop, nLeft, nBottom, nRight )
  56.  
  57. SetMouse( nOldMouse )
  58.  
  59. RETURN cScreen
  60. //
  61. // EOP: M_SaveScreen
  62. //
  63.  
  64.  
  65. ******************************
  66. **   FUNCTION M_RestScreen  **
  67. *****************************************************************************
  68. //
  69. //  This function is the mouse-sensitive version of RESTSCREEN.
  70. //
  71.  
  72. FUNCTION M_RestScreen( nTop, nLeft, nBottom, nRight, cScreen )
  73.  
  74. LOCAL nOldMouse := SetMouse( MOUSE_OFF )
  75.  
  76. RESTSCREEN( nTop, nLeft, nBottom, nRight, cScreen )
  77.  
  78. SetMouse( nOldMouse )
  79.  
  80. RETURN NIL
  81. //
  82. // EOP: M_RestScreen
  83. //
  84.  
  85.  
  86. ************************
  87. **   FUNCTION M_Disp  **
  88. *****************************************************************************
  89. //
  90. //  This function is the mouse-sensitive version of DISPBEGIN/DISPEND.
  91. //
  92.  
  93. FUNCTION M_Disp ( nMode )
  94.  
  95. STATIC nOldMouse
  96.  
  97. IF nMode == NIL
  98.     RETURN NIL
  99. ENDIF
  100.  
  101. IF nMode == 0
  102.     nOldMouse := SetMouse( MOUSE_OFF )
  103.     DISPBEGIN()
  104. ELSE
  105.     DISPEND()
  106.     SetMouse( nOldMouse )
  107.  
  108.     nOldMouse := NIL
  109. ENDIF
  110.  
  111. RETURN NIL
  112. //
  113. // EOP: M_Disp
  114. //
  115.  
  116.  
  117. **************************
  118. **   FUNCTION M_Scroll  **
  119. *****************************************************************************
  120. //
  121. //  This function is the mouse-sensitive version of SCROLL.
  122. //
  123.  
  124. FUNCTION M_Scroll( nTop, nLeft, nBottom, nRight, nRows )
  125.  
  126. LOCAL nOldMouse := SetMouse( MOUSE_OFF )
  127.  
  128. SCROLL( nTop, nLeft, nBottom, nRight, nRows )
  129.  
  130. SetMouse( nOldMouse )
  131.  
  132. RETURN NIL
  133. //
  134. // EOP: M_Scroll
  135. //
  136.