Example #1
0
void TabbedArea::adjustTabPositions()
{
    int maxTabHeight = getMaxTabHeight();
    int x = 0;

    TabContainer::iterator itr = mTabs.begin(), itr_end = mTabs.end();
    while (itr != itr_end)
    {
        Tab* tab = itr->first;
        tab->setPosition(x, maxTabHeight - tab->getHeight());
        x += tab->getWidth();

        itr++;
    }
}
Example #2
0
    void TabbedArea::adjustTabPositions()
    {
        int maxTabHeight = 0;
        unsigned int i;
        for (i = 0; i < mTabs.size(); i++)
        {
            if (mTabs[i].first->getHeight() > maxTabHeight)
            {
                maxTabHeight = mTabs[i].first->getHeight();
            }
        }

        int x = 0;
        for (i = 0; i < mTabs.size(); i++)
        {
            Tab* tab = mTabs[i].first;
            tab->setPosition(x, maxTabHeight - tab->getHeight());
            x += tab->getWidth();
        }
    }