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
committerAndrei Karas <akaras@inbox.ru>2011-03-09 01:16:00 +0200
commita4190c35493a50641014af1b2ec2c13638e49f41 (patch)
tree1d5945aa6674a77752f894120ec5a2ef9bd08e03 /src/gui/widgets/tabbedarea.h
parent958b06cd741311d42c03c6b91c64ea01c713f516 (diff)
downloadplus-a4190c35493a50641014af1b2ec2c13638e49f41.tar.gz
plus-a4190c35493a50641014af1b2ec2c13638e49f41.tar.bz2
plus-a4190c35493a50641014af1b2ec2c13638e49f41.tar.xz
plus-a4190c35493a50641014af1b2ec2c13638e49f41.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 aff47929d..e5a00e277 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -28,6 +28,8 @@
#include <guichan/widgets/container.hpp>
#include <guichan/widgets/tabbedarea.hpp>
+#include "gui/widgets/button.h"
+
#include <string>
#ifdef __GNUC__
@@ -119,12 +121,53 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener
void moveRight(gcn::Tab *tab);
*/
+ 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