97 mEnableScrollButtons(false),
98 mFollowDownScroll(false),
99 mBlockSwitching(true),
176 TabContainer::const_iterator itr =
mTabs.begin();
177 const TabContainer::const_iterator itr_end =
mTabs.end();
178 while (itr != itr_end)
180 if ((*itr).first->getCaption() == name)
181 return static_cast<Tab*
>((*itr).first);
216 TabContainer::const_iterator itr =
mTabs.begin();
217 const TabContainer::const_iterator itr_end =
mTabs.end();
218 while (itr != itr_end)
220 if ((*itr).first->getCaption() == name)
221 return (*itr).second;
241 if ((tab ==
nullptr) || (widget ==
nullptr))
248 mTabs.push_back(std::pair<Tab*, Widget*>(tab, widget));
267 if (widget ==
nullptr)
276 Tab *
const tab =
new Tab(
this);
285 Tab *
const tab =
new Tab(
this);
294 if (index >=
mTabs.size())
304 if ((*it).first == tab || (*it).second == tab)
317 if (index >=
mTabs.size())
325 int tabIndexToBeSelected = -1;
330 const size_t sz =
mTabs.size();
331 if (index ==
CAST_S32(sz) - 1 && sz == 1)
332 tabIndexToBeSelected = -1;
334 tabIndexToBeSelected = index - 1;
337 for (TabContainer::iterator iter =
mTabs.begin();
338 iter !=
mTabs.end(); ++iter)
340 if (iter->first == tab)
348 for (STD_VECTOR<Tab*>::iterator iter2 =
mTabsToDelete.begin();
360 if (tabIndexToBeSelected >= tabsSize)
361 tabIndexToBeSelected = tabsSize - 1;
362 if (tabIndexToBeSelected < -1)
363 tabIndexToBeSelected = -1;
365 if (tabIndexToBeSelected == -1)
396 Tab *
const tab =
dynamic_cast<Tab *
>(widget);
409 for (
size_t i = 0; i <
mTabs.size(); i++)
415 for (
size_t i = 0; i <
mTabs.size(); i++)
417 if (
mTabs[i].first == tab)
424 Tab *
const newTab = tab;
426 if (newTab !=
nullptr)
437 for (
size_t i = 0; i <
mTabs.size(); i++)
466 if (((*itr).first !=
nullptr) && (*itr).first->getCaption() == name)
482 const int height = h1 - frameSize
525 if (newWidth < innerWidth)
532 const int width = w1 - frameSize - widgetFrameSize;
550 Tab *
const tab = (*itr).first;
559 unsigned int visibleTabsWidth = 0;
571 int maxTabHeight = 0;
576 for (
size_t i = 0, sz =
mTabs.size(); i < sz; i++)
578 if (
mTabs[i].first->getHeight() > maxTabHeight)
579 maxTabHeight =
mTabs[i].first->getHeight();
590 const int frame2 = 2 * wFrameSize;
608 int maxTabHeight = 0;
609 const size_t sz =
mTabs.size();
610 for (
size_t i = 0; i < sz; ++i)
612 const Tab *
const tab =
mTabs[i].first;
613 if ((tab !=
nullptr) &&
652 Tab *
const tab =
dynamic_cast<Tab *
>(source);
660 const std::string &eventId = actionEvent.
getId();
661 if (eventId ==
"shift_left")
666 else if (eventId ==
"shift_right")
720 return static_cast<Tab*
>(
mTabs[index].first);
727 return mTabs[index].second;
811 Tab *
const tab =
dynamic_cast<Tab*
>(
event.getSource());
const std::string & getId() const
virtual void add(Widget *const widget)
void setOpaque(Opaque opaque)
virtual void safeDrawChildren(Graphics *const graphics)
virtual void logicChildren()
Widget * getWidgetAt(int x, int y)
virtual void remove(Widget *const widget)
void add(Widget *const widget)
void death(const Event &event)
virtual void drawChildren(Graphics *const graphics)
Widget * getSource() const
void removeDragged(const Widget *const widget)
MouseButtonT getButton() const
void setTabbedArea(TabbedArea *tabbedArea)
const std::string & getCaption() const
void setCaption(const std::string &caption)
void setImage(Image *const image)
virtual void setCurrent()
void updateVisibleTabsWidth()
Widget * getWidgetByIndex(const int index) const
TabbedArea(const Widget2 *const widget)
bool isTabSelected(const size_t index) const
bool isTabPresent(const Tab *const tab) const
Widget * getCurrentWidget() const
void keyPressed(KeyEvent &event)
std::vector< Tab * > mTabsToDelete
BasicContainer2 * mWidgetContainer
void removeTab(Tab *const tab)
void setSelectedTabDefault()
void mousePressed(MouseEvent &event)
void setHeight(int height)
unsigned int mTabScrollIndex
void draw(Graphics *const graphics)
void adjustWidget(Widget *const widget) const
void setSelectedTabByName(const std::string &name)
Tab * getTab(const std::string &name) const
void widgetResized(const Event &event)
void safeDraw(Graphics *const graphics)
void setSelectedTab(Tab *const tab)
bool mEnableScrollButtons
BasicContainer2 * mTabContainer
void adjustTabPositions()
int getNumberOfTabs() const
void updateArrowEnableState()
void removeAll(const bool del)
void setSize(int width, int height)
int getSelectedTabIndex() const
void setDimension(const Rect &dimension)
void action(const ActionEvent &actionEvent)
void addTab(Tab *const tab, Widget *const widget)
void setSelectedTabByIndex(const size_t index)
void death(const Event &event)
Tab * getSelectedTab() const
Widget * getWidget(const std::string &name) const
Tab * getTabByIndex(const int index) const
void enableScrollButtons(const bool enable)
#define FOR_EACH(type, iter, array)
#define BLOCK_START(name)