emy
New Member
Hello
Posts: 45
|
Post by emy on Jan 27, 2022 9:59:03 GMT -5
Hello, I made a small program with one graphicbox. A bmp bigger size of the graphicbox is loaded. Instead of scrollbar Vet. & Hoz. (cancelled with a stylebits) I can move the bmp by panning and see all of it. It works nice, as I want. But I would like to use an other kind of cursor (hand for example) instead of the regular arrow. I try the hand cursor of Windows, but it doesn't work ! they do not work. I have a PC with XP with no problems until now. Are they special cursor for Liberty Basic V4.5.1 ? Is it a special format ? Or something special ? Where I can find this kind of cursors witch are working with LB? Where I can find a simple programme that I can draw my own cursor and get it working on LB? Thank You ForYour Help. Regards. Emy
|
|
|
Post by Rod on Jan 27, 2022 12:24:29 GMT -5
Are you using the Liberty cursor command? Code would be nice.
|
|
|
Post by tsh73 on Jan 27, 2022 12:50:17 GMT -5
|
|
|
Post by Walt Decker on Jan 27, 2022 14:09:00 GMT -5
|
|
|
Post by Rod on Jan 27, 2022 14:13:13 GMT -5
|
|
|
Post by Brandon Parker on Jan 27, 2022 17:54:53 GMT -5
Here are some functions that might come in handy...
When you press the "Run" button on the Liberty BASIC IDE, do not move the mouse at all and you will see it change to the pointing hand cursor.
'This is the pointing hand's value handCursor = 32649
'Load the cursor and return the handle 'into the hCursor variable hCursor = LoadCursor(handCursor)
'Set the cursor to the desired object result = SetCursor(hCursor)
'Input here just to wait; no need to 'input anything special Input a
'Destroy the cursor prior to closing the program 'or when you no longer need it result = DestroyCursor(hCursor)
Wait
'__________________________________________________________________________________________________________________________________ '__________________________________________________________________________________________________________________________________
Function LoadCursor(nCursor) flags = HexDec("8000") Or _LR_DEFAULTSIZE CallDLL #user32, "LoadImageA", 0 As ulong, _ nCursor As ulong, _ _IMAGE_CURSOR As ulong, _ 0 As long, _ 0 As long, _ flags As ulong, _ LoadCursor As uLong End Function
'__________________________________________________________________________________________________________________________________ '__________________________________________________________________________________________________________________________________
Function GetCursor() CallDLL #user32, "GetCursor", GetCursor As ulong End Function
'__________________________________________________________________________________________________________________________________ '__________________________________________________________________________________________________________________________________
Function SetCursor(hCursor) CallDLL #user32, "SetCursor", hCursor As ulong, _ SetCursor As ulong End Function
'__________________________________________________________________________________________________________________________________ '__________________________________________________________________________________________________________________________________
Function DestroyCursor(hCursor) CallDLL #user32, "DestroyCursor", hCursor As ulong, _ DestroyCursor As long End Function
{:0)
Brandon Parker
|
|
emy
New Member
Hello
Posts: 45
|
Post by emy on Jan 28, 2022 5:48:33 GMT -5
Hello Rod, tsh73, Brandon Thanks for Your answer, and the example from Brandon. I use Liberty cursor. I made this program from Brandon example. I check Libertybasicuniversity, only 5 pointer available, no hand pointer. I find this example easy and simple to follow, even how to use the command 'cursor' it should be more mouse pointer.
Thanks to All Regards.
The Bmp should be bigger than 300x500
'------------------------------------------------- ' Winpaning.bas '------------------------------------------------- 'cursor normal Works 'cursor crosshair Works 'cursor hourglass Works 'cursor Hand1 Not working 'cursor hmove Not working 'cursor harrow.cur Not working '................................................ nomainwin WindowWidth = 325 WindowHeight = 550 UpperLeftX = 100 UpperLeftY = 100 graphicbox #w.gbx, 10, 10, 300, 500 '................................................ open "Moving BMP (Paning)" for Window_nf as #w #w, "trapclose [quit]" '................................................ #w.gbx, "down" loadbmp "image", "cadres.bmp" #w.gbx, "cls; drawbmp image 0 0;flush" '................................................ x2 = x1 : y2 = y1 '................................................ #w.gbx "when leftButtonDown [startmove]" #w.gbx "when leftButtonUp [endmove]" wait '------------------------------------------------- [startmove] cursor crosshair 'hourglass 'crosshair '<--- imagex = x1 - MouseX : imagey = y1 - MouseY #w.gbx "when leftButtonMove [move1]" wait '------------------------------------------------- [move1] x1 = MouseX + imagex : y1 = MouseY + imagey '................................................ if x1 < -180 then x1 = -180 '\ if y1 < -308 then y1 = -308 '¶ Prevent to move the bmp if x1 > 0 then x1 = 0 '¶ out of the graphicbox! if y1 > 0 then y1 = 0 '/ '................................................ #w.gbx "cls" #w.gbx "drawbmp image ";x1;" ";y1 wait '------------------------------------------------- [endmove] #w.gbx "when leftButtonMove" cursor normal x2 = x1 : y2 = y1 wait '------------------------------------------------- [quit] unloadbmp "image" cursor normal close #w end '-------------------------------------------------
|
|
emy
New Member
Hello
Posts: 45
|
Post by emy on Jan 28, 2022 5:57:19 GMT -5
Sorry, I don't Know what happened !
|
|
|
Post by tsh73 on Jan 28, 2022 8:21:13 GMT -5
Obviously [ move ] is forum engine comment. Changed to [ move1 ]
|
|
emy
New Member
Hello
Posts: 45
|
Post by emy on Jan 28, 2022 8:39:50 GMT -5
Yes, because before I did try something elle with the label
|
|
emy
New Member
Hello
Posts: 45
|
Post by emy on Jan 30, 2022 11:59:26 GMT -5
How to insert a zip file ? Thanks
|
|
|
Post by Brandon Parker on Jan 30, 2022 14:00:47 GMT -5
How to insert a zip file ? Thanks What do you mean by that? {:0) Brandon Parker
|
|
emy
New Member
Hello
Posts: 45
|
Post by emy on Jan 30, 2022 15:13:18 GMT -5
Hello Brandon, With Your example, I could make programme that works with Hand cursor. I want to post it as a zip file ( bas file; bmp file and cursor file) that You can see it. And read commentary if necessary. I can't see the icons for attachment. Thanks
|
|
|
Post by Rod on Jan 30, 2022 15:25:53 GMT -5
I am afraid you will need to find a host for your .zip. The forum has a limited storage capacity. There are multiple file hosts to explore.
After that post a link to your file.
|
|
|
Post by Brandon Parker on Jan 30, 2022 15:43:20 GMT -5
How large is the BAS file?
{:0)
Brandon Parker
|
|