Page 1 of 2

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

Posted: Tue Mar 14, 2006 8:17 pm
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?

Posted: Tue Mar 14, 2006 8:30 pm
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)

Posted: Tue Mar 14, 2006 10:20 pm
by Num3
Oh!Oh!Oh!

Yes!

SetMousePointer(yourimagehere) !

Posted: Tue Mar 14, 2006 10:24 pm
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

Posted: Tue Mar 14, 2006 10:54 pm
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:

Posted: Tue Mar 14, 2006 11:06 pm
by ts-soft

Code: Select all

SetMouseIcon(#NUM3, #PB_Hasselhoff)
:D

Posted: Tue Mar 14, 2006 11:32 pm
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

Posted: Wed Mar 15, 2006 2:36 am
by netmaestro

Posted: Wed Mar 15, 2006 6:29 am
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 

Posted: Wed Mar 15, 2006 7:40 am
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.

Posted: Wed Mar 15, 2006 10:10 am
by blueznl
:shock: whooohaaaa! :?

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

sparkie has the trophy today!

Posted: Wed Mar 15, 2006 11:40 am
by Fred
:lol:

Posted: Wed Mar 15, 2006 11:45 am
by ts-soft
Image

Posted: Wed Mar 15, 2006 12:06 pm
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:

Posted: Wed Mar 15, 2006 1:03 pm
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 ;-)