| 400 | void CC708Window::DecrPenLocation(void) |
| 401 | { |
| 402 | // TODO: Scroll direction and up/down printing, |
| 403 | // and word wrap not handled yet... |
| 404 | int new_column = pen.column, new_row = pen.row; |
| 405 | |
| 406 | new_column -= (print_dir == k708DirLeftToRight) ? +1 : 0; |
| 407 | new_column -= (print_dir == k708DirRightToLeft) ? -1 : 0; |
| 408 | new_row -= (print_dir == k708DirTopToBottom) ? +1 : 0; |
| 409 | new_row -= (print_dir == k708DirBottomToTop) ? -1 : 0; |
| 410 | |
| 411 | #if 0 |
| 412 | VERBOSE(VB_VBI, QString("DecrPen dir%1: (c %2, r %3) -> (%4,%5)") |
| 413 | .arg(print_dir).arg(pen.column).arg(pen.row) |
| 414 | .arg(new_column).arg(new_row)); |
| 415 | #endif |
| 416 | |
| 417 | if (k708DirLeftToRight == print_dir || k708DirRightToLeft == print_dir) |
| 418 | { |
| 419 | // basic wrapping for l->r, r->l languages |
| 420 | if (!row_lock && column_lock && (new_column >= (int)true_column_count)) |
| 421 | { |
| 422 | new_column = 0; |
| 423 | new_row += 1; |
| 424 | } |
| 425 | else if (!row_lock && column_lock && (new_column < 0)) |
| 426 | { |
| 427 | new_column = (int)true_column_count - 1; |
| 428 | new_row -= 1; |
| 429 | } |
| 430 | Scroll(new_row, new_column); |
| 431 | } |
| 432 | else |
| 433 | { |
| 434 | pen.column = max(new_column, 0); |
| 435 | pen.row = max(new_row, 0); |
| 436 | } |
| 437 | // TODO implement other 2 scroll directions... |
| 438 | |
| 439 | LimitPenLocation(); |
| 440 | } |
| 441 | |