diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-30 01:34:16 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 20:00:07 +0100 |
commit | 1b1050da1c7b84cc72b7efbb2229294975be9e10 (patch) | |
tree | 68d15ccb015d58aeb5797ffd06efca3e55997c24 /src/gui/table_model.h | |
parent | 0d4142a891cd228da24ee3aa3bbd7dc622da5b75 (diff) | |
parent | 955a7613d1fe116fe5e1da07a222b6849b3c885c (diff) | |
download | mana-client-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.gz mana-client-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.bz2 mana-client-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.xz mana-client-1b1050da1c7b84cc72b7efbb2229294975be9e10.zip |
Merged with Aethyra master as of 2009-01-27
Conflicts:
Almost everywhere.
Diffstat (limited to 'src/gui/table_model.h')
-rw-r--r-- | src/gui/table_model.h | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/gui/table_model.h b/src/gui/table_model.h index d245d7bd..03b69dba 100644 --- a/src/gui/table_model.h +++ b/src/gui/table_model.h @@ -22,12 +22,13 @@ #ifndef TABLE_MODEL_H #define TABLE_MODEL_H -#include "../guichanfwd.h" +#include <set> +#include <vector> +#include <guichan/color.hpp> #include <guichan/gui.hpp> -#include <set> -#include <vector> +#include "../guichanfwd.h" class TableModelListener { @@ -100,7 +101,8 @@ private: class StaticTableModel : public TableModel { public: - StaticTableModel(int width, int height); + StaticTableModel(int width, int height, gcn::Color background = 0xffffff, + bool opacity = true); virtual ~StaticTableModel(); /** @@ -130,17 +132,49 @@ public: */ virtual void resize(); + /** + * 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); + + /** + * Checks if the scroll area is opaque, that is if the scroll area + * displays its background. + * + * @return True if the scroll area is opaque, false otherwise. + */ + virtual bool isOpaque() const; + virtual int getRows(); virtual int getColumns(); virtual int getRowHeight(); + virtual int getWidth(); + virtual int getHeight(); virtual int getColumnWidth(int index); virtual gcn::Widget *getElementAt(int row, int column); protected: int mRows, mColumns; int mHeight; + bool mOpaque; std::vector<gcn::Widget *> mTableModel; std::vector<int> mWidths; + + /** + * Holds the background color of the table. + */ + gcn::Color mBackgroundColor; + + /** + * Draws the background of the table, that is + * the area behind the content. + * + * @param graphics a Graphics object to draw with. + */ + virtual void drawBackground(gcn::Graphics *graphics); }; #endif /* !defined(TABLE_MODEL_H) */ |