Control array Moviplayer

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.

Thank you!!

do you need 12 MoviePlayer ?

why not use 12 Button annd 1 MoviePlayer

Could you create a container control with a movie player inside it - that way you get the mousedown event?

Maybe a bit more work getting the info you need in/out of the container but could it work for you?

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.

Would it be possible to use the “play” and “stop” event handlers of the movie player control?

Works on Mac and that’s all that matters - right :wink:
Blue Touch Paper lit…

[quote=183592:@Patrick Delaney]Works on Mac and that’s all that matters - right :wink:
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).

One would think the window must be created before it can be resized?

First of all, Thank you for your answers.

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 !!!

Thank you very much, again.

works on OSX
a movieplayer inside a canvas

see here

click in the movieplayer

[quote=183855:@Axel Schneider]works on OSX
a movieplayer inside a canvas

see here

click in the movieplayer[/quote]

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.

Thanks to all.

Axel: Indeed, this method works perfectly on OSX but does not work in Windows. The explanation for this problem seems to be the answer that has brought Michel B.

I’ll try and I will inform you of the result, if another desarrorador encounter this problem in the future.

Thank you very much, again.

Good morning.
Yeeeessssss!!!
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

Thank you so much Michel.