Putting QuickTime behind other components


#1

Is there a special way to put a Quicktime component behind another component? When my video finishes playing I want a dark semi-transparent component to show up on top of the video, essentially dimming it, and presenting a few options to the user with TextButtons. But this dimming component always shows up behind the Quicktime component. I tried using toBack() as well as setAlwaysOnTop(false) but neither worked.


#2

Anyone got any tips for solving this problem? I’d also like to create a floating controller component that appears over the video, near the bottom, when you move the mouse. But again, I can’t do that if I’m not allowed to overlay another component on top of the Quicktime component.


#3

Lightweight components can’t be drawn over OS windows like quicktime - you’d need to float a separate window over it.


#4

Cool. So I created the controller component as a DocumentWindow, and added it to the desktop, and it stays on top of the QuickTimeComponent. Awesome.

One little issue though. I want the controller to stay on top of the main window, even when I grab the main window. I tried setAlwaysOnTop, but that made the controller stay on top even when I click on other apps (since it was added to the Desktop I’m assuming). I tried overriding the main window’s (which is a DialogWindow) mouseDown method so that whenever the main window is clicked, the controller is brought to the front. This worked, but whenever I grab the mainWindow’s title bar, it jumps over so that the top left corner is suddenly under the mouse. I saw this issue in another thread and you mentioned that the Dialog Window’s mouseDown method has some code in it that would be lost if it was overriden. I didn’t see any in the juce files, but I did see some code in the ResizableWindow’s mouseDown method. So I included it in my overridden method:

[code]void HelpVideoWindow::mouseDown(const MouseEvent& e)
{
// code from overridden method
if (! isFullScreen())
dragger.startDraggingComponent (this, e);

// my code
helpVidComp->bringControllerToFront();

}
[/code]

But that didn’t prevent the jumping window problem. Any suggestions?


#5

When you need to call a function, you call it, you don’t copy-and-paste the code from inside it!!

void HelpVideoWindow::mouseDown(const MouseEvent& e) { DocumentWindow::mouseDown (e); ...


#6

Ah yes of course. I got a little confused there. Thanks for your patience. :slight_smile: