Changeset 6177 for code/branches/presentation2/src/libraries/core/input
- Timestamp:
- Nov 29, 2009, 2:47:54 PM (15 years ago)
- 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 41 41 this->buffer_ = ""; 42 42 this->cursor_ = 0; 43 this->maxLength_ = 1024; 43 44 this->allowedChars_ = "abcdefghijklmnopqrstuvwxyz \ 44 45 ABCDEFGHIJKLMNOPQRSTUVWXYZ \ … … 59 60 RegisterRootObject(InputBuffer); 60 61 62 this->maxLength_ = 1024; 61 63 this->allowedChars_ = allowedChars; 62 64 this->buffer_ = ""; … … 93 95 } 94 96 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 95 104 void InputBuffer::set(const std::string& input, bool update) 96 105 { … … 117 126 if (this->charIsAllowed(input)) 118 127 { 128 if (this->buffer_.size() >= this->maxLength_) 129 return; 119 130 this->buffer_.insert(this->cursor_, 1, input); 120 131 ++this->cursor_; -
code/branches/presentation2/src/libraries/core/input/InputBuffer.h
r6105 r6177 82 82 83 83 void setConfigValues(); 84 85 unsigned int getMaxLength() const { return this->maxLength_; } 86 void setMaxLength(unsigned int length); 84 87 85 88 template <class T> … … 175 178 std::list<BaseInputBufferListenerTuple*> listeners_; 176 179 std::string allowedChars_; 180 unsigned int maxLength_; 177 181 unsigned int cursor_; 178 182
Note: See TracChangeset
for help on using the changeset viewer.