Hi,
I’m working on a splitted window which can display some components under the resizer bar. I know how to display some components by inserting them directly in the MainComponent.h file (i started from the tutorial of haydxn), but I’d like to create a subclass of component and display it int the StretchableLayoutManager, but it doesn’t work… D Does somebody know how to display in a Layout a class which contains components?
Her is the code of my MainComponent class constructor:
[code]MainComponent()
: Component( T(“Main Component”) )
{
//verticalLayout.setItemLayout(0, -0.2, -0.8, -0.5);
//verticalLayout.setItemLayout(1, -0.2, -0.8, -0.5);
//verticalDividerBar = new StretchableLayoutResizerBar (&verticalLayout, 1, true);
//addAndMakeVisible (verticalDividerBar);
comp1 = new Component1();
addAndMakeVisible(comp1);
horizontalLayout.setItemLayout(0, 8, 8, 8);
horizontalLayout.setItemLayout(1, -0.2, -1.0, -0.5);
horizontalLayout.setItemLayout (2, 2, 5, 5);
horizontalDividerBar = new StretchableLayoutResizerBar (&horizontalLayout, 1, false);
addAndMakeVisible (horizontalDividerBar);
}[/code]
comp1 is the instance of my class Component1, which contains several components. Here is the code of the constructor of Component1:
[code]Component1::Component1()
: Component( T(“component1”) )
{
addAndMakeVisible(boldButton = new ToggleButton (T(“bold”)));
boldButton->setBounds(10,10,60,30);
addAndMakeVisible(itaButton = new ToggleButton (T("ita")));
itaButton->setBounds(100,100,60,30);
}[/code]
I hope you get the idea. Thank you for your help!
Leskimo