home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / basic / mlib30 / mlib.bi < prev    next >
Encoding:
Text File  |  1994-02-21  |  4.6 KB  |  123 lines

  1. DEFINT A-Z
  2. '=========================== MLIB Include File ==============================
  3. ' This file should be included in your program for proper operation. To
  4. ' increase the amount of memory available to your program, you may edit this
  5. ' file to include only the procedure declarations and/or constants needed.
  6. ' You could also use a numeric value in place of the symbolic names in your
  7. ' code, and remove the constant definitions from this file altogether.
  8. '============================================================================
  9.  
  10. ' Standard mouse routines.
  11. DECLARE SUB InitPointer (Buttons%)
  12. DECLARE SUB ShowPointer
  13. DECLARE SUB HidePointer
  14.  
  15. DECLARE SUB SetPointer (X%, Y%)
  16. DECLARE SUB SetHLimitM (X%, Y%)
  17. DECLARE SUB SetVLimitM (X%, Y%)
  18. DECLARE SUB SetBoundM (x1%, y1%, x2%, y2%)
  19. DECLARE SUB ChangePointer (Shape$, HotX%, HotY%)
  20.  
  21. DECLARE SUB GetMotionM (X%, Y%)
  22. DECLARE SUB GetSpeedM (H%, V%, D%)
  23. DECLARE SUB SetSpeedM (H%, V%, D%)
  24. DECLARE SUB GetButtonM (Button%, X%, Y%)
  25. DECLARE SUB GetPressM (Button%, Status%, Count%, X%, Y%)
  26. DECLARE SUB GetReleaseM (Button%, Status%, Count%, X%, Y%)
  27.  
  28. DECLARE SUB SaveStateM (Buffer$, SaveErr%)
  29. DECLARE SUB RestoreStateM (Buffer$, RestoreErr%)
  30.  
  31. DECLARE FUNCTION GetSizeM%
  32. DECLARE FUNCTION ShowPtrM% (Buffer$)
  33. DECLARE FUNCTION InWinM% (BYVAL x1%, BYVAL y1%, BYVAL x2%, BYVAL y2%)
  34.  
  35. ' Sample pointer shapes.
  36. DECLARE SUB PEN0
  37. DECLARE SUB ARROW0
  38. DECLARE SUB ARROW1
  39. DECLARE SUB HANDV0
  40. DECLARE SUB MOUSE0
  41. DECLARE SUB WATCH0
  42. DECLARE SUB PAINTCUP0
  43. DECLARE SUB HOURGLASS0
  44. DECLARE SUB MAGNIFYGLASS0
  45.  
  46. ' Pointer shape file (.SHP) record format.
  47. TYPE MOUSEtype              ': Each record is 80 bytes.
  48.       DLT    AS INTEGER     ': 2  bytes for editor use.
  49.       HTX    AS INTEGER     ': 2  bytes for hotspot  X.
  50.       HTY    AS INTEGER     ': 2  bytes for hotspot  Y.
  51.       FRM    AS STRING * 10 ' bytes for solid or transparent format.
  52.       DAT    AS STRING * 64 ' bytes for shape data.
  53. END TYPE
  54.  
  55. ' Extra routines.
  56. DECLARE FUNCTION CvsBin% (BinaryString$)
  57. DECLARE FUNCTION CviBin$ (BYVAL BinaryValue%)
  58. DECLARE FUNCTION GetWord% (BYVAL SegVal%, BYVAL OffVal%)
  59. DECLARE SUB PutWord (BYVAL SegVal%, BYVAL OffVal%, BYVAL Value%)
  60.  
  61. '============================================================================
  62. ' Mouse event handling procedure declarations and constant definitions.
  63. '============================================================================
  64. ' Mouse event procedures.
  65. DECLARE SUB InMouseHandler (BYVAL Action%)
  66. DECLARE FUNCTION InMouseAddress% (OffVal%)
  67. DECLARE FUNCTION InMouse% (MouseX%, MouseY%)
  68.  
  69. ' Event handler control constants.
  70. CONST EventInstall = 1          ' Install InMouse().
  71. CONST EventEnable = 2           ' Enable InMouse().
  72. CONST EventDisable = 4          ' Disable InMouse().
  73. CONST ClearBuffer = 8           ' Clear event buffer.
  74.  
  75. ' Mouse move mask.
  76. CONST MouseMoved = 1
  77.  
  78. ' Mouse down masks.
  79. CONST LButtonDown = 2           ' Left button down.
  80. CONST RButtonDown = 8           ' Right button down.
  81. CONST CButtonDown = 32          ' Center button down.
  82.  
  83. ' Mouse up masks.
  84. CONST LButtonUp = 4             ' Left button up.
  85. CONST RButtonUp = 16            ' Right button up.
  86. CONST CButtonUp = 64            ' Center button up.
  87.  
  88. ' Mouse double-click masks.
  89. CONST LButtonDblClk = 128       ' Left button double-click.
  90. CONST RButtonDblClk = 256       ' Right button double-click.
  91. CONST CButtonDblClk = 512       ' Center button double-click.
  92.  
  93. ' Shift-state key masking constants.
  94. CONST ShiftKey = 1024           ' Shift key mask.
  95. CONST CtrlKey = 2048            ' Ctrl key mask.
  96. CONST AltKey = 4096             ' Alt key mask.
  97.  
  98. ' Optional mouse toolkit (MLIBTOOL.BAS) BASIC procedure
  99. ' declarations and constant definitions.
  100. DECLARE SUB ClearEventBuffer ()
  101. DECLARE SUB InMouseSave (Buffer$)
  102. DECLARE SUB InMouseRestore (Buffer$)
  103. DECLARE SUB GetEventMask (OldMask%)
  104. DECLARE SUB SetEventMask (NewMask%)
  105. DECLARE SUB SetDblClkSettings (ClickS%, ClickW%, ClickH%)
  106. DECLARE SUB GetDblClkSettings (ClickS%, ClickW%, ClickH%)
  107.  
  108. DECLARE FUNCTION GetTailPtr% ()
  109. DECLARE FUNCTION GetHeadPtr% ()
  110. DECLARE FUNCTION InMouseState% ()
  111. DECLARE FUNCTION GetEventsPending% ()
  112.  
  113. ' Handler data block offset constants.
  114. CONST InMouseStateOff = 28      ' Handler status flag.
  115. CONST EventMaskOff = 30         ' Mouse event mask.
  116. CONST ClickSOff = 32            ' Double-click speed offset.
  117. CONST ClickWOff = 34            ' Double-click width offset.
  118. CONST ClickHOff = 36            ' Double-click height offset.
  119. CONST HeadPtrOff = 38           ' Buffer head pointer offset.
  120. CONST TailPtrOff = 40           ' Buffer tail pointer offset.
  121. CONST BufferOff = 42            ' Buffer offset.
  122.  
  123.