Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2009, 2:47:54 PM (15 years ago)
Author:
rgrieder
Message:

Performance and robustness improvements for the IOConsole under Windows.
There should only be one way to screw the console now: Change the console properties manually at runtime (right click on the taskbar icon), esp. screen buffer size.
If you can find another bug, please let me know.

Location:
code/branches/presentation2/src/libraries/core/input
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/input/InputBuffer.cc

    r6105 r6177  
    4141        this->buffer_ = "";
    4242        this->cursor_ = 0;
     43        this->maxLength_ = 1024;
    4344        this->allowedChars_ = "abcdefghijklmnopqrstuvwxyz \
    4445                               ABCDEFGHIJKLMNOPQRSTUVWXYZ \
     
    5960        RegisterRootObject(InputBuffer);
    6061
     62        this->maxLength_ = 1024;
    6163        this->allowedChars_ = allowedChars;
    6264        this->buffer_ = "";
     
    9395    }
    9496
     97    void InputBuffer::setMaxLength(unsigned int length)
     98    {
     99        this->maxLength_ = length;
     100        if (this->buffer_.size() > length)
     101            this->buffer_.resize(length);
     102    }
     103
    95104    void InputBuffer::set(const std::string& input, bool update)
    96105    {
     
    117126        if (this->charIsAllowed(input))
    118127        {
     128            if (this->buffer_.size() >= this->maxLength_)
     129                return;
    119130            this->buffer_.insert(this->cursor_, 1, input);
    120131            ++this->cursor_;
  • code/branches/presentation2/src/libraries/core/input/InputBuffer.h

    r6105 r6177  
    8282
    8383            void setConfigValues();
     84
     85            unsigned int getMaxLength() const { return this->maxLength_; }
     86            void setMaxLength(unsigned int length);
    8487
    8588            template <class T>
     
    175178            std::list<BaseInputBufferListenerTuple*> listeners_;
    176179            std::string allowedChars_;
     180            unsigned int maxLength_;
    177181            unsigned int cursor_;
    178182
Note: See TracChangeset for help on using the changeset viewer.