"Wait" or "Working" mouse pointer icon..

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

"Wait" or "Working" mouse pointer icon..

Post by USCode »

Shouldn't there be a cross-platform command in the Mouse library for changing the mouse pointer icon to indicate an application is busy or working? For example, on Windows it would be nice to be able to change the pointer to an hourglass and then back to a pointer. There are functionally equivalent icons on OS X and Linux.

E.g. maybe something like this:
SetMouseIcon(#PB_MouseIcon_Wait)
and it's Get... counterpart:
Icon.l = GetMouseIcon()

Some potential #PB constants:
#PB_MouseIcon_Wait
#PB_MouseIcon_Pointer

Optionally, at a minimum maybe Set... and Get... aren't needed, maybe just MouseIcon to only Set the mouse pointer?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

or so:

Code: Select all

SetWindowMouseIcon(Window, #PB_MouseIcon_Wait)
SetGadgetMouseIcon(Gadget, #PB_MouseIcon_Wait)
You can set Mouse for App and/or for Gadget (Editor for example)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Oh!Oh!Oh!

Yes!

SetMousePointer(yourimagehere) !
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Post by USCode »

Those are great ideas guys!
But to keep it simple, cross-platform and flexible, I'd settle for just the ability to change the icon to wait, then back to pointer! :D
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

USCode wrote:Those are great ideas guys!
Well you might want to stop calling num3 a guy.. I mean.. Look at his bed-poster:

Image


:twisted:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Code: Select all

SetMouseIcon(#NUM3, #PB_Hasselhoff)
:D
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

ts-soft wrote:

Code: Select all

SetMouseIcon(#NUM3, #PB_Hasselhoff)
:D
hehe too late, i guess he already put David in his default windows icons
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

BERESHEIT
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

ts-soft wrote:SetMouseIcon(#NUM3, #PB_Hasselhoff)
Here you go... :P

Code: Select all

#NUM3 = 0 
#PB_Hasselhoff = #NUM3 + 1 
Procedure SetMouseIcon(img, cursor) 
  mycursor = CatchImage(cursor, ?mycursor) 
  CreateImage(img, 32, 32) 
  StartDrawing(ImageOutput(img)) 
  DrawImage(mycursor, 0, 0, 32, 32) 
  For x = 0 To 31 
    For y = 0 To 31 
      If Point(x, y) = #Black 
        Plot(x, y, #White) 
      Else 
        Plot(x, y, #Black) 
      EndIf 
    Next y 
  Next x 
  StopDrawing() 
  icoInf.ICONINFO 
  icoInf\fIcon = #False 
  icoInf\xHotspot = 0 
  icoInf\yHotspot = 8 
  icoInf\hbmMask = ImageID(img) 
  icoInf\hbmColor = mycursor 
  newCursor = CreateIconIndirect_(icoInf) 
  ProcedureReturn newCursor 
EndProcedure 
If OpenWindow(0, 0, 0, 300, 300, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu) And CreateGadgetList(WindowID(0)) 
  StringGadget(1, 10, 20, 280, 25, "Who's your DADDY!?    click here to find out", #PB_String_ReadOnly) 
  newCursor = 0 
  Repeat 
    event = WindowEvent() 
    If EventGadget() = 1 And newCursor = 0 
      Restore daddy 
      Read daddy$ 
      SetGadgetText(1, daddy$ + daddy$ + daddy$ + daddy$) 
      SetGadgetColor(1, #PB_Gadget_BackColor, RGB(0, 255, 255)) 
      SetGadgetColor(1, #PB_Gadget_FrontColor, RGB(255, 0, 0)) 
      ;...New cursor function 
      newCursor = SetMouseIcon(#NUM3, #PB_Hasselhoff) 
      oldWinCursor = SetClassLong_(WindowID(0), #GCL_HCURSOR, newCursor) 
      oldGadCursor = SetClassLong_(GadgetID(1), #GCL_HCURSOR, newCursor) 
    EndIf 
  Until event = #PB_Event_CloseWindow 
  SetClassLong_(WindowID(0), #GCL_HCURSOR, oldWinCursor) 
  SetClassLong_(GadgetID(1), #GCL_HCURSOR, oldGadCursor) 
  DestroyIcon_(newCursor) 
EndIf 
End 
DataSection 
daddy: 
Data.s $48,$41,$53,$53,$45,$4C,$48,$4F,$46,$46,$21,$21,$21,$2E,$2E,$2E,$00 
mycursor: 
Data.b $42,$4D,$76,$02,$00,$00,$00,$00,$00,$00,$76,$00,$00,$00,$28,$00 
Data.b $00,$00,$20,$00,$00,$00,$20,$00,$00,$00,$01,$00,$04,$00,$00,$00 
Data.b $00,$00,$00,$02,$00,$00,$C3,$0E,$00,$00,$C3,$0E,$00,$00,$10,$00 
Data.b $00,$00,$00,$00,$00,$00,$C8,$DE,$FF,$00,$85,$BC,$FF,$00,$62,$A0 
Data.b $F8,$00,$A9,$A1,$D7,$00,$4F,$97,$F6,$00,$32,$88,$F4,$00,$22,$6F 
Data.b $E5,$00,$53,$5C,$E0,$00,$1D,$49,$E1,$00,$28,$44,$A9,$00,$00,$26 
Data.b $D2,$00,$00,$19,$85,$00,$22,$1B,$43,$00,$00,$08,$42,$00,$00,$08 
Data.b $00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$D9,$64,$24 
Data.b $46,$BC,$FF,$54,$DF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$9B,$85,$21 
Data.b $14,$9C,$FF,$64,$BF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$9B,$64,$20 
Data.b $01,$9C,$FF,$62,$7F,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$3B,$95,$11 
Data.b $11,$6D,$FF,$61,$9F,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$D9,$61 
Data.b $22,$6D,$C2,$65,$BF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FD,$86,$96 
Data.b $24,$5B,$F6,$26,$BF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FD,$84,$46 
Data.b $22,$27,$B5,$06,$BF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$DD,$40,$11 
Data.b $22,$46,$92,$06,$BF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$B9,$26,$66 
Data.b $64,$24,$62,$15,$BF,$FF,$FF,$FF,$FF,$FF,$FF,$86,$B3,$77,$99,$BB 
Data.b $99,$76,$52,$25,$BF,$FF,$FF,$FF,$FF,$FF,$F3,$A5,$5B,$99,$B6,$69 
Data.b $99,$BB,$42,$65,$BF,$FF,$FF,$FF,$FF,$FF,$F5,$89,$19,$96,$97,$11 
Data.b $46,$9D,$44,$6A,$BF,$FF,$FF,$FF,$FF,$FF,$F6,$8B,$17,$74,$99,$71 
Data.b $12,$59,$55,$69,$BF,$FF,$FF,$FF,$FF,$FF,$F6,$AD,$45,$96,$69,$72 
Data.b $11,$12,$25,$69,$CF,$FF,$FF,$FF,$FF,$FF,$F6,$BC,$02,$96,$78,$72 
Data.b $12,$11,$14,$6B,$FF,$FF,$FF,$FF,$FF,$FF,$F6,$D3,$F0,$78,$86,$23 
Data.b $12,$21,$02,$8B,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$F0,$FF,$33,$97,$72 
Data.b $26,$54,$12,$9F,$FF,$FF,$FF,$FF,$FF,$FF,$F4,$B0,$FF,$F7,$96,$44 
Data.b $66,$58,$67,$3F,$FF,$FF,$FF,$FF,$FF,$FF,$F1,$19,$FF,$F0,$A8,$85 
Data.b $24,$56,$7F,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$F8,$42,$BC,$DF,$7A,$B9 
Data.b $B9,$22,$0F,$FF,$FF,$FF,$FF,$FF,$F3,$9A,$A7,$22,$77,$DD,$34,$BD 
Data.b $DD,$77,$D0,$FF,$FF,$FF,$FF,$F3,$AA,$AA,$A9,$77,$33,$DD,$01,$24 
Data.b $DD,$CB,$3B,$FF,$FF,$FF,$F3,$7A,$AA,$AA,$AA,$AA,$AB,$DD,$54,$79 
Data.b $9C,$B7,$0B,$3F,$FF,$FF,$AA,$8A,$54,$55,$8A,$AA,$AA,$DE,$21,$94 
Data.b $99,$B7,$09,$9F,$FF,$FF,$AA,$88,$41,$12,$56,$86,$58,$D9,$00,$21 
Data.b $93,$B7,$0B,$7F,$FF,$FF,$FF,$07,$87,$77,$77,$74,$27,$DC,$95,$99 
Data.b $7C,$B8,$0B,$FF,$FF,$FF,$FF,$FF,$03,$23,$37,$00,$00,$FC,$10,$17 
Data.b $9D,$BA,$B3,$FF,$FF,$FF,$FF,$FF,$FF,$F3,$7A,$AA,$AA,$FD,$40,$01 
Data.b $DD,$D7,$0F,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$F9,$4B 
Data.b $DD,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$DD,$DF 
Data.b $DF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$DF 
Data.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 
Data.b $FF,$FF,$FF,$FF,$FF,$FF 
EndDataSection 
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

You sick, sich bunch of very, extremely and totaly perverted people. AFter I picked myself off the floor laughing, I reached for a bucket.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

:shock: whooohaaaa! :?

:lol: :lol: :lol: :lol: :lol: :lol: :lol:

sparkie has the trophy today!
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

:lol:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Image
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

AHAHAHAHAH!
SICK... Just sick....


You're playing with fire!

One of these days, you'll be in court over Mr. Hasselloff image copyrights ...

or even worst...

Mr. Hasselloff will become PB offical P.R. !!!!!

:twisted:
User avatar
IceSoft
Addict
Addict
Posts: 1686
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

Guys!
It should work on all supported OS.
Not only on Windows.

Cross-Platform compatible is the key!
Not one here will get the trophy ;-)
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Post Reply