summaryrefslogtreecommitdiff
path: root/src/gui/table.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-03 14:38:40 -0700
committerIra Rice <irarice@gmail.com>2009-02-03 14:38:40 -0700
commit8857a59c3818c1ce6eeb6c054cb5543bfc35c087 (patch)
tree792fca4acae0c9372cf145a4f0b4cb995b1c3c78 /src/gui/table.h
parent6c5d9cd16b750ae9404407171a5641b5e0ee78b5 (diff)
downloadmana-8857a59c3818c1ce6eeb6c054cb5543bfc35c087.tar.gz
mana-8857a59c3818c1ce6eeb6c054cb5543bfc35c087.tar.bz2
mana-8857a59c3818c1ce6eeb6c054cb5543bfc35c087.tar.xz
mana-8857a59c3818c1ce6eeb6c054cb5543bfc35c087.zip
Fixed up table class to allow for different background colors, as well
as defining whether the given table is opaque or not. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/table.h')
-rw-r--r--src/gui/table.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/gui/table.h b/src/gui/table.h
index e3fd8cf6..bdb41e90 100644
--- a/src/gui/table.h
+++ b/src/gui/table.h
@@ -51,7 +51,8 @@ class GuiTable : public gcn::Widget,
{
friend class GuiTableActionListener; // so that the action listener can call distributeActionEvent
public:
- GuiTable(TableModel * initial_model = NULL);
+ GuiTable(TableModel * initial_model = NULL, gcn::Color background = 0xffffff,
+ bool opacity = true);
virtual ~GuiTable(void);
@@ -94,8 +95,6 @@ public:
// Inherited from Widget
virtual void draw(gcn::Graphics* graphics);
- virtual void logic(void);
-
virtual gcn::Widget *getWidgetAt(int x, int y);
virtual void moveToTop(gcn::Widget *child);
@@ -107,6 +106,21 @@ public:
// Inherited from KeyListener
virtual void keyPressed(gcn::KeyEvent& keyEvent);
+ /**
+ * Sets the table to be opaque, that is sets the table
+ * to display its background.
+ *
+ * @param opaque True if the table should be opaque, false otherwise.
+ */
+ virtual void setOpaque(bool opaque) {mOpaque = opaque;}
+
+ /**
+ * Checks if the table is opaque, that is if the table area displays its
+ * background.
+ *
+ * @return True if the table is opaque, false otherwise.
+ */
+ virtual bool isOpaque() const {return mOpaque;}
// Inherited from MouseListener
virtual void mousePressed(gcn::MouseEvent& mouseEvent);
@@ -134,6 +148,14 @@ private:
int getColumnForX(int x); // -1 on error
void recomputeDimensions(void);
bool mLinewiseMode;
+ bool mOpaque;
+
+ static float mAlpha;
+
+ /**
+ * Holds the background color of the table.
+ */
+ gcn::Color mBackgroundColor;
TableModel *mModel;