Changeset 5994 for code/branches/console/src/libraries/core/IOConsole.cc
- Timestamp:
- Oct 27, 2009, 2:47:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/libraries/core/IOConsole.cc
r5986 r5994 62 62 this->originalTerminalSettings_ = new termios; 63 63 this->setTerminalMode(); 64 64 this->shell_.registerListener(this); 65 65 } 66 66 … … 234 234 } 235 235 236 #elif defined(ORXONOX_PLATFORM_WINDOWS) 237 238 IOConsole::IOConsole() 239 : shell_(Shell::getInstance()) 240 , buffer_(Shell::getInstance().getInputBuffer()) 241 { 242 this->setTerminalMode(); 243 } 244 245 IOConsole::~IOConsole() 246 { 247 } 248 249 void IOConsole::setTerminalMode() 250 { 251 } 252 253 void IOConsole::resetTerminalMode() 254 { 255 } 256 257 void IOConsole::update(const Clock& time) 258 { 259 } 260 261 void IOConsole::print(const std::string& text) 262 { 263 } 264 265 void IOConsole::printInputLine() 266 { 267 } 268 236 269 #endif /* ORXONOX_PLATFORM_UNIX */ 237 270 … … 256 289 void IOConsole::onlyLastLineChanged() 257 290 { 258 259 260 261 262 263 264 265 291 // Save cursor position and move it the beginning of the second to last line 292 std::cout << "\033[s\033[1F"; 293 // Erase the second to last line 294 std::cout << "\033[K"; 295 this->print(*(this->shell_.getNewestLineIterator())); 296 // Restore cursor 297 std::cout << "\033[u"; 298 std::cout.flush(); 266 299 } 267 300 … … 272 305 void IOConsole::lineAdded() 273 306 { 274 275 276 277 278 307 // Move curosr the beginning of the line and erase it 308 std::cout << "\033[1G\033[K"; 309 this->print(*(this->shell_.getNewestLineIterator())); 310 std::cout << std::endl; 311 this->printInputLine(); 279 312 } 280 313 … … 303 336 void IOConsole::executed() 304 337 { 305 // Move curosr the beginning of the line306 307 // Print command so the user knows what he typed338 // Move cursor the beginning of the line 339 std::cout << "\033[1G"; 340 // Print command so the user knows what he has typed 308 341 std::cout << "orxonox>" << this->shell_.getInput() << std::endl; 309 342 this->printInputLine(); 310 343 } 311 344
Note: See TracChangeset
for help on using the changeset viewer.