DialogWindow that allows access to MainWindow

Is there a setting in DialogWindow to allow access to the MainWindow behind it while the Window is still open?

I.e. I have a dialog window open that maybe shows an Oscilloscope but still allows me to edit the JUCE app I am running?

I found this
virtual bool Component::canModalEventBeSentToComponent ( const Component* targetComponent )
function but it does not seem to be called from the component I am using to launch the DialogWindow. Maybe it needs to be overridden in a class derived from DialogWindow?

the above function is the one I am looking for, but since JUCE suggests we use the LaunchOptions struct instead of runModal my current set up requires editing the DefaultDialogWindow class. Is this a time where it would be best to just use the runModal alongside a custom DialogWindow? I guess the other option is to recreate the LaunchOptions struct for a custom DialogWindow…

This is not the answer you are looking for, but I think the crux of your issue is the standard poor practice of coupling your data with your UI components. In the long run, the question should not be about how your dialog accesses the main component, but what is the common data that the two of these things access. Your UI is just a view into the data (excepting UI related data such as size, position, etc). Ideally you design the data, and much of the processing of that data, into code that does not require a UI. Then the UI displays/updates the data using API’s you create.

Oh my data is not coupled to the UI. I just want to be able to click on things in the Main UI once I open up a dialog window that displays something tangentially related

But some of your data is coupled. The items you want to control on the main ui are just controls to some underlying data, ie. let’s say there is a button in the main ui, the ‘button’ is a visual representation of the state of something, and it can also toggle that state. but, the ‘state’ it is controlling is the data, not the button.

hmmmm, I am unsure what you mean. None of my data is coupled to a UI object. I want to be able to click stuff in the UI because I want to be able to use the UI as I have this other view open. I don’t think that would imply a coupling. I could give my self access to the data in the second view but that is not the purpose of the second view.

DOH! I totally misunderstood. I am so sorry for wasting your time. words read do I… :crazy_face:

1 Like

Don’t use a dialog window then. Simply use a regular component and put whatever you want in there.

But I want the functionality of a dialog window I.e. movable from all my other stuff as it’s own window. I’m no longer concerned about how to do it. I figured it out. Unless you understand a reason that a dialog window is the wrong choice here? I am essentially making my own component but inherited from the DialogWindow I think… I haven’t sat down and decided if it’s inheriting or just essentially a fork of what the dialogwindow does

Why not to use just a document window and keep it always on the top? At the same time you have your window displayed and can access your main window (and other available windows as well).

hmmm, I hadn’t thought about this. I don’t see a launch function in the documentWindow class though