ArrowHourglass mouse cursor?

Thanks for the links, will look into them.

I agree this is not ideal, I created a feedback case to get Xojo to add the cursor to the Cursors type. It literally would be the exact same code as the Wait cursor except they’d send 32650 to the LoadCursorW function instead of 32514.

I can’t worry about what future versions of Windows will bring - When a new OS breaks something, we patch the software, that’s how it’s always worked. But the reason the mouse cursor is important is:

2022-08-16_7-50-17

How does the user know they can click the cancel button here? And where is the hotspot of the mouse? Is it in the top left? Center? Everything is a guess from the user’s perspective. The solution is already built into the Windows API, we just can’t access it from a Xojo window.

Appreciate the help though, cheers and best of luck with your projects on Win11. I’ve had some frustrations with the OS as well (which is why I haven’t upgraded my personal system yet).

Open a feature request in Xojo Issues.

How does the user know they can click the cancel button here?
the area of popup where the user get information that he must wait get the wait cursor.
if the user move the mouse over other ui he could get this default pointer.

or
you would use a progress bar or progress wheel and let the mouse a arrow if your app is accessible.

grafik

1 Like

What exactly you can’t do ?
a. Change the cursor
b. Create a custom cursor
c. Create an animated cursor

Look this screen shot:

This project allow the user to change the ListBox MouseCursor, using one of the System.Cursors OR Custom.

What is Custom in this context ?
The code takes the Clipboard available Picture and convert it as a cursor (I made a copy of  and get that as a cursor (RAW Cursor, whith white background since it was only to recall how this project worked).

Of course, this MouseCursor change when the Mouse is ut of the ListBox.

I do not tried to create a multiple Picture object, so I do not know if this work.

I wrote that on January 22nd, 2022, and run it now with Xojo 2022r2 (m1 MacBookPro / Monterey 12.5). The code is some lines only (including tests)… but warning: you can pass a large image asa MouseCursor (on macOS, not tested on WIndows) by error, so limit the picture size.


Case "Custom"
  Dim Clip As New Clipboard
  Dim Curs_Pict As New Picture(40,40)
  
  If Clip.PictureAvailable Then
    Curs_Pict = Clip.Picture
    Clip.Close
    Dim thisMouse As New MouseCursor(Curs_Pict, 0, 0)
    
    Me.MouseCursor = thisMouse
  End If

Remember: in my code above, I use a ScreenShot I’ve done before I click in Custom (last line of the first screen shot above).

Thus my question above: what do not worked for you ?

Read the thread.

I do that many times…

https://cdn-cf-east.streamable.com/video/mp4/7eme12.mp4?Expires=1660772160&Signature=TpiT018yIW4e36lw3HyZh-G4zO9~0tpAJRy4v4ojGkhdd9DOK35y9jZJP1tpk2AtM8veyLw6~ViMl0zGdgcg~mTV8HS24Jmx2u8bxy1c7edTArX1eomSosxgRdWIUzrX~ZecCc2qws2F6netNzAq-m~MTLhLUY-zZLvgnr3wuayM3uDJqpKTA9U84bTwntmWd03NLLc5xYwZ7LsCpWNhmed5~clNVUMIwW~cce6bpWzEzkUI5LPBvwsjK5LuRrPx86z3Zd953ubqVh1vh~jt8evs6W87uYJ9qZ3ppRCXYsXOYpj5prKiCqIsbtjDab3rI-GrAVr0DzO~JBIqwU3SEg__&Key-Pair-Id=APKAIEYUVEN4EVB2OKEQ

The OP wants both the arrow and the wait circle. Xojo provides only the wait circle.

It’s a special animated (usually) cursor provided by Windows. It matches the theme that the user’s system is set to, so it’s not just as simple as providing your own custom cursors, you would need to read the registry to determine the filename of cursor the current system theme is using, then read that file containing that cursor, which could be in one of a few different file formats. Then possibly animate it.

In other languages like .Net it is one of the mouse cursor constants alongside Wait and can be done in one line.

OK. I wasted my time.

Here’s what I’ve done:

I wrote code to open them, place them into a Picture array and get an error or two or… and the last error was… surprising:

The seven files have the exact same aspect ratio: the only differences are the file names and the colored large dot (R, G, B, C, M, Y and grey)…

I go ahead and try some different code, then I stopped when I get the error about aspect ratio).

Hi Markus,

I followed your advice, but I am not sure that I get an animated cursor. Here is the used code (the images are in the folder (watch the folder screen shot above):


Sub Action() Handles Action
  Var dlg As New SelectFolderDialog
  dlg.ActionButtonCaption = "Select"
  dlg.Title = "Title Property"
  dlg.PromptText = "Prompt Text"
  dlg.InitialFolder = SpecialFolder.Documents
  
  Var f As FolderItem
  f = dlg.ShowModal
  If f = Nil Then
    // User cancelled
    Return
  End If
  
  Var Pict(6) As Picture
  Var Pict_Idx As Integer
  Var Loop_Idx As Integer
  Var Fldr_Cnt As Integer = f.Count - 1 // .DS_Store
  Var Curs_FI As FolderItem
  
  For Loop_Idx = 0 To Fldr_Cnt
    Curs_FI = f.ChildAt(Loop_Idx)
    If Curs_FI.Name <> ".DS_Store" Then
      Pict(Pict_Idx) = Picture.Open(Curs_FI)
      
      Pict_Idx = Pict_Idx + 1
    End If
    
    If UserCancelled Then Exit
  Next
  
  Var Pictu As New Picture(19,30, Pict) // Now the Pict array is populated…
  Var thisMouse As New MouseCursor(Pictu, 0, 0)
  
  Self.MouseCursor = thisMouse
End Sub

The cursor is the “gris” one and I do not saw any animation, but I do not say there is not, just I do not saw it if there is one (ONE, not continuously).

I think so. AFAIK the picture array is for different DPI settings. Maybe Xojo chooses the right picture to display a mouse cursor with a higher resolution but does not animate it.

I do not think so. They use it that way, but we always been able to load multi Picture files and display their contents (separateley)…
I remember using load Picture and Picture (Index) to get their png, jpg, tiff contents.

After some minutes, I realized that there is no way to tell Xojo to animate the files (cursors here), so how can it be animated at display time …

The only way I can think of would be to do it manually and repeatedly change the cursor with a timer. Not fun.

1 Like

This is from the current help for Picture:

The height and width are in points. The bitmaps are copied upon creation. All bitmaps must have the same aspect ratio. A bitmap’s DPI will be calculated from the point size and the bitmap’s size in pixels. Pictures created using this constructor have their Type set to Types.Image.

You can animate a mouse cursor setting it’s image via timer. You should do that as App.MouseCursor = …

The picture array parameter in the Picture constructor is not the frames of an animation. As Carsten says, it is for supplying multiple bitmap resolutions for the “same” picture.

As Christian and Carsten observe, the way to animate cursor is by loading pic sequence, creating MouseCursor sequence (array), then looping through that with a timer.

Something like this …

Disclaimer: knocked up very quickly, no error checking, very crude just to show the basic idea, and only tested on my Mac.

Regards,

Charlie

ok, at least you can make a folder here and change the mouse appearance
at your need if you host your own software.
so you could replace the default wait cursor.


a cool feature instead of the default static mouse cursor :slight_smile:

Any link ? TIA.

i found some nice animated cursor or sets here

1 Like

Thank you Markus :slight_smile:

Yes, using a timer to “rotate" the different pictures is an idea. Better use a real animated cursor.

For the record:

the concept of placing “multiple versions” (read below) of an image in a single file predates Xojo existence.

“multiple versions”: you can place in the same file many versions (stored as png, gif, tiff, jpg) of the same image.

I hope Christian have his answer by now.