diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-20 16:46:17 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-20 16:46:17 -0700 |
commit | 1b3ac1ad7a745ed7b7aac1f1dd7514616db8a998 (patch) | |
tree | d04d002a96fb2febbfd8a42b66aab38f04ee6b16 /src/gui/table_model.h | |
parent | c75f6978e780a4cbe7e4103b7a3187c2ddf75c33 (diff) | |
download | mana-1b3ac1ad7a745ed7b7aac1f1dd7514616db8a998.tar.gz mana-1b3ac1ad7a745ed7b7aac1f1dd7514616db8a998.tar.bz2 mana-1b3ac1ad7a745ed7b7aac1f1dd7514616db8a998.tar.xz mana-1b3ac1ad7a745ed7b7aac1f1dd7514616db8a998.zip |
Reflowed skill dialog, as well as started to work on revising the table
model (none of the changes yet make visible improvements yet,
unfortunately).
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/table_model.h')
-rw-r--r-- | src/gui/table_model.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/gui/table_model.h b/src/gui/table_model.h index a52a7561..304500bb 100644 --- a/src/gui/table_model.h +++ b/src/gui/table_model.h @@ -25,6 +25,7 @@ #include <set> #include <vector> +#include <guichan/color.hpp> #include <guichan/gui.hpp> #include "../guichanfwd.h" @@ -99,12 +100,14 @@ 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(void); /** * Inserts a widget into the table model. - * The model is resized to accomodate the widget's width and height, unless column width / row height have been fixed. + * The model is resized to accomodate the widget's width and height, + * unless column width / row height have been fixed. */ virtual void set(int row, int column, gcn::Widget *widget); @@ -127,9 +130,27 @@ public: */ virtual void resize(void); + /** + * 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(void); virtual int getColumns(void); virtual int getRowHeight(void); + virtual int getWidth(void); + virtual int getHeight(void); virtual int getColumnWidth(int index); virtual gcn::Widget *getElementAt(int row, int column); @@ -137,8 +158,22 @@ public: 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(TMW_TABLE_MODEL_H_) */ |