コード例 #1
0
void ColorChooser::updateLayout(void)
{
	Pnt2f InsetsTopLeft, InsetsBottomRight;
	getInsideInsetsBounds(InsetsTopLeft, InsetsBottomRight);

	ComponentRefPtr PreviewPanel;
	if(getPreviewPanel() != NULL)
	{
		PreviewPanel = getPreviewPanel();
	}
	else
	{
		PreviewPanel = _DefaultPreviewPanel;
	}
	Pnt2f PreviewTopLeft(InsetsTopLeft.x(), InsetsBottomRight.y()), PreviewBottomRight(InsetsBottomRight);
	PreviewTopLeft.setValues(PreviewTopLeft.x(), InsetsBottomRight.y()-PreviewPanel->getPreferredSize().y());
		PreviewPanel->setPosition(PreviewTopLeft);
		PreviewPanel->setSize(PreviewBottomRight - PreviewTopLeft);

	Pnt2f ChooserTopLeft(InsetsTopLeft),
		  ChooserBottomRight(InsetsBottomRight.x(), PreviewTopLeft.y());
	if(getMFInternalChooserPanels()->size() > 1 &&
		_LayoutTabPanel != NULL)
	{
			_LayoutTabPanel->setPosition(ChooserTopLeft);
			_LayoutTabPanel->setSize(ChooserBottomRight - ChooserTopLeft);
	}
	else if(getMFInternalChooserPanels()->size() == 1)
	{
			editMFInternalChooserPanels()->front()->setPosition(ChooserTopLeft);
			editMFInternalChooserPanels()->front()->setSize(ChooserBottomRight - ChooserTopLeft);
	}

}
コード例 #2
0
Vec2f FlowLayout::getAppropriateComponentSize(ComponentRefPtr TheComponent)
{
    Vec2f ComponentSize(0.0f,0.0f);
    if(TheComponent != NULL)
    {
        ComponentSize = TheComponent->getPreferredSize();
        if(ComponentSize.x() < TheComponent->getMinSize().x())
        {
            ComponentSize[0] = TheComponent->getMinSize()[0];
        }
        if(ComponentSize.y() < TheComponent->getMinSize().y())
        {
            ComponentSize[1] = TheComponent->getMinSize()[1];
        }
    }
    return ComponentSize;
}