diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-04 20:57:04 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-04 20:57:04 -0700 |
commit | 373f1aca8bb651332fec7031853d9a685ebc896e (patch) | |
tree | 249b164fd69776dccb98c78040c082aae07480e2 /src/gui/table.h | |
parent | 9f0d62aa2fbc0ec822526b129070615696ac6881 (diff) | |
download | Mana-373f1aca8bb651332fec7031853d9a685ebc896e.tar.gz Mana-373f1aca8bb651332fec7031853d9a685ebc896e.tar.bz2 Mana-373f1aca8bb651332fec7031853d9a685ebc896e.tar.xz Mana-373f1aca8bb651332fec7031853d9a685ebc896e.zip |
Added key and mouse events to the table class.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/table.h')
-rw-r--r-- | src/gui/table.h | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/gui/table.h b/src/gui/table.h index d63b1fb9..912eb284 100644 --- a/src/gui/table.h +++ b/src/gui/table.h @@ -33,8 +33,9 @@ class GuiTableActionListener; /** - * A table, with rows and columns made out of sub-widgets. Largely inspired by (and can be thought of as a generalisation of) - * the guichan listbox implementation. + * A table, with rows and columns made out of sub-widgets. Largely inspired by + * (and can be thought of as a generalisation of) the guichan listbox + * implementation. * * Normally you want this within a ScrollArea. * @@ -60,27 +61,38 @@ public: /** * Sets the table model * - * Note that actions issued by widgets returned from the model will update the table - * selection, but only AFTER any event handlers installed within the widget have been - *triggered. To be notified after such an update, add an action listener to the table - * instead. + * Note that actions issued by widgets returned from the model will update + * the table selection, but only AFTER any event handlers installed within + * the widget have been triggered. To be notified after such an update, add + * an action listener to the table instead. */ void setModel(TableModel *m); + const TableModel* getModel() {return mModel;} + void setSelected(int row, int column); int getSelectedRow(void); int getSelectedColumn(void); + void setSelectedRow(int selected); + + void setSelectedColumn(int selected); + + bool isWrappingEnabled() const {return mWrappingEnabled;} + + void setWrappingEnabled(bool wrappingEnabled) + {mWrappingEnabled = wrappingEnabled;} + gcn::Rectangle getChildrenArea(void); /** - * Toggle whether to use linewise selection mode, in which the table selects an entire - * line at a time, rather than a single cell. + * Toggle whether to use linewise selection mode, in which the table selects + * an entire line at a time, rather than a single cell. * - * Note that column information is tracked even in linewise selection mode; this mode - * therefore only affects visualisation. + * Note that column information is tracked even in linewise selection mode; + * this mode therefore only affects visualisation. * * Disabled by default. * @@ -144,6 +156,7 @@ private: int getColumnForX(int x); // -1 on error void recomputeDimensions(void); bool mLinewiseMode; + bool mWrappingEnabled; bool mOpaque; static float mAlpha; |