Changeset 9676 for code/trunk/src/libraries
- Timestamp:
- Sep 29, 2013, 4:27:05 PM (11 years ago)
- Location:
- code/trunk/src/libraries/core/command
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/command/IOConsoleWindows.cc
r9667 r9676 102 102 103 103 // Erase input and status lines 104 COORD pos = {0, this->inputLineRow_};104 COORD pos = makeCOORD(0, this->inputLineRow_); 105 105 this->writeText(std::string((this->inputLineHeight_ + this->statusLines_) * this->terminalWidth_, ' '), pos); 106 106 // Move cursor to the beginning of the line … … 297 297 { 298 298 // Scroll input and status lines down 299 SMALL_RECT oldRect = {0, this->inputLineRow_,300 this->terminalWidth_ - 1, this->inputLineRow_ + this->inputLineHeight_ + this->statusLines_ - 1 };299 SMALL_RECT oldRect = makeSMALL_RECT(0, this->inputLineRow_, 300 this->terminalWidth_ - 1, this->inputLineRow_ + this->inputLineHeight_ + this->statusLines_ - 1); 301 301 this->inputLineRow_ += linesDown; 302 302 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, this->inputLineRow_), &fillChar); 303 303 // Move cursor down to the new bottom so the user can see the status lines 304 COORD pos = {0, this->inputLineRow_ + this->inputLineHeight_ - 1 + this->statusLines_};304 COORD pos = makeCOORD(0, this->inputLineRow_ + this->inputLineHeight_ - 1 + this->statusLines_); 305 305 SetConsoleCursorPosition(stdOutHandle_, pos); 306 306 // Get cursor back to the right position … … 311 311 { 312 312 // Scroll output up 313 SMALL_RECT oldRect = {0, lines - linesDown, this->terminalWidth_ - 1, this->inputLineRow_ - 1};313 SMALL_RECT oldRect = makeSMALL_RECT(0, lines - linesDown, this->terminalWidth_ - 1, this->inputLineRow_ - 1); 314 314 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, 0), &fillChar); 315 315 } … … 358 358 // Scroll status lines up 359 359 int statusLineRow = this->inputLineRow_ + this->inputLineHeight_; 360 SMALL_RECT oldRect = {0, statusLineRow, this->terminalWidth_ - 1, statusLineRow + this->statusLines_};360 SMALL_RECT oldRect = makeSMALL_RECT(0, statusLineRow, this->terminalWidth_ - 1, statusLineRow + this->statusLines_); 361 361 CHAR_INFO fillChar = {{' '}, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED}; 362 362 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, statusLineRow + newLines), &fillChar); … … 364 364 if (-newLines - this->statusLines_ > 0) 365 365 { 366 COORD pos = {0, this->inputLineRow_ + newInputLineHeight + this->statusLines_};366 COORD pos = makeCOORD(0, this->inputLineRow_ + newInputLineHeight + this->statusLines_); 367 367 this->writeText(std::string((-newLines - this->statusLines_) * this->terminalWidth_, ' '), pos); 368 368 } … … 398 398 this->createNewOutputLines(this->lastOutputLineHeight_); 399 399 // Write the text 400 COORD pos = {0, this->inputLineRow_ - this->lastOutputLineHeight_};400 COORD pos = makeCOORD(0, this->inputLineRow_ - this->lastOutputLineHeight_); 401 401 this->printOutputLine(it->first, it->second, pos); 402 402 } -
code/trunk/src/libraries/core/command/IOConsoleWindows.h
r8858 r9676 80 80 void printOutputLine(const std::string& line, Shell::LineType type, const COORD& pos); 81 81 82 static inline COORD makeCOORD( int x, inty)82 static inline COORD makeCOORD(SHORT x, SHORT y) 83 83 { 84 84 COORD val = {x, y}; 85 return val; 86 } 87 88 static inline SMALL_RECT makeSMALL_RECT(SHORT left, SHORT top, SHORT right, SHORT bottom) 89 { 90 SMALL_RECT val = {left, top, right, bottom}; 85 91 return val; 86 92 }
Note: See TracChangeset
for help on using the changeset viewer.