mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 16:29:19 +02:00
* Fix demos so they work on 64-bit as well (there is no libc unit for 64 bit)
git-svn-id: trunk@30288 -
This commit is contained in:
parent
85cb180d80
commit
6d989c57e2
@ -76,8 +76,8 @@ begin
|
|||||||
wins[i] := newwin(NLINES, NCOLS, y, x);
|
wins[i] := newwin(NLINES, NCOLS, y, x);
|
||||||
FmtStr(lab, 'Window Number %d', [i + 1]);
|
FmtStr(lab, 'Window Number %d', [i + 1]);
|
||||||
win_show(wins[i], lab, i + 1);
|
win_show(wins[i], lab, i + 1);
|
||||||
y += 3;
|
Inc(y,3);
|
||||||
x += 7;
|
Inc(x,7);
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -3,18 +3,26 @@ program form_test_2;
|
|||||||
{$MODE OBJFPC}
|
{$MODE OBJFPC}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
ncurses, form, libc;
|
ncurses, form;
|
||||||
|
|
||||||
|
|
||||||
|
{$linklib c}
|
||||||
|
procedure setlocale(cat : integer; p : pchar); cdecl; external 'c';
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
LC_ALL = 6;
|
||||||
|
|
||||||
var
|
var
|
||||||
my_bg: Smallint = COLOR_BLACK;
|
my_bg: Smallint = COLOR_BLACK;
|
||||||
|
|
||||||
field: array[0..5] of PFIELD;
|
field: array[0..5] of PFIELD;
|
||||||
my_form: PFORM;
|
my_form: PFORM;
|
||||||
i, ch: Longint;
|
i, ch: Longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
||||||
setlocale(LC_ALL, ''); { Tested with Russian UTF-8 locale }
|
setlocale(LC_ALL, ''); { Tested with Russian UTF-8 locale }
|
||||||
|
|
||||||
(* Initialize curses *)
|
(* Initialize curses *)
|
||||||
|
@ -20,7 +20,7 @@ var
|
|||||||
begin
|
begin
|
||||||
FmtStr(tstr, fmt, args);
|
FmtStr(tstr, fmt, args);
|
||||||
getmaxyx(win, my, mx);
|
getmaxyx(win, my, mx);
|
||||||
mx -= startx;
|
dec(mx,startx);
|
||||||
|
|
||||||
if (width > length(tstr)) OR (width < 2) then
|
if (width > length(tstr)) OR (width < 2) then
|
||||||
width := length(tstr);
|
width := length(tstr);
|
||||||
|
@ -6,8 +6,14 @@ program form_test_3;
|
|||||||
{$MODE OBJFPC}
|
{$MODE OBJFPC}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
ncurses, form, libc;
|
ncurses, form;
|
||||||
|
|
||||||
|
{$linklib c}
|
||||||
|
procedure setlocale(cat : integer; p : pchar); cdecl; external 'c';
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
LC_ALL = 6;
|
||||||
|
|
||||||
|
|
||||||
function st_middle(scrlen, itemlen: Smallint): Smallint; inline;
|
function st_middle(scrlen, itemlen: Smallint): Smallint; inline;
|
||||||
|
@ -2,7 +2,14 @@ program tclock;
|
|||||||
{$MODE OBJFPC}
|
{$MODE OBJFPC}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
libc, ncurses, sysutils;
|
ncurses, sysutils;
|
||||||
|
|
||||||
|
{$linklib c}
|
||||||
|
procedure setlocale(cat : integer; p : pchar); cdecl; external 'c';
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
LC_ALL = 6;
|
||||||
|
|
||||||
const
|
const
|
||||||
ASPECT = 2.2;
|
ASPECT = 2.2;
|
||||||
|
@ -8,7 +8,15 @@ program nlshello;
|
|||||||
{$mode objfpc}
|
{$mode objfpc}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
gettext, libc, ncurses;
|
gettext, ncurses;
|
||||||
|
|
||||||
|
{$linklib c}
|
||||||
|
procedure setlocale(cat : integer; p : pchar); cdecl; external 'c';
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
LC_ALL = 6;
|
||||||
|
|
||||||
|
|
||||||
resourcestring
|
resourcestring
|
||||||
hello_world = 'Hello world!';
|
hello_world = 'Hello world!';
|
||||||
|
Loading…
Reference in New Issue
Block a user