I have a component that shall divide its client area between 2 components (with a resize bar in between):
class ContentAndHelpComponent : public Component
{
StretchableLayoutManager m_layoutManager;
public:
ContentAndHelpComponent(ContentWindow* pContentWindow)
{
addAndMakeVisible(pContentWindow);
addAndMakeVisible(new StretchableLayoutResizerBar(&m_layoutManager, 1, true));
addAndMakeVisible(new InfoWindow);
m_layoutManager.setItemLayout (0, // for item 0
-.6, -1., // must be between 60 and 100 % in size
-1.); // and its preferred size is 100% of the total available space
// The resizer bar
m_layoutManager.setItemLayout (1,
8, 8,
8);
m_layoutManager.setItemLayout (2, // for item 2
-0., -.4, // size must be between 0% and 40% of the available space
-0.); // and its preferred size is 0 pixels
}
~ContentAndHelpComponent()
{
deleteAllChildren();
}
void resized()
{
// make a list of our child components that we want to reposition
Component* comps[] = { getChildComponent(0), getChildComponent(1), getChildComponent(2) };
// this will position the components, one beside the other, to fit
// horizontally into the rectangle provided.
m_layoutManager.layOutComponents (comps, 3,
0, 0, getWidth(), getHeight(),
false,
true);
}
};
I can see the first component, but I cannot move the resize bar (from the far right) more than a few pixels. What am I doing wrong ?