aboutsummaryrefslogtreecommitdiff
path: root/src/Container.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/Container.hh')
-rw-r--r--src/Container.hh11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Container.hh b/src/Container.hh
index b4226a3..4014131 100644
--- a/src/Container.hh
+++ b/src/Container.hh
@@ -25,15 +25,21 @@
25#ifndef CONTAINER_HH 25#ifndef CONTAINER_HH
26#define CONTAINER_HH 26#define CONTAINER_HH
27 27
28#include "FbTk/Button.hh" 28#include "FbTk/FbWindow.hh"
29#include "FbTk/EventHandler.hh" 29#include "FbTk/EventHandler.hh"
30#include "FbTk/NotCopyable.hh" 30#include "FbTk/NotCopyable.hh"
31 31
32namespace FbTk {
33 class Button;
34}
35
32#include <list> 36#include <list>
33#include <functional> 37#include <functional>
34 38
35class Container:public FbTk::FbWindow, public FbTk::EventHandler, private FbTk::NotCopyable { 39class Container:public FbTk::FbWindow, public FbTk::EventHandler, private FbTk::NotCopyable {
36public: 40public:
41 // LEFT, RIGHT => fixed total width, fixed icon size
42 // RELATIVE => fixed total width, relative/variable icon size
37 enum Alignment { LEFT, RELATIVE, RIGHT }; 43 enum Alignment { LEFT, RELATIVE, RIGHT };
38 typedef FbTk::Button * Item; 44 typedef FbTk::Button * Item;
39 typedef const FbTk::Button * ConstItem; 45 typedef const FbTk::Button * ConstItem;
@@ -58,6 +64,7 @@ public:
58 int find(ConstItem item); 64 int find(ConstItem item);
59 void setSelected(int index); 65 void setSelected(int index);
60 void setMaxSizePerClient(unsigned int size); 66 void setMaxSizePerClient(unsigned int size);
67 void setMaxTotalSize(unsigned int size);
61 void setAlignment(Alignment a); 68 void setAlignment(Alignment a);
62 69
63 Item back() { return m_item_list.back(); } 70 Item back() { return m_item_list.back(); }
@@ -81,6 +88,7 @@ public:
81 inline const Item& selected() const { return m_selected; } 88 inline const Item& selected() const { return m_selected; }
82 inline Item selected() { return m_selected; } 89 inline Item selected() { return m_selected; }
83 unsigned int maxWidthPerClient() const; 90 unsigned int maxWidthPerClient() const;
91 unsigned int maxTotalSize() const { return m_max_total_size; }
84 inline unsigned int maxHeightPerClient() const { return (empty() ? height() : height()/size()); } 92 inline unsigned int maxHeightPerClient() const { return (empty() ? height() : height()/size()); }
85 inline bool updateLock() const { return m_update_lock; } 93 inline bool updateLock() const { return m_update_lock; }
86 94
@@ -97,6 +105,7 @@ private:
97 105
98 Alignment m_align; 106 Alignment m_align;
99 unsigned int m_max_size_per_client; 107 unsigned int m_max_size_per_client;
108 unsigned int m_max_total_size;
100 ItemList m_item_list; 109 ItemList m_item_list;
101 Item m_selected; 110 Item m_selected;
102 bool m_update_lock; 111 bool m_update_lock;