OnMouseDown

Anything related to Hollywood Designer goes in here
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

OnMouseDown

Post by djrikki »

Hi,

Code: Select all

		case "OnMouseDown"
			if msg.id = #ARROWUP
				if listerY <> 0
					listerY = listerY - 1
					drawUI(0)
				endif
				
			elseif msg.id = #ARROWDOWN

				if listerY <> p_tableSize(listing$)-17 ; *** 17 is a temporary value ***
					listerY = listerY + 1
					drawUI(0)
				endif
			endif

 wait(10) ; a tiny delay so the lister doesn't move up or down too quickly / would be useful if this value decreased the longer the 
                                      ; button is held
I was hoping this piece of code would constantly run as long as I held the left mouse button down without me having to code anything further! But alas it does not! Is something blocking it from it re-iterating through the code? What should I do/look for?
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: OnMouseDown

Post by Bugala »

I dont see error in that, but im not that good at spotting them either.

Maybe problem is elsewhere in the code.

Could be around the CheckEvent() somewhere. Maybe you cant enter twice to the place where CheckEvent() is when mousebutton is down.
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: OnMouseDown

Post by djrikki »

Hi,

Well atm I am not using CheckEvent all, I have a While....Wend loop with a WaitEvent within main(). With various events launched here and there in different routines, can't post complete source - much too many lines, if I can't find a solution I'll upload the project to OS4Depot nearer the time of completion and hope so one can take a look at the source code and come up with answer.
I am also trying to implement a scrollbar which will also require not only OnMouseDown, but also the X and Y of the mouse pointer so its vital I find out what is happening.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: OnMouseDown

Post by Bugala »

try CheckEvent instead of WaitEvent.

Basically there shouldnt be much difference, but just came to my mind that what if there is bug in hollywood on usage of waitevent and onmousedown together.

I have used onmousedown to do things like growing speed bar or increasing throw power, and i think i used checkevent and onmousedown on button and it worked fine.
Post Reply