How do you change the cursor to busy then back?
I checked the documentation and did a search with no results.

Code: Select all
ImportC ""
SetThemeCursor(CursorType.L)
EndImport
OpenWindow(0, 200, 100, 200, 180, "Change cursor")
ButtonGadget(0, 40, 70, 120, 20, "Change cursor")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0
If CursorID = 18
CursorID = 0
Else
CursorID + 1
EndIf
SetThemeCursor(CursorID)
EndIf
EndSelect
ForEver
Code: Select all
ImportC ""
SetThemeCursor(CursorType.L)
EndImport
; ----- Theme Cursors
#kThemeArrowCursor = 0
#kThemeCopyArrowCursor = 1
#kThemeAliasArrowCursor = 2
#kThemeContextualMenuArrowCursor = 3
#kThemeIBeamCursor = 4
#kThemeCrossCursor = 5
#kThemePlusCursor = 6
#kThemeWatchCursor = 7
#kThemeClosedHandCursor = 8
#kThemeOpenHandCursor = 9
#kThemePointingHandCursor = 10
#kThemeCountingUpHandCursor = 11
#kThemeCountingDownHandCursor = 12
#kThemeCountingUpAndDownHandCursor = 13
#kThemeSpinningCursor = 14
#kThemeResizeLeftCursor = 15
#kThemeResizeRightCursor = 16
#kThemeResizeLeftRightCursor = 17
#kThemeNotAllowedCursor = 18
OpenWindow(0, 200, 100, 200, 180, "Display Wait cursor")
ButtonGadget(0, 40, 70, 120, 20, "Change cursor")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0
SetThemeCursor(#kThemeWatchCursor)
EndIf
EndSelect
ForEver
William,WilliamL wrote:I think I need it to stay changed until I change it back...
Code: Select all
ImportC ""
QDDisplayWaitCursor(ForceWaitCursor.L)
EndImport
OpenWindow(0, 200, 100, 250, 130, "Display Wait cursor")
ButtonGadget(0, 10, 50, 230, 20, "Change cursor to spinning wheel")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0
QDDisplayWaitCursor(#True)
Delay(2000)
QDDisplayWaitCursor(#False)
EndIf
EndSelect
ForEver
Code: Select all
EnableExplicit
ImportC ""
GetEventClass(Event)
RemoveEventHandler(EventHandlerRef.L)
SetAnimatedThemeCursor(CursorType.L, AnimationStep.L)
SetThemeCursor(CursorType.L)
EndImport
#kEventClassMouse = 'mous'
#kEventMouseMoved = 5
#kThemeArrowCursor = 0
#kThemeWatchCursor = 7
#kThemeSpinningCursor = 14
Structure EventTypeSpec
EventClass.L
EventKind.L
EndStructure
Define AnimationStep.L
Define CursorID.L
Define EventHandlerRef.L
Define EventHandlerUPP.L
Define NumAnimationSteps.L
Procedure EventHandler(*NextEventHandler, Event, UserData)
Shared AnimationStep.L
Shared CursorID.L
If GetEventClass(Event) = #kEventClassMouse
If GetEventKind_(Event) = #kEventMouseMoved
SetAnimatedThemeCursor(CursorID, AnimationStep)
EndIf
EndIf
EndProcedure
Dim EventTypes.EventTypeSpec(0)
OpenWindow(0, 200, 100, 250, 120, "Display animated wait cursor")
ButtonGadget(0, 10, 20, 230, 20, "Change cursor to spinning wheel")
ButtonGadget(1, 10, 50, 230, 20, "Change cursor to running watch")
ButtonGadget(2, 10, 80, 230, 20, "Restore default cursor")
EventHandlerUPP = NewEventHandlerUPP_(@EventHandler())
EventTypes(0)\EventClass = #kEventClassMouse
EventTypes(0)\EventKind = #kEventMouseMoved
CursorID = #kThemeSpinningCursor
NumAnimationSteps = 4
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
If EventHandlerRef
RemoveEventHandler(EventHandlerRef)
EndIf
Break
Case #PB_Event_Gadget
Select EventGadget()
Case 0
CursorID = #kThemeSpinningCursor
NumAnimationSteps = 4
InstallEventHandler_(GetWindowEventTarget_(WindowID(0)), EventHandlerUPP, 1, @EventTypes(), 0, @EventHandlerRef)
AddWindowTimer(0, 0, 150)
DisableGadget(0, #True)
DisableGadget(1, #True)
Case 1
CursorID = #kThemeWatchCursor
NumAnimationSteps = 8
InstallEventHandler_(GetWindowEventTarget_(WindowID(0)), EventHandlerUPP, 1, @EventTypes(), 0, @EventHandlerRef)
AddWindowTimer(0, 0, 150)
DisableGadget(0, #True)
DisableGadget(1, #True)
Case 2
RemoveEventHandler(EventHandlerRef)
EventHandlerRef = 0
RemoveWindowTimer(0, 0)
DisableGadget(0, #False)
DisableGadget(1, #False)
SetThemeCursor(#kThemeArrowCursor)
EndSelect
Case #PB_Event_Timer
If EventTimer() = 0
SetAnimatedThemeCursor(CursorID, AnimationStep)
AnimationStep = (AnimationStep + 1) % NumAnimationSteps
EndIf
EndSelect
ForEver
Code: Select all
EnableExplicit
ImportC ""
SetAnimatedThemeCursor(CursorType.L, AnimationStep.L)
SetThemeCursor(CursorType.L)
EndImport
#kEventClassMouse = 'mous'
#kEventMouseMoved = 5
#kThemeArrowCursor = 0
#kThemeWatchCursor = 7
#kThemeSpinningCursor = 14
Define AnimationStep.L
Define CursorID.L
Define CursorIsAnimated.L
Define NumAnimationSteps.L
Define WindowEvent.L
OpenWindow(0, 200, 100, 250, 120, "Display animated wait cursor")
ButtonGadget(0, 10, 20, 230, 20, "Change cursor to spinning wheel")
ButtonGadget(1, 10, 50, 230, 20, "Change cursor to running watch")
ButtonGadget(2, 10, 80, 230, 20, "Restore default cursor")
DisableGadget(2, #True)
Repeat
WindowEvent = WaitWindowEvent()
Select WindowEvent
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case 0
CursorID = #kThemeSpinningCursor
NumAnimationSteps = 4
CursorIsAnimated = #True
AddWindowTimer(0, 0, 150)
DisableGadget(0, #True)
DisableGadget(1, #True)
DisableGadget(2, #False)
Case 1
CursorID = #kThemeWatchCursor
NumAnimationSteps = 8
CursorIsAnimated = #True
AddWindowTimer(0, 0, 150)
DisableGadget(0, #True)
DisableGadget(1, #True)
DisableGadget(2, #False)
Case 2
CursorIsAnimated = #False
RemoveWindowTimer(0, 0)
SetThemeCursor(#kThemeArrowCursor)
DisableGadget(0, #False)
DisableGadget(1, #False)
DisableGadget(2, #True)
EndSelect
Case #PB_Event_Timer
If EventTimer() = 0
SetAnimatedThemeCursor(CursorID, AnimationStep)
AnimationStep = (AnimationStep + 1) % NumAnimationSteps
EndIf
Case -1
If CursorIsAnimated
SetAnimatedThemeCursor(CursorID, AnimationStep)
Else
SetThemeCursor(#kThemeArrowCursor)
EndIf
EndSelect
ForEver
Code: Select all
ImportC ""
SetThemeCursor(CursorType.L)
EndImport
#kThemeArrowCursor = 0
#kThemeWatchCursor = 7
OpenWindow(0, 200, 100, 200, 180, "Display Wait cursor")
ButtonGadget(0, 40, 70, 120, 20, "Change cursor")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0
If IsWaitCursor
SetThemeCursor(#kThemeArrowCursor)
IsWaitCursor = #False
Else
SetThemeCursor(#kThemeWatchCursor)
IsWaitCursor = #True
EndIf
EndIf
Case -1
If IsWaitCursor
SetThemeCursor(#kThemeWatchCursor)
EndIf
EndSelect
ForEver