I am pretty new to the whole juce stuff and i want to thank jules for the whole bunch of work he did.
And here comes the question: what is the right way to show non-modal dialog? I want, that some settings dialogs sit in their own windows and do not block the main window. What i did:
- wrote content component with jucer
- instantiated my container from DialogWindow (is it the correct class for this? or would DocumentWindow be more appropriate?
- in my container window, implemented:
– Constructor
LightEditComponent *lec = new LightEditComponent();
setContentComponent((Component*)lec, true, true);
setVisible(true);
setOpaque(true);
setResizable(false, false);
and closeButtonPressed():
delete this;
- when in content component exit button is pressed (i have a couple of buttons in there), i call
DialogWindow* parent = (DialogWindow*)getParentComponent();
parent->closeButtonPressed()
is it a correct way to close and delete this dialog?
There is also a problem: i open my dialogs through “bool perform(const InvocationInfo& info)” of my main window, i. e. i have:
bool MainWindow::perform(const InvocationInfo& info) {
switch(info.commandID) {
// blabla...
case editLightEdit: {
LightEditDialog* dialog = new LightEditDialog(params);
break;
}
default:
return false;
}
return true;
}
and when i open one of the dialogs, all menu entries are colored grey (i cannot click them). When i close the dialog, all menu entries are enabled again. What could be the cause of this?