triggerFakeMouseDown?


#1

Hi, i’m trying to implement the following behaviour:

I have a gallery of picture thumbnails, these are all drawn by my Gallery component. What i want to be able to do is click on a thumbnail and drag it to another component. So, in the Gallery::mouseDown method i create a temporary GalleryImage component for just that thumb. The idea is that this component is the one that moves.

However, what i need to achieve is to put this new GalleryImage component under the same mouse down event, so to speak, so it can be dragged (eg using `ComponentDragger’). I’ve been unsuccessful in trying to redirect the mouse event (i dont think this is the right way anyhow), so i’ve been trying to generate a new mouse down event, eg MouseInputSource::triggerFakeMouseDown(mods). at the mo, that doesnt work properly - having some trouble inside the MouseInputSource.

is there an easier/better way, or shall i continue hacking.

thanks for ideas,
– hugh.


#2

Do you need something more specialised than the normal DragAndDropContainer stuff?


#3

Crikey!, i put in the DragAndDropContainer and it did what i wanted right away! I was trying to build this functionality manually. that will teach me for not checking juce for a ready solution.

thanks very much. this has saved me a lot of trouble.

– hugh.


#4

:slight_smile: