From 373f1aca8bb651332fec7031853d9a685ebc896e Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Wed, 4 Feb 2009 20:57:04 -0700 Subject: Added key and mouse events to the table class. Signed-off-by: Ira Rice --- src/gui/table.h | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src/gui/table.h') 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; -- cgit v1.2.3-70-g09d2