src/Menu/CCTable.h

Go to the documentation of this file.
00001 /* Crown and Cutlass
00002  * Gui, table header.
00003  */
00004 
00005 #if !defined( _CCTABLE_H_ )
00006 #define _CCTABLE_H_
00007 
00008 #include <guichan.hpp>
00009 #include <string>
00010 #include <vector>
00011 #include "SDL.h"
00012 
00013 using namespace gcn;
00014 
00015 class CCTable :
00016     public gcn::Container
00017 {
00018   public:
00019     CCTable();
00020     CCTable(int columns, int rows);
00021     ~CCTable();
00022 
00023     void draw(Graphics* graphics);
00024 
00025     int getNumColumns();
00026     int getNumRows();
00027 
00028     /* While resizing the Table is theoretically
00029      * possible, it is beyond the scope of this
00030      * class and so is not implemented.
00031      *
00032      * void resizeTable(int columns, int rows);
00033      */
00034 
00035     void resizeColumn(int columnNum, int size);
00036     void resizeRow(int rowNum, int size);
00037 
00038     int getColumnSize(int columnNum);
00039     int getColumnPosition(int columnNum);
00040     int getRowSize(int rowNum);
00041     int getRowPosition(int rowNum);
00042 
00043     //virtual void add(Widget* widget);
00044     void add(int columnNum, int rowNum, Widget* widget);
00045 
00046     Widget* getWidget(int columnNum, int rowNum);
00047 
00048     void setColumnBuffer(int size);
00049     void setRowBuffer(int size);
00050 
00051   private:
00052     std::vector<int> columnSize;
00053     std::vector<int> rowSize;
00054 
00055     std::vector<gcn::Widget*> cellMatrix;
00056 
00057     void resetTable();
00058     void resize();
00059 
00060     int numRows;
00061     int numColumns;
00062 
00063     int rowBuffer;
00064     int columnBuffer;
00065 
00066     bool recheckTable;
00067 };
00068 
00069 #endif

Generated on Mon Jan 8 22:34:12 2007 for CrownandCutlass by  doxygen 1.4.7