Subversion Repositories Moxba-Metrex.metrex

Rev

Blame | Last modification | View Log

PVB_BEGIN POWERVB
    version 1
    domain "USER"
    file "mouse.pls"
    PVB_BEGIN OBJECT
        name "LIBRARY"
        PVB_BEGIN SOURCE
            :SUMMIT2.2 "0x308"
            drawing "mouse.pls"
            object "LIBRARY"
            PVB_BEGIN CODE
                'Library for mouse routines, the function PvbSetCursor is used
                'in the application to change the appearance of the mouse-
                'cursor.
                
                Private MouseInit as integer
                Private MouseCounter as integer
                
                Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
                Declare Function pvb_init_cursor Lib "pvb_util" (ByVal title As Long) as Integer
                Declare Function pvb_set_cursor Lib "pvb_util" Alias "pvb_set_cursor" (ByVal Index as Integer) as Integer
                
                Const AnimatedCursor as integer = 18
                Const DefaultCursor as integer = 0
                
                
                
                Sub PvbMouseInit()
                
                  Dim b as long
                
                  MouseCounter = 0
                
                  'call loadlibrary function
                  if MouseInit = 0 then 
                    b = LoadLibrary( "pvb_util.dll")
                  end if
                
                  'call mouse init function from pvb_util library
                  b = pvb_init_cursor( 0)
                End sub 
                
                
                Sub PvbLinkCursor(optional link as variant)
                  Dim x as integer
                
                  If ismissing(link) then link = false
                
                  Critical 
                
                  'call cursor function within pvb_util library
                  if link then
                
                    x = pvb_set_cursor( AnimatedCursor)
                    MouseCounter = MouseCounter + 1
                  else
                
                    if (MouseCounter > 0) then MouseCounter = MouseCounter - 1
                    if (MouseCounter = 0) then x = pvb_set_cursor( DefaultCursor)
                  end if
                
                  EndCritical
                End sub
                
                Sub PvbSetCursor(cursor as integer)
                  Dim x as integer
                
                  'call cursor function within pvb_util library
                  x = pvb_set_cursor( 0) 'cursor)
                End sub
                
                Sub PvbResetCursor()
                  Dim x as integer
                
                  'call cursor function within pvb_util library
                  x = pvb_set_cursor( DefaultCursor)
                End sub
            PVB_END CODE
        PVB_END SOURCE
    PVB_END OBJECT
PVB_END POWERVB