From 76b727ae201f60324bdaaae1fa01ae787850634d Mon Sep 17 00:00:00 2001 From: Freeman Date: Tue, 9 Jun 2020 22:19:49 +0300 Subject: [PATCH] CRT.SetTitle procedure added --- Lib/CRT.pas | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Lib/CRT.pas b/Lib/CRT.pas index a6ba8a4..b936bfa 100644 --- a/Lib/CRT.pas +++ b/Lib/CRT.pas @@ -32,8 +32,9 @@ const Yellow = 14; White = 15; -procedure InitConsole(Caption: PKolibriChar; CloseWindowOnExit: Boolean = True; +procedure InitConsole(Title: PKolibriChar; CloseWindowOnExit: Boolean = True; WndWidth: LongWord = $FFFFFFFF; WndHeight: LongWord = $FFFFFFFF; ScrWidth: LongWord = $FFFFFFFF; ScrHeight: LongWord = $FFFFFFFF); +procedure SetTitle(Title: PKolibriChar); procedure GotoXY(X, Y: Integer); overload; procedure GotoXY(const Point: TCursorXY); overload; @@ -94,11 +95,12 @@ var ReadKeyFunc: function: KolibriChar; stdcall; SetFlags: function(Flags: LongWord): LongWord; stdcall; SetCursorHeight: function(Height: Integer): Integer; stdcall; + SetTitleProc: procedure(Title: PKolibriChar); stdcall; WhereXYProc: procedure(var X, Y: Integer); stdcall; WritePChar: procedure(Str: PKolibriChar); stdcall; WritePCharLen: procedure(Str: PKolibriChar; Length: LongWord); stdcall; -procedure InitConsole(Caption: PKolibriChar; CloseWindowOnExit: Boolean; +procedure InitConsole(Title: PKolibriChar; CloseWindowOnExit: Boolean; WndWidth, WndHeight, ScrWidth, ScrHeight: LongWord); begin hConsole := LoadLibrary('/sys/lib/console.obj'); @@ -114,14 +116,20 @@ begin ReadKeyFunc := GetProcAddress(hConsole, 'con_getch'); SetCursorHeight := GetProcAddress(hConsole, 'con_set_cursor_height'); SetFlags := GetProcAddress(hConsole, 'con_set_flags'); + SetTitleProc := GetProcAddress(hConsole, 'con_set_title'); WhereXYProc := GetProcAddress(hConsole, 'con_get_cursor_pos'); WritePChar := GetProcAddress(hConsole, 'con_write_asciiz'); WritePCharLen := GetProcAddress(hConsole, 'con_write_string'); - ConsoleInit(WndWidth, WndHeight, ScrWidth, ScrHeight, Caption); + ConsoleInit(WndWidth, WndHeight, ScrWidth, ScrHeight, Title); CloseWindow := CloseWindowOnExit; end; +procedure SetTitle(Title: PKolibriChar); +begin + SetTitleProc(Title); +end; + function NormVideo: LongWord; begin Result := SetFlags(GetFlags and $300 or $07);