Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2009, 2:47:54 PM (14 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.

File:
1 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_;
Note: See TracChangeset for help on using the changeset viewer.