Resize Main Window always keeping it docked to the right of the screen


#1

Bonjour, I am new the Juce programming. at the moment I am trying to design an App that would have a Windows that would be able to resize the following way:
1 - On opening, the windows will have 150 pixel wide and it’s Height will be the height of the user screen. Lets call it the Strip section.
2 - When a button named Panel is clicked inside the Strip section, The windows stays docked to the right of the screen and grow from the left side to now be of 750 pixel wide. So the Main windows now as to be 750 pixel Wide and shows the Strip and Panel sections.
3 - When a button named View is clicked inside the Strip section, The windows stays docked to the right of the screen and grow from the left side to now be be the full screen wide. So the Main windows now as to be the full width of the screen. It now shows the Strip, the Panel and the View sections.

The operation has to be reversed going from the View section, to the Panel section back to the Strip section. When going from right to left the sections stay displayed, when going from left to right, the différent sections are hidden.

I am able to display Group of objects Hide them or display them in their respective sections.
But I have not found any way to force a resize of the Main Window going from a section to another. And I cannot find a command that would force the Main Window to anchor itself to the right side of the screen.

Is it possible to do? Can you guide me to code exemple or documentation I could verify?

Merci to take some time to answer me, it would be greatly appreciated.


#2

You could do something like

auto area = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
getPeer()->setBounds (area.removeFromRight (150), false);

in the constructor of your component.


#3

Merci for your answer. I am finishing a mastering project in my recording studio for the next 3 days. I will go back to my coding then and try your code, I will let you know the results. Again merci for your feedback.