Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8542 in orxonox.OLD for branches/gui/src


Ignore:
Timestamp:
Jun 16, 2006, 5:22:18 PM (18 years ago)
Author:
bensch
Message:

text with dots at the end

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

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/graphics/text_engine/limited_width_text.cc

    r8539 r8542  
    4040{
    4141  this->_lineWidth = lineWidth;
    42   this->setSizeX2D(lineWidth);
     42  this->setupTextWidth();
     43}
     44
     45/**
     46 * @brief sets the Dots Position
     47 * @param dotsPosition the Position of the Dots
     48 */
     49void LimitedWidthText::setDotsPosition(DotsPosition dotsPosition)
     50{
     51  this->_dotsPosition = dotsPosition;
    4352  this->setupTextWidth();
    4453}
     
    114123  float maxWidth = this->_lineWidth / this->size();
    115124
     125  this->_dotedText = this->text();
     126
    116127  switch (this->_dotsPosition)
    117128  {
     
    129140          width += this->font()->getGlyphArray()[this->text()[i]]->advance;
    130141      }
    131       this->setSizeX2D(width);
    132142      break;
    133143    case Begin:
     
    144154          width += this->font()->getGlyphArray()[this->text()[i]]->advance;
    145155      }
    146       this->setSizeX2D(width);
    147156      break;
    148157  }
     158
     159  this->setSizeX2D(width * this->size());
    149160}
    150161
  • branches/gui/src/lib/graphics/text_engine/limited_width_text.h

    r8538 r8542  
    3333    /** @returns the dots position. */
    3434    inline float dotsPosition() const { return this->_dotsPosition; };
     35
    3536    virtual void draw() const;
    3637
  • branches/gui/src/lib/gui/gl/glgui_inputline.cc

    r8539 r8542  
    5252    this->_text.setRelCoor2D(4,4);
    5353    this->_text.setFont("fonts/final_frontier.ttf", 20);
     54    this->_text.setLineWidth(400);
     55    this->_text.setDotsPosition(LimitedWidthText::End);
    5456    this->_text.setColor(this->frontColor());
    5557    this->_text.setVisibility(false);
  • branches/gui/src/lib/gui/gl/glgui_inputline.h

    r8539 r8542  
    99
    1010#include "glgui_widget.h"
    11 #include "text.h"
     11#include "limited_width_text.h"
    1212#include "event.h"
    1313
     
    6666
    6767  private:
    68     Text                    _text;            //!< The Text to display inside of the InputLine.
     68    LimitedWidthText        _text;            //!< The Text to display inside of the InputLine.
    6969    bool                    _clearOnEnter;    //!< Clear on Enter
    7070
Note: See TracChangeset for help on using the changeset viewer.