diff options
Diffstat (limited to 'src/gui/table.h')
-rw-r--r-- | src/gui/table.h | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/gui/table.h b/src/gui/table.h index a508d0e4..d73cf340 100644 --- a/src/gui/table.h +++ b/src/gui/table.h @@ -1,9 +1,8 @@ /* - * Aethyra + * The Mana World * Copyright (C) 2008 The Mana World Development Team * - * This file is part of Aethyra derived from original code - * from Guichan. + * This file is part of The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,17 +46,19 @@ class GuiTable : public gcn::Widget, public gcn::KeyListener, public TableModelListener { - friend class GuiTableActionListener; // so that the action listener can call distributeActionEvent + // so that the action listener can call distributeActionEvent + friend class GuiTableActionListener; + public: GuiTable(TableModel * initial_model = NULL, gcn::Color background = 0xffffff, bool opacity = true); - virtual ~GuiTable(void); + virtual ~GuiTable(); /** * Retrieves the active table model */ - TableModel *getModel(void) const; + TableModel *getModel() const; /** * Sets the table model @@ -73,9 +74,9 @@ public: void setSelected(int row, int column); - int getSelectedRow(void); + int getSelectedRow(); - int getSelectedColumn(void); + int getSelectedColumn(); void setSelectedRow(int selected); @@ -137,25 +138,25 @@ public: virtual void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); virtual void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); - + virtual void mouseDragged(gcn::MouseEvent& mouseEvent); // Constraints inherited from TableModelListener virtual void modelUpdated(bool); protected: + /** Frees all action listeners on inner widgets. */ + virtual void uninstallActionListeners(); + /** Installs all action listeners on inner widgets. */ + virtual void installActionListeners(); - virtual void uninstallActionListeners(void); // frees all action listeners on inner widgets - virtual void installActionListeners(void); // installs all action listeners on inner widgets - - virtual int getRowHeight(void); + virtual int getRowHeight(); virtual int getColumnWidth(int i); - -private: +private: int getRowForY(int y); // -1 on error int getColumnForX(int x); // -1 on error - void recomputeDimensions(void); + void recomputeDimensions(); bool mLinewiseMode; bool mWrappingEnabled; bool mOpaque; @@ -172,11 +173,14 @@ private: int mSelectedRow; int mSelectedColumn; - int mPopFramesNr; // Number of frames to skip upwards when drawing the selected widget + /** Number of frames to skip upwards when drawing the selected widget. */ + int mPopFramesNr; - gcn::Widget *mTopWidget; // If someone moves a fresh widget to the top, we must display it + /** If someone moves a fresh widget to the top, we must display it. */ + gcn::Widget *mTopWidget; - std::vector<GuiTableActionListener *> action_listeners; // Vector for compactness; used as a list in practice. + /** Vector for compactness; used as a list in practice. */ + std::vector<GuiTableActionListener *> mActionListeners; }; |