Rev 747 | Rev 758 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 747 | Rev 748 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | unit VTSCUI; |
1 | unit VTSCUI; |
2 | 2 | ||
3 | (************************************************) |
3 | (************************************************) |
4 | (* VTSCUI.PAS *) |
4 | (* VTSCUI.PAS *) |
5 | (* Author: Daniel Marschall *) |
5 | (* Author: Daniel Marschall *) |
6 | (* Revision: 2022-02-16 *) |
6 | (* Revision: 2022-02-19 *) |
7 | (* License: Apache 2.0 *) |
7 | (* License: Apache 2.0 *) |
8 | (* This file contains: *) |
8 | (* This file contains: *) |
9 | (* - ViaThinkSoft CUI (Console User Interface) *) |
9 | (* - ViaThinkSoft CUI (Console User Interface) *) |
10 | (************************************************) |
10 | (************************************************) |
11 | 11 | ||
Line 35... | Line 35... | ||
35 | Title: string; borderStrength: integer): boolean; |
35 | Title: string; borderStrength: integer): boolean; |
36 | procedure ShowMessage(msg: string; title: string; dobeep: boolean); |
36 | procedure ShowMessage(msg: string; title: string; dobeep: boolean); |
37 | procedure CursorOn; |
37 | procedure CursorOn; |
38 | procedure CursorOff; |
38 | procedure CursorOff; |
39 | procedure ResetDefaultDosColors; |
39 | procedure ResetDefaultDosColors; |
- | 40 | procedure WriteLnKeepX(s: string); |
|
40 | 41 | ||
41 | implementation |
42 | implementation |
42 | 43 | ||
43 | uses |
44 | uses |
44 | Crt, Drivers, VtsFuncs; |
45 | Crt, Drivers, VtsFuncs; |
Line 601... | Line 602... | ||
601 | begin |
602 | begin |
602 | TextBackground(Black); |
603 | TextBackground(Black); |
603 | TextColor(LightGray); |
604 | TextColor(LightGray); |
604 | end; |
605 | end; |
605 | 606 | ||
- | 607 | procedure WriteLnKeepX(s: string); |
|
- | 608 | var |
|
- | 609 | i: integer; |
|
- | 610 | initX: integer; |
|
- | 611 | bytesToWrite: integer; |
|
- | 612 | pNewLine: integer; |
|
- | 613 | begin |
|
- | 614 | initX := WhereX; |
|
- | 615 | while Length(s) > 0 do |
|
- | 616 | begin |
|
- | 617 | pNewLine := Pos(#13#10, s); |
|
- | 618 | GoToXy(initX, WhereY); |
|
- | 619 | bytesToWrite := ScreenWidth - initX + 1; |
|
- | 620 | if (pNewLine > 0) and (pNewLine < bytesToWrite) then |
|
- | 621 | bytesToWrite := pNewLine; |
|
- | 622 | Write(Copy(s, 1, bytesToWrite)); (* No WriteLn because there is automatic scrolling *) |
|
- | 623 | Delete(s, 1, bytesToWrite); |
|
- | 624 | end; |
|
- | 625 | WriteLn(''); |
|
- | 626 | end; |
|
- | 627 | ||
606 | end. |
628 | end. |