home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / tttdem51.zip / DIRDEM2.PAS < prev    next >
Pascal/Delphi Source File  |  1989-01-31  |  4KB  |  103 lines

  1. Program ShowOff_Directory_Routines;
  2.  
  3. {NOTE: Set Options Compiler Conditional to DIRFULL and choose build}
  4.  
  5. Uses DOS, CRT, FastTTT5, WinTTT5, KeyTTT5, Dirttt5;
  6.  
  7. var
  8.    Mask,F : StrScreen;
  9.    R : integer;
  10.    Ch : char;
  11.  
  12.  
  13.   Procedure SetUp_Screen;
  14.   {}
  15.   begin
  16.       ClearText(1,1,80,3,yellow,blue);
  17.       FillScreen(1,4,80,25,white,blue,chr(176));
  18.       OffCursor;
  19.       ClickWrite(16,2,yellow,blue,'TechnoJock''s Turbo Toolkit v5.0  -  Directory Demo');
  20.   end; {of proc SetUp_Screen}
  21.  
  22.   Procedure Default_Directory;
  23.   {}
  24.   begin
  25.       WriteAt(9,21,white,blue,' This is the default directory format. Experiment by changing ');
  26.       WriteAt(9,22,white,blue,' directories. Press the space bar to see a condensed file     ');
  27.       WriteAt(9,23,white,blue,' list. Press F1 to see a list of the sorting keys. A file can ');
  28.       WriteAt(9,24,white,blue,' be selected by pressing Enter OR by inputting the file name. ');
  29.       F := Display_Directory(Mask,R);
  30.       If R = 0 then
  31.          WriteCenter(12,white,red,'You chose file '+F+', press any key.')
  32.       else
  33.          WriteCenter(12,white,red,'You escaped! Press any key.');
  34.       Ch := getKey;
  35.       RestoreScreen(1);
  36.   end; {of proc Default_Directory}
  37.  
  38.   Procedure Narrow_Directory;
  39.   {}
  40.   begin
  41.       WriteAt(18,21,white,blue,' By changing some of the default settings, the same directory ');
  42.       WriteAt(18,22,white,blue,' can be given a very different look and feel. In this single  ');
  43.       WriteAt(18,23,white,blue,' column mode, the space bar can be used to toggle between a   ');
  44.       WriteAt(18,24,white,blue,' brief or detailed display of the files. Choose a file.       ');
  45.       with DTTT do
  46.       begin
  47.           TopX := 1;                  {top left X Coord}
  48.           TopY := 1;                  {top left Y coord}
  49.           ColsWide := 1;              {in condensed mode, just show one column}
  50.           DisplayInfo := false;       {Don'show help portion at the top of list}
  51.           Rows := 23;                 {Display 15 rows of files}
  52.           ShowDetails := false;       {initially don't show details}
  53.       end;
  54.       F := Display_Directory(Mask,R);
  55.       If R = 0 then
  56.          WriteCenter(12,white,red,'You chose file '+F+', press any key.')
  57.       else
  58.          WriteCenter(12,white,red,'You escaped! Press any key.');
  59.       Ch := getKey;
  60.       DirTTT5.Default_Settings;    {reset back to defaults}
  61.       RestoreScreen(1);
  62.   end; {of proc Narrow_Directory}
  63.  
  64.  
  65.   Procedure Large_Directory;
  66.   {}
  67.   begin
  68.       WriteAt(9,21,white,blue,' This third format shows a large directory box. Press Alt-Z  ');
  69.       WriteAt(9,22,white,blue,' to zoom the box to the bottom of the display.               ');
  70.       WriteAt(9,23,white,blue,'                                                             ');
  71.       WriteAt(9,24,white,blue,' The directory features are modelled on Borland''s Sidekick+. ');
  72.       with DTTT do
  73.       begin
  74.           TopY := 1;                  {top left Y coord}
  75.           ColsWide := 5;              {in condensed mode, just show one column}
  76.           Rows := 10;                 {Display 15 rows of files}
  77.           ShowDetails := false;       {initially don't show details}
  78.       end;
  79.       F := Display_Directory(Mask,R);
  80.       If R = 0 then
  81.          WriteCenter(12,white,red,'You chose file '+F+', press any key.')
  82.       else
  83.          WriteCenter(12,white,red,'You escaped! Press any key.');
  84.       Ch := getKey;
  85.       RestoreScreen(1);
  86.   end; {of proc Large_Directory}
  87.  
  88.  
  89. begin
  90.     If Paramcount = 0 then
  91.        Mask := '*.*'
  92.     else
  93.        Mask := ParamStr(1);
  94.     SetUp_Screen;
  95.     SaveScreen(1);
  96.     Default_Directory;
  97.     Narrow_Directory;
  98.     Large_Directory;
  99.     DisposeScreen(1);
  100.     Clrscr;
  101.     Reset_StartUp_Mode;
  102. end.
  103.