Subversion Repositories Kolibri OS

Rev

Rev 6613 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7597 akron1 1
(*
2
    Copyright 2016, 2018 Anton Krotov
6613 leency 3
 
4
    This program is free software: you can redistribute it and/or modify
5
    it under the terms of the GNU Lesser General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
7
    (at your option) any later version.
8
 
9
    This program is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU Lesser General Public License for more details.
13
 
14
    You should have received a copy of the GNU Lesser General Public License
15
    along with this program.  If not, see .
16
*)
17
 
18
MODULE Console;
19
 
7597 akron1 20
IMPORT ConsoleLib, In, Out;
6613 leency 21
 
7597 akron1 22
 
6613 leency 23
CONST
24
 
7597 akron1 25
    Black* = 0;      Blue* = 1;           Green* = 2;        Cyan* = 3;
26
    Red* = 4;        Magenta* = 5;        Brown* = 6;        LightGray* = 7;
27
    DarkGray* = 8;   LightBlue* = 9;      LightGreen* = 10;  LightCyan* = 11;
28
    LightRed* = 12;  LightMagenta* = 13;  Yellow* = 14;      White* = 15;
6613 leency 29
 
7597 akron1 30
 
31
PROCEDURE SetCursor* (X, Y: INTEGER);
6613 leency 32
BEGIN
7597 akron1 33
    ConsoleLib.set_cursor_pos(X, Y)
6613 leency 34
END SetCursor;
35
 
7597 akron1 36
 
37
PROCEDURE GetCursor* (VAR X, Y: INTEGER);
6613 leency 38
BEGIN
7597 akron1 39
    ConsoleLib.get_cursor_pos(X, Y)
6613 leency 40
END GetCursor;
41
 
7597 akron1 42
 
6613 leency 43
PROCEDURE Cls*;
44
BEGIN
7597 akron1 45
    ConsoleLib.cls
6613 leency 46
END Cls;
47
 
7597 akron1 48
 
49
PROCEDURE SetColor* (FColor, BColor: INTEGER);
50
VAR
51
    res: INTEGER;
52
 
6613 leency 53
BEGIN
7597 akron1 54
    IF (FColor IN {0..15}) & (BColor IN {0..15}) THEN
55
        res := ConsoleLib.set_flags(LSL(BColor, 4) + FColor)
56
    END
6613 leency 57
END SetColor;
58
 
7597 akron1 59
 
60
PROCEDURE GetCursorX* (): INTEGER;
61
VAR
62
    x, y: INTEGER;
63
 
6613 leency 64
BEGIN
7597 akron1 65
    ConsoleLib.get_cursor_pos(x, y)
66
    RETURN x
6613 leency 67
END GetCursorX;
68
 
7597 akron1 69
 
70
PROCEDURE GetCursorY* (): INTEGER;
71
VAR
72
    x, y: INTEGER;
73
 
6613 leency 74
BEGIN
7597 akron1 75
    ConsoleLib.get_cursor_pos(x, y)
76
    RETURN y
6613 leency 77
END GetCursorY;
78
 
7597 akron1 79
 
80
PROCEDURE open*;
81
BEGIN
82
    ConsoleLib.open(-1, -1, -1, -1, "");
83
    In.Open;
84
    Out.Open
85
END open;
86
 
87
 
88
PROCEDURE exit* (bCloseWindow: BOOLEAN);
89
BEGIN
90
    ConsoleLib.exit(bCloseWindow)
91
END exit;
92
 
93
 
6613 leency 94
END Console.