Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8618 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 20, 2006, 1:08:23 PM (18 years ago)
Author:
bensch
Message:

gui: no more segfaults

Location:
branches/gui/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/event/event_handler.cc

    r8490 r8618  
    355355  else
    356356  {
    357     SDL_WM_GrabInput(SDL_GRAB_ON);
     357    //SDL_WM_GrabInput(SDL_GRAB_ON);
    358358    SDL_ShowCursor(SDL_DISABLE);
    359359  }
  • branches/gui/src/lib/gui/gl/glgui_table.cc

    r8616 r8618  
    5858    this->_entries.resize(rowCount);
    5959    for (unsigned int i = currentRowCount; i < this->rowCount(); ++i)
     60    {
    6061      this->_entries[i].resize(columnCount(), LimitedWidthText("fonts/final_frontier.ttf", 20));
     62      for (unsigned int j = 0; j < columnCount(); ++j)
     63        this->applyTextSettings(i, j, &this->_entries[i][j]);
     64    }
    6165
    6266    assert(this->checkIntegrity());
     
    6973  void GLGuiTable::setColumnCount(unsigned int columnCount)
    7074  {
     75    unsigned int i;
     76    unsigned int currentColumnCount = this->columnCount();
     77
     78    // setup Headers.
    7179    this->_headers.resize(columnCount, LimitedWidthText("fonts/final_frontier.ttf", 20));
    72     for (unsigned int i = 0; i < rowCount(); i++)
     80    for (i = currentColumnCount; i < columnCount; ++i)
     81      this->applyTextSettings(0, i, &this->_headers[i]);
     82
     83    for (i = 0; i < rowCount(); i++)
     84    {
    7385      this->_entries[i].resize(columnCount, LimitedWidthText("fonts/final_frontier.ttf", 20));
    74 
     86      for (unsigned int j = currentColumnCount; j < columnCount; ++j)
     87        this->applyTextSettings(i, j, &this->_entries[i][j]);
     88
     89    }
    7590    assert(this->checkIntegrity());
    7691    this->debug();
     
    7994      this->hiding();
    8095  }
     96
     97
    8198
    8299
     
    199216  }
    200217
     218
     219  /**
     220   * @brief applies the GLGuiNotifiers Settings to a single Text of the GLGuiNotifier.
     221   * @param text the Text to apply the settings to.
     222   */
     223  void GLGuiTable::applyTextSettings(unsigned int row, unsigned int column, LimitedWidthText* text)
     224  {
     225    text->setSize(this->textSize());
     226    //text->setLineWidth(  );
     227    text->setFont("fonts/final_frontier.ttf", (int)this->textSize());
     228
     229    text->setColor(this->foregroundColor());
     230    if (text->getParent2D() != this)
     231      text->setParent2D(this);
     232  }
     233
     234
    201235  void GLGuiTable::debug() const
    202236  {
  • branches/gui/src/lib/gui/gl/glgui_table.h

    r8616 r8618  
    6464    void init();
    6565
     66    void applyTextSettings(unsigned int row, unsigned int column, LimitedWidthText* text);
    6667    bool checkIntegrity() const;
    6768
Note: See TracChangeset for help on using the changeset viewer.