Capturing GUI Events

BlitzMax Forums/MaxGUI Module/Capturing GUI Events

Xerra(Posted 2006) [#1]
Hi guys,

Been trying to create my own front end for using gman's sid player modules and I'm doing well until I come to the part where I want to double click an entry in my loaded in playlist and I can't seem to get the right event information

Excuse if I'm posting this incorrectly but I'm trying to detect a double click from EventID() or even just a hit so I can do a manual count within the program to intercept it then I can play the double clicked track but I don't seem to be capturing events with this code. I'm trying to display them on the status bar so I know it's working but I must be doing something wrong.

Any help would be much appreciated - I won't have a problem finding out what item in the list has been double clicked, just knowing how to detect the mouse has been clicked in the first place would be a start.

' MARK: Main Loop
Repeat
	WaitEvent()
	Select EventID()
		Case EVENT_MOUSEDOWN
			Event = "Mouse Down"
			
		Case EVENT_MOUSEHIT
			Event = "Mouse Hit"
		
		Case EVENT_GADGETACTION
			DoGadgetAction()	

		Case Event_KEYDOWN
			Event = "Key Down"
			
	End Select
	SetStatusText Sidney , "Event: " + Event

Until EventID()=EVENT_WINDOWCLOSE Or UserHasQuit=True



TomToad(Posted 2006) [#2]
What are you using to display the playlist? I'd assume you are using list boxes. List boxes should return EVENT_GADGETSELECT with single clicks and EVENT_GADGETACTION with double clicks and EVENT_GADGETMENU with right clicks.
This program shows this in action.

If that doesn't work for you, make sure your version of BlitzMAX is properly installed, upgraded and syncmodded.


Wiebo(Posted 2006) [#3]
Xerra, make sure to post your front end once it's done as the SIDplay for windows ui is horrible! :)


Xerra(Posted 2006) [#4]
Wiebo: Be glad to post it up. I'm probably going to add a lot of features like custom playlists and stuff before I do.

TomToad: That's basically what I'm looking for. I presumed I'd have to use an event scan to capture the info I need but it looks like I missed the EVENT_GADGETACTION flag when I was re-reading the gui documentation. Thanks a lot for that, I'll give it a test run now.


Xerra(Posted 2006) [#5]
As an update that example was all I needed to get it up and running. Fixed a few bugs and I've not got a working Sid tune player but the gui does need improving a bit now I've got it up and running.

As a matter of interest what kind of stuff does a Sid player need to do to improve on what the current favourite Sid player actually does?