summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-15 04:22:11 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-15 04:22:11 +0300
commitc91bc5201596eda73f9df2222d76d9f413426a85 (patch)
treecbdcf7fb76eee35baf7265e5c04da2f13633ab5d /src/guichan/widgets/tabbedarea.cpp
parent255b1c29f47ef3b1e7a9b058c56ef72bfa10c5e3 (diff)
downloadmanaverse-c91bc5201596eda73f9df2222d76d9f413426a85.tar.gz
manaverse-c91bc5201596eda73f9df2222d76d9f413426a85.tar.bz2
manaverse-c91bc5201596eda73f9df2222d76d9f413426a85.tar.xz
manaverse-c91bc5201596eda73f9df2222d76d9f413426a85.zip
Remove some diplicated code from embeded guichan.
Diffstat (limited to 'src/guichan/widgets/tabbedarea.cpp')
-rw-r--r--src/guichan/widgets/tabbedarea.cpp99
1 files changed, 0 insertions, 99 deletions
diff --git a/src/guichan/widgets/tabbedarea.cpp b/src/guichan/widgets/tabbedarea.cpp
index b22d615e9..3c556eeca 100644
--- a/src/guichan/widgets/tabbedarea.cpp
+++ b/src/guichan/widgets/tabbedarea.cpp
@@ -94,15 +94,6 @@ namespace gcn
}
}
- void TabbedArea::addTab(const std::string& caption, Widget* widget)
- {
- Tab* tab = new Tab();
- tab->setCaption(caption);
- mTabsToDelete.push_back(tab);
-
- addTab(tab, widget);
- }
-
void TabbedArea::addTab(Tab* tab, Widget* widget)
{
tab->setTabbedArea(this);
@@ -126,69 +117,6 @@ namespace gcn
removeTab(mTabs[index].first);
}
- void TabbedArea::removeTab(Tab* tab)
- {
- int tabIndexToBeSelected = - 1;
-
- if (tab == mSelectedTab)
- {
- int index = getSelectedTabIndex();
-
- if (index == (int)mTabs.size() - 1
- && mTabs.size() >= 2)
- {
- tabIndexToBeSelected = index--;
- }
- else if (index == (int)mTabs.size() - 1
- && mTabs.size() == 1)
- {
- tabIndexToBeSelected = -1;
- }
- else
- {
- tabIndexToBeSelected = index;
- }
- }
-
- std::vector<std::pair<Tab*, Widget*> >::iterator iter;
- for (iter = mTabs.begin(); iter != mTabs.end(); ++ iter)
- {
- if (iter->first == tab)
- {
- mTabContainer->remove(tab);
- mTabs.erase(iter);
- break;
- }
- }
-
- std::vector<Tab*>::iterator iter2;
- for (iter2 = mTabsToDelete.begin();
- iter2 != mTabsToDelete.end();
- ++ iter2)
- {
- if (*iter2 == tab)
- {
- mTabsToDelete.erase(iter2);
- delete tab;
- tab = 0;
- break;
- }
- }
-
- if (tabIndexToBeSelected == -1)
- {
- mSelectedTab = NULL;
- mWidgetContainer->clear();
- }
- else
- {
- setSelectedTab(tabIndexToBeSelected);
- }
-
- adjustSize();
- adjustTabPositions();
- }
-
bool TabbedArea::isTabSelected(unsigned int index) const
{
if (index >= mTabs.size())
@@ -309,10 +237,6 @@ namespace gcn
drawChildren(graphics);
}
- void TabbedArea::logic()
- {
- }
-
void TabbedArea::adjustSize()
{
int maxTabHeight = 0;
@@ -404,29 +328,6 @@ namespace gcn
}
}
-
- void TabbedArea::mousePressed(MouseEvent& mouseEvent)
- {
- if (mouseEvent.isConsumed())
- return;
-
- if (mouseEvent.getButton() == MouseEvent::LEFT)
- {
- Widget* widget = mTabContainer->getWidgetAt(
- mouseEvent.getX(), mouseEvent.getY());
- Tab* tab = dynamic_cast<Tab*>(widget);
-
- if (tab != NULL)
- setSelectedTab(tab);
- }
-
- // Request focus only if the source of the event
- // is not focusble. If the source of the event
- // is focused we don't want to steal the focus.
- if (!mouseEvent.getSource()->isFocusable())
- requestFocus();
- }
-
void TabbedArea::death(const Event& event)
{
Tab* tab = dynamic_cast<Tab*>(event.getSource());