home *** CD-ROM | disk | FTP | other *** search
- {$C-}
- program textwind;
-
- const
- workpage = 1;
-
- {$I dispdef.sys }
- {$I bios.sys }
- {$I pbios.sys }
- {$I display.sys }
-
- {$I strings.sys }
- {$I window.sys }
- {$I colors.sys }
-
-
- procedure newline;
- begin
- write(#13#10);
- end;
-
-
- procedure input( var quit : boolean );
- var
- ch : char;
- special: boolean;
- begin
- ch := readkey(special);
- if not special then
- case ch of
- #32..#126 : write(ch);
- #13 : newline;
- #8 : backspace;
- ^Y : quit := true;
- else
- beep
- end
- else
- case ch of
- #75 : cursorleft;
- #77 : cursorright;
- #72 : cursorup;
- #80 : cursordown;
- #71 : Displayhome;
- #79 : Displayend;
- #115 : moveleft(0,0,2,MaxDisplayStack);
- #116 : moveright(0,0,2,MaxDisplayStack);
- #160 : moveup(0,0,1,MaxDisplayStack);
- #164 : movedown(0,0,1,MaxDisplayStack);
- #117 : begin
- clrscr;
- displayhome;
- end;
- else
- beep
- end;
- end;
-
-
- var
- bail,quit : boolean;
- ch : char;
- begin
- {
- WindowInit is a required call to initialize use of screen I/O package.
- SaveScreen copies the original screen data to the last position in
- the screen stack. This may be restored with RestoreScreen.
- }
- windowinit;savescreen;
- {
- The next block of code defines a work display screen and builds
- the little window that will be dropped on top of the current screen.
- }
- selectpage(workpage);setcursoroff;
- window(20,6,60,15);clrscr;
- inverseon;monoframe2;
- header('Use the CRTL-Arrow keys to move window');
- blinkon;footer('Press ^Y to Exit This Program');blinkoff;
- inverseoff;
- centertext(2,'WINDOW MOTION');
- centertext(3,'TEXT ENTRY EXAMPLE');
-
- selectpage(0);setcursoron;
-
- { The Main Loop of the program. }
-
- repeat
- quit := false;bail:=false;
- plop(workpage,0); { copy window overlay to hardware }
- repeat
- input(quit)
- until quit;
- plop(0,workpage); { copy window overlay to workpage }
-
- restorescreen;inverseon;blinkon;
- footer('Are You sure that you want to exit? (Y/N) ---> ');
- inverseoff;blinkoff;
-
- repeat
- read(kbd,ch);
- until upcase(ch) in ['Y','N'];
-
- if upcase(ch) = 'Y' then bail := true;
- restorescreen;
- until bail;
-
- {
- WindowExit is called when the program is complete. This resets
- all of the goodies changed by the program.
- }
- setcursoron;windowexit;
-
- end.
-