i have 3(A,B,C) sections on my main window and they cover all of my window. there is no gap between them . it looks like this
https://i.hizliresim.com/E2EDzB.jpg
Each section has its own editor class. In resized method of my pluginEditor i draw them within their bounds like this :
void MyPlugInAudioProcessorEditor::resized()
{
auto area = getLocalBounds();
const auto delayGuiArea = area.getWidth() * delayGui.delayGuiWidth_float / windowWidth_float;
const auto reverbGuiArea = area.getWidth() * reverbGui.reverbGuiWidth_float / windowWidth_float;
const auto outputGuiArea = area.getWidth() * outputGui.outputGuiWidth_float / windowWidth_float;
if (reverbGui.rockerButtonSituation == 1)
{
reverbGui.setBounds(area.removeFromLeft(reverbGuiArea));
delayGui.setBounds(area.removeFromLeft(delayGuiArea));
}
else if (reverbGui.rockerButtonSituation == 0)
{
delayGui.setBounds(area.removeFromLeft(delayGuiArea));
reverbGui.setBounds(area.removeFromLeft(reverbGuiArea));
}
outputGui.setBounds(area.removeFromLeft(outputGuiArea));
}
Normally there is a rocker switch on the reverb module which is represented as a yellow rectangle and named as 2 in the pic. Everything about this switch is in the reverb editor. In mainwindow editor i am just checking a flag that is being changed according to that rocker switch situation. And according to flag, reverb and delay sections are going to replace their locations. But since my rocker switch is also moving to right and left. It is really annoying to watch it.
What i am trying to do is moving that rocket switch between delay and reverb sections.(red rectangle named as 1 in pic) So it won’t move. And looks like in order to do that i need to define it or call it from my main editor class an draw it in paint method over the delay and reverb secitons. But whatever i did to bring it front , didn’t work. It stays in the background. I tried tofront and setAlwaysOnTop methods after drawing the rocker switch but again it didn’t work.
What do you suggest me to do ?