summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-08 23:52:24 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-08 23:59:28 +0100
commit369c88d1b24e17afa4dee418e01eae187d3a4169 (patch)
treee6572ccee385297f78e185d7697849284cf9205c /src/gui/widgets/tabbedarea.h
parentd8d6adf10fb059642b5415b7f80423dced4eaa56 (diff)
downloadmana-client-369c88d1b24e17afa4dee418e01eae187d3a4169.tar.gz
mana-client-369c88d1b24e17afa4dee418e01eae187d3a4169.tar.bz2
mana-client-369c88d1b24e17afa4dee418e01eae187d3a4169.tar.xz
mana-client-369c88d1b24e17afa4dee418e01eae187d3a4169.zip
Added a tab scrolling system in tabarea.
Currently working on the chat window. Resolves: Mana-Mantis #308. Reviewed-by: Thorbjorn.
Diffstat (limited to 'src/gui/widgets/tabbedarea.h')
-rw-r--r--src/gui/widgets/tabbedarea.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index 925da2de..19393f8b 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -27,6 +27,8 @@
#include <guichan/widgets/container.hpp>
#include <guichan/widgets/tabbedarea.hpp>
+#include "gui/widgets/button.h"
+
#include <string>
class Tab;
@@ -107,11 +109,52 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener
void widgetResized(const gcn::Event &event);
+ void adjustTabPositions();
+
+ void action(const gcn::ActionEvent& actionEvent);
+
// Inherited from MouseListener
void mousePressed(gcn::MouseEvent &mouseEvent);
private:
typedef std::vector< std::pair<gcn::Tab*, gcn::Widget*> > TabContainer;
+
+ /** The tab arrows */
+ gcn::Button *mArrowButton[2];
+
+ /** Check whether the arrow should be clickable */
+ void updateArrowEnableState();
+
+ /**
+ * Update the overall width of all tab. Used to know whether the arrows
+ * have to be drawn or not.
+ */
+ void updateTabsWidth();
+
+ /**
+ * The overall width of all tab.
+ */
+ int mTabsWidth;
+
+ /**
+ * Update the overall width of visible tab. Used to know whether
+ * the arrows have to be enable or not.
+ */
+ void updateVisibleTabsWidth();
+
+ /**
+ * The overall width of visible tab.
+ */
+ int mVisibleTabsWidth;
+
+
+ /**
+ * The tab scroll index. When scrolling with the arrows, the tabs
+ * must be displayed according to the current index.
+ * So the first tab displayed may not be the first in the list.
+ * @note the index must start at 0.
+ */
+ unsigned mTabScrollIndex;
};
#endif