Dec 232017
 
TP4 unit for pop-up windows, and rt to get input like TP4 "load file nam.
File POPS.ZIP from The Programmer’s Corner in
Category Pascal Source Code
TP4 unit for pop-up windows, and rt to get input like TP4 “load file nam.
File Name File Size Zip Size Zip Type
FN.PAS 1760 666 deflated
POPS.DOC 2319 1004 deflated
POPS.PAS 4464 1533 deflated
TESTF.EXE 9616 6039 deflated
TESTF.PAS 593 362 deflated

Download File POPS.ZIP Here

Contents of the POPS.DOC file


{ This is an excerpt from the interface section, plus comments }
{ Requries the unit FN which has a couple of useful functions... }
{ TESTF is a sample demo program. }

Type PopCenter=(pleft,pcenter,pright);
{ Parameter to DrawBorder }

Procedure DrawBorder(x1,y1,x2,y2,border:byte);
{ Draw a border from x1,y1 to x2,y2, of type border (1-5).
The procedure does WINDOW(1,1,80,25) first, then draws, then resets
the window. }

Procedure SaveWindow(var p:pointer; x1,y1,x2,y2:byte);
{ Save the area on the screen delimited by x1,y1 & x2,y2. Requires that
internal pointer to graphics memory be correct; Use SetScreenMem or use
FindScreenMem if location is unknown or varies. Dynamic variable stores
all info. }

Procedure RestWindow(var p:pointer);
{ Restore info from SaveWindow. Restores area of screen, resets current
WINDOW values and cursor position, and restores TextAttr. }

Procedure Dopop(var p:pointer; x1,y1,x2,y2,genatt,border,batt:byte);
{ General PopUp window. Saves area underneath in p, then sets TextAttr to
genatt, sets WINDOW to fit popped-up window, and clears the window; then
draws border with attribute of batt if border<>0 }

Procedure PopLabel(s:string; t:popcenter);
{ Displays a label s (in TextAttr) in border of current popped-up window
(guesses from current WINDOW setting, best only to use after DoPop, and
should not have DoPop with border=0.) }

Procedure Popup(var p:pointer; x1,y1,x2,y2:byte; s:string; genatt:byte);
{ DoPop with border=1,batt=genatt; PopLabel(s,pleft); }

Procedure Popupc(var p:pointer; x1,y1,x2,y2:byte; s:string; genatt,att:byte);
{ DoPop with border=1; PopLabel(s,pleft); }

Procedure Unpop(var p:pointer);
{ Remove popped up window p (better have been last or screen gets freaked. }

Procedure SetScreenMem(x:word);
{ Sets segment of pointer to screen memory used by SaveWindow & RestWindow }

Procedure FindScreenMem;
{ Displays via WRITELN and then searches through memory for itself to
calculate the above. }

Function GetPop(title,default:string; x1,y1:byte; len:byte):string;
{ Pop up a window with label title, with text area of 1 row len columns.
Then GetDef with default as default value and len as allowed length.
UnPop window and return, a la TP4 filename input menus. }


 December 23, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)