- Timestamp:
- Sep 24, 2005, 10:30:08 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell.cc
r5247 r5248 69 69 this->bufferDisplaySize = 10; 70 70 this->bufferOffset = 0; 71 this->bufferIterator = ShellBuffer::getInstance()->getBuffer()->getIterator(); 71 72 72 73 // INPUT LINE … … 86 87 delete this->bufferText[i]; 87 88 delete[] this->bufferText; 89 delete this->bufferIterator; 88 90 89 91 // delete the inputLine … … 136 138 } 137 139 delete bufferIT; 140 141 this->bufferOffset = 0; 138 142 } 139 143 … … 246 250 * moves the Display buffer (up or down) 247 251 * @param lineCount the count by which to shift the InputBuffer. 252 * 253 * @todo 248 254 */ 249 255 void Shell::moveDisplayBuffer(int lineCount) 250 256 { 251 252 257 if (!this->bufferIterator->compareListPointer(ShellBuffer::getInstance()->getBuffer())) 258 { 259 delete this->bufferIterator; 260 this->bufferIterator = ShellBuffer::getInstance()->getBuffer()->getIterator(); 261 } 262 263 if (this->bufferOffset == 0) 264 { 265 this->bufferIterator->lastElement(); 266 // for (unsigned int i = 0; i < this->bufferDisplaySize; i++) 267 // this->bufferIterator->prevStep(); 268 } 269 270 // boundraries 271 if (this->bufferOffset + lineCount > (int)ShellBuffer::getInstance()->getBuffer()->getSize()) 272 lineCount = (int)ShellBuffer::getInstance()->getBuffer()->getSize()- this->bufferOffset; 273 else if (this->bufferOffset + lineCount < 0) 274 lineCount = -bufferOffset; 275 this->bufferOffset += lineCount; 276 277 // moving the iterator to the right position 278 int move = 0; 279 while (move != lineCount) 280 { 281 if (move < lineCount) 282 { 283 ++move; 284 this->bufferIterator->prevStep(); 285 } 286 else 287 { 288 --move; 289 this->bufferIterator->nextStep(); 290 } 291 } 292 // redisplay the buffers 293 tIterator<char> it = *this->bufferIterator; 294 for (unsigned int i = 0; i < this->bufferDisplaySize; i++) 295 { 296 this->bufferText[i]->setText(it.getCurrent(), false); 297 it.prevStep(); 298 } 253 299 } 254 300 … … 279 325 else if (event.type == SDLK_PAGEUP) 280 326 { 281 327 this->moveDisplayBuffer(+this->bufferDisplaySize-1); 282 328 } 283 329 else if (event.type == SDLK_PAGEDOWN) 284 330 { 285 331 this->moveDisplayBuffer(-this->bufferDisplaySize+1); 286 332 } 287 333 } -
trunk/src/lib/shell/shell.h
r5247 r5248 4 4 * 5 5 * @todo Buffer Display in different Colors for different debug mode. 6 * @todo move up and down in Buffer7 6 */ 8 7 -
trunk/src/lib/shell/shell_input.cc
r5245 r5248 285 285 { 286 286 PRINT(0)("Help for the most important Shell-commands\n"); 287 PRINT(0)("F1 - HELP; F2 - DEBUG; `- open/close shell\n");287 PRINT(0)("F1 - HELP; F2 - DEBUG; '`' - open/close shell\n"); 288 288 PRINT(0)("input order:\n"); 289 289 PRINT(0)("ClassName [objectName] function [parameter1, [parameter2 ...]] or\n"); … … 328 328 this->help(); 329 329 else if (event.type == SDLK_F2) 330 this->debug();330 ;//this->debug(); 331 331 else if (event.type == SDLK_UP) 332 332 this->historyMoveUp(); -
trunk/src/lib/util/list.h
r5247 r5248 348 348 T* seekElement(const T* element); 349 349 T* iteratorElement(const tIterator<T>* iterator); 350 bool compareListPointer(const tList<T>* list); 350 351 351 352 /** another way to iterate through the list … … 520 521 } 521 522 523 template<class T> 524 bool tIterator<T>::compareListPointer(const tList<T>* list) 525 { 526 return (this->list == list)?true:false; 527 } 528 529 522 530 /** 523 531 * use it to move through the list without interfering with the iteration … … 538 546 } 539 547 540 541 548 /** 542 549 * use it to move backwards through the list without interfering with the itereation
Note: See TracChangeset
for help on using the changeset viewer.