Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 16, 2006, 4:36:12 PM (19 years ago)
Author:
bensch
Message:

limited text-lenght

File:
1 copied

Legend:

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

    r8529 r8538  
    11/*!
    2  * @file multi_line_text.h
     2 * @file limited_width_text.h
    33 * @brief Definition of a text Class, that is able to render text.
    44 */
    55
    6 #ifndef _MULTI_LINE_TEXT_H
    7 #define _MULTI_LINE_TEXT_H
     6#ifndef _LIMITED_WIDTH_TEXT_H
     7#define _LIMITED_WIDTH_TEXT_H
    88
    99#include "text.h"
     
    1212
    1313//! Represents one textElement.
    14 class MultiLineText : public Text
     14class LimitedWidthText : public Text
    1515{
    1616  public:
    17     MultiLineText(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE, float lineWidth = 100.0);
     17    typedef enum {
     18      Begin,
     19      End,
     20    } DotsPosition;
     21
     22
     23  public:
     24    LimitedWidthText(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE, float lineWidth = 100.0, DotsPosition dotsPosition = Begin);
    1825
    1926    // Setup:
    2027    void setLineWidth(float lineWidth);
    21     void setLineSpacing(float lineSpacing);
     28    void setDotsPosition(DotsPosition dotsPosition);
    2229
    2330    // Retrieve:
    2431    /** @returns the LineWidth (maximum distance from the left to the right */
    25     inline float getLineWidth() const { return this->lineWidth; };
    26     /** @returns the LineSpacing */
    27     inline float getLineSpacing() const { return this->lineSpacing; };
    28     inline unsigned int getLineCount() const { return this->lineCount; };
    29 
     32    inline float lineWidth() const { return this->_lineWidth; };
     33    /** @returns the dots position. */
     34    inline float dotsPosition() const { return this->_dotsPosition; };
    3035    virtual void draw() const;
    3136
     
    3641
    3742  private:
    38     float                      lineWidth;
    39     float                      lineSpacing;
    40     std::vector<unsigned int>  lineEnds;
    41     unsigned int               lineCount;
     43    std::string                _dotedText;
     44
     45    DotsPosition               _dotsPosition;
     46    float                      _lineWidth;
     47    unsigned int               _lineEnds;
    4248};
    4349
    44 #endif /* _MULTI_LINE_TEXT_H */
     50#endif /* _LIMITED_WIDTH_TEXT_H */
Note: See TracChangeset for help on using the changeset viewer.