- Timestamp:
- Jun 20, 2006, 1:57:33 PM (18 years ago)
- Location:
- branches/gui/src/lib/gui/gl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl/glgui_table.cc
r8619 r8626 65 65 66 66 assert(this->checkIntegrity()); 67 this-> debug();67 this->repositionText(currentRowCount, 0); 68 68 69 69 if (!this->isVisible()) … … 75 75 unsigned int i; 76 76 unsigned int currentColumnCount = this->columnCount(); 77 78 this->_columnWidths.resize(columnCount, 100); 77 79 78 80 // setup Headers. … … 89 91 } 90 92 assert(this->checkIntegrity()); 91 this->debug(); 93 94 this->repositionText(0, currentColumnCount); 92 95 93 96 if (!this->isVisible()) … … 111 114 } 112 115 113 void GLGuiTable::setEntry(unsigned int column, unsigned int row, const std::string& name)116 void GLGuiTable::setEntry(unsigned int row, unsigned int column, const std::string& name) 114 117 { 115 118 if (column >= this->columnCount() ) … … 125 128 for (unsigned int i = 0; i < this->rowCount(); ++i) 126 129 this->_entries[i][column].setLineWidth(size); 127 128 } 130 } 131 132 129 133 130 134 /// TODO. 131 135 void GLGuiTable::setRowHeight(unsigned int row, unsigned int size) 132 {}136 {} 133 137 134 138 … … 217 221 218 222 223 void GLGuiTable::repositionText(unsigned int fromLeft, unsigned int fromTop) 224 { 225 float columnPos = 0.0f; 226 unsigned int i, j; 227 for (i = 0; i< fromLeft; ++i) 228 { 229 columnPos+=this->_columnWidths[i]; 230 } 231 232 for (i = fromLeft; i < this->columnCount(); ++i) 233 { 234 this->_headers[i].setRelCoor2D(columnPos, 0); 235 236 for (j = fromTop; j < this->rowCount(); ++j) 237 { 238 239 } 240 columnPos+=this->_columnWidths[i]; 241 } 242 } 243 219 244 /** 220 245 * @brief applies the GLGuiNotifiers Settings to a single Text of the GLGuiNotifier. … … 224 249 { 225 250 text->setSize(this->textSize()); 226 //text->setLineWidth();251 text->setLineWidth( this->_columnWidths[column] ); 227 252 text->setFont("fonts/final_frontier.ttf", (int)this->textSize()); 228 253 … … 257 282 for (unsigned int i = 0; i < this->rowCount(); ++i) 258 283 if (this->_entries[i].size() != this->columnCount()) 259 {260 PRINTF(1)("COLUMN-COUNT OF ROW %d WRONG (is %d should be %d)\n", i, this->_entries[i].size(), this->columnCount());261 retVal = false;262 }284 { 285 PRINTF(1)("COLUMN-COUNT OF ROW %d WRONG (is %d should be %d)\n", i, this->_entries[i].size(), this->columnCount()); 286 retVal = false; 287 } 263 288 return retVal; 264 289 } -
branches/gui/src/lib/gui/gl/glgui_table.h
r8619 r8626 39 39 void setHeader(const std::vector<std::string>& headerNames); 40 40 41 void setEntry(unsigned int column, unsigned int row, const std::string& name);41 void setEntry(unsigned int row, unsigned int column, const std::string& name); 42 42 43 43 void setColumnWidth(unsigned int column, float size); … … 64 64 void init(); 65 65 66 void repositionText(unsigned int fromLeft, unsigned int fromTop); 66 67 void applyTextSettings(unsigned int row, unsigned int column, LimitedWidthText* text); 67 68 bool checkIntegrity() const; … … 70 71 typedef std::vector<LimitedWidthText> TableTextList; 71 72 TableTextList _headers; 73 std::vector<float> _columnWidths; 74 72 75 std::vector<TableTextList> _entries; //!< inner is by column, outer is by row. 73 76
Note: See TracChangeset
for help on using the changeset viewer.