* 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:
michael 2015-03-23 14:49:37 +00:00
parent 85cb180d80
commit 6d989c57e2
6 changed files with 38 additions and 9 deletions

View File

@ -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;

View File

@ -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 *)

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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!';