home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progpas
/
tegl6b.arj
/
INTROPAK.EXE
/
lha
/
TSTEDIT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-06-10
|
3KB
|
126 lines
{$M 20000,0,655360}
{-- Defaults }
{$A-} {-- A- byte alignment }
{$B-} {-- B- short circuit boolean evaluation }
{$D+} {-- D- No debug info }
{$E-} {-- E- No emulation }
{$F-} {-- F- Far calls only when necessary }
{$I-} {-- I- I/O error checking done internally }
{$L+} {-- L- No local symbols }
{$N-} {-- N- Software reals }
{$R-} {-- R- Range checking off }
{$S-} {-- S- Stack overflow off }
{$V-} {-- V- No strict type checking }
uses crt,
tegledit,
errorlog,
virtmem,
teglfnt2,
teglfont,
teglicon,
ipstacks,
teglmain,
tgraph,
teglintr,
teglunit,
fastgrph;
var mystr1 : string;
mystr2 : string;
mystrfs : imagestkptr;
mystr1ms : msclickptr;
mystr2ms : msclickptr;
{$F+}
Function ExitOption(fs:ImageStkPtr; ms: MsClickPtr) : Word;
{$F+}
BEGIN
logmessage(mystr1);
Abortexit(mystr2);
exitoption := 1;
END;
{$F+}
Function MyDoneEvent(fs:ImageStkPtr; ms: MsClickPtr) : Word;
{$F+}
begin
if visualbuttonpress(fs,ms) then
dropstackimage(fs);
MyDoneEvent := 1;
end;
{$F+}
function StrPackformat(var txtstr:string):boolean;
{$F-}
var pack : boolean;
i : byte;
begin
i := pos(' ',txtstr);
pack := i<>0;
while i<>0 do
begin
delete(txtstr,i,1);
i := pos(' ',txtstr);
end;
strpackformat := pack;
end;
procedure CreateEditBox;
var x,y,x1,y1: word;
fs : imagestkptr;
begin
x := 100;
y := 10;
x1 := x+300;
y1 := y+100;
mystr1 := 'This is an initialized String from mystr1';
mystr2 := 'This is an initialized String from mystr2';
pushimage(x,y,x1,y1);
fs := stackptr;
mystrfs := stackptr;
SetFillPattern(gridfill,darkgray);
{ SetFillStyle(solidfill,darkgray); }
BevelBox(x,y,x1,y1,white,lightgray,red,5);
setkeyboardmouse(false);
DefineStrEditEvent(fs,10,10,290,30,254,white,@font14,true,
mystr1,Allchars,StrPackFormat,StrPackformat,nilunitproc);
mystr1ms := fs^.msptr;
DefineStrEditEvent(fs,10,35,290,55,254,white,@cour25,true,
mystr2,NumbersOnly,StrNoFormat,StrRedisplay,nilunitproc);
mystr2ms := fs^.msptr;
prepareforupdate(fs);
Putpict(x1-60,y1-25,@imageok,black);
DefineMouseClickArea(fs,(x1-x)-60,(y1-y)-25,(x1-x)-60+37,(y1-y)-25+14,TRUE,MyDoneEvent,MSCLICK);
CommitUpdate;
AddCaptureKey($001C,FALSE,CRClickPress);
AddCaptureKey($009C,TRUE,CRClickRelease);
end;
begin
EasyTegl;
EasyOut;
DefineGlobalKeyClickArea(NIL,NIL,$082d,false,exitoption); {-- Alt-X}
createeditbox;
setstredit(mystrfs,mystr2ms,1);
TEGLSupervisor;
end.