I am developing an application in Xojo 2015 in which I show a matrix 12 moviplayers controls.
Is there any way to find out which of the items the user is clicking the mouse?
I have not found any events or control property Moviplayer let me know which element of the 12 existing moviplayer has been clicked.
If you were on a windows system, you could “Peek” at the windows messages that aren’t getting handled by Xojo for the object events (gotfocus/mousedown/etc). I’m not sure how the Mac messaging system works though.
Alternatively you could place transparent canvas controls over the movieplayer controls, and when the user clicks the invisible canvas (looks like they’re clicking the movieplayer), execute the appropriate events for the associated movieplayer?
[quote=183575:@Matthew Combatti]If you were on a windows system, you could “Peek” at the windows messages that aren’t getting handled by Xojo for the object events (gotfocus/mousedown/etc). I’m not sure how the Mac messaging system works though.
Alternatively you could place transparent canvas controls over the movieplayer controls, and when the user clicks the invisible canvas (looks like they’re clicking the movieplayer), execute the appropriate events for the associated movieplayer?[/quote]
Seems a bit hacky to me.
Putting the movie player into a container seems a very straightforward solution, in essence you’d be creating a reusable control.
On Windows though, if you place a control in a container control, the container control doesn’t receive any events unless you directly interact with the container itself. Clicking on the movieplayer embedded in the container would still have no click events, and clicking the movieplayer would not raise any container events. You’d then, in that case, have to make the user click a region surrounding the movieplayer.
[quote=183592:@Patrick Delaney]Works on Mac and that’s all that matters - right
Blue Touch Paper lit…[/quote]
That makes me curious. So if you have a button in a containercontrol and click it, the mousedown event is passed to the button and the containercontrol? Just sparked my curiosities because ive never seen that happen on my windows, mac, or Linux machines. I’m just wondering if this behavior is OS version specific. I can see possibly gotfocus firing for both controls since one is a child of the other. Not doubting you at all just trying to learn something new as I’ve never seen this behavior happen unless I specificity click the container region…perhaps if a control can’t ‘getfocus’ (movieplayer) focus is extended to the parent (container). I recently learned that mac also invokes the resize event of windows before the open event… which just seems odd to me (see ElastiControls).
Axel S: I Can not create more buttons and one MoviePlayer, because the application must show the 10 videos and the user selects one of them.
As Matthew C explains, placing the MoviePlayer into another container (Canvas, Label, etc.) container no longer receives any events, events only receives Movieplayer and this does not have any events for detecting that the mouse is clicked .
I can not understand how Xojo can make these mistakes !!!
Windows does not trigger the MouseDown event, even if one places a canvas over the MoviePlayer. This must have to do with some OLE issue, since AFAIK that is how the MoviePlayer is done. Note that the same issue exists for HTMLViewer. When it is a system issue of that nature, it is difficult to blame Xojo.
The workaround is to use System.MouseDown, System.MouseX and System.MouseY in a timer to check when the mouse is clicked inside the MoviePlayer.
Finally, and as directed by Michel Bujardet, I could do what I needed to use the event system.MouseDown and the properties system.Mouse X and system.Mouse Y … Combining with the properties windows.top and window.left