home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 02a / pull55.zip / PULLWORK.PAS < prev    next >
Pascal/Delphi Source File  |  1989-08-24  |  4KB  |  146 lines

  1. { =========================================================================== }
  2. { Pullwork.pas - Work Window procedures for main work       ver 5.5, 08-24-89 }
  3. {                area for PULLDEMO.PAS                                        }
  4. { This file contains all the procedures executed for the Work Window.  These  }
  5. { are the main steps of your program.  With this, you can create a sophisti-  }
  6. { cated multi-level window environment.                                       }
  7. {   Copyright (c) 1987-1989 James H. LeMay, All rights reserved.              }
  8. { =========================================================================== }
  9.  
  10. { R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }         { TP4 directives }
  11. {$A-,B-,D-,E-,F-,I-,L-,N-,O-,R-,S-,V-}    { TP5 directives }
  12.  
  13. {$define UseDataEntryCode }
  14. { define MultiWorkWndws }
  15.  
  16.  
  17. UNIT PullWork;
  18.  
  19. INTERFACE
  20.  
  21. uses
  22.   Crt,Qwik,Wndw,Pull,PullStat
  23.   {$ifdef UseDataEntryCode }
  24.   ,PullData;
  25.   {$else }
  26.   ;
  27.   {$endif }
  28.  
  29. procedure WorkWndw;
  30.  
  31.  
  32. IMPLEMENTATION
  33.  
  34. { ========================= Work Window Steps =============================== }
  35. { This procedure will have all the procedures for the Work window(s).         }
  36. { Each step assumes that some keystroke has been pressed and returns a value  }
  37. { for Key and ExtKey and any necessary change to WorkWndwStep.                }
  38. { --------------------------------------------------------------------------- }
  39. var
  40.   Start1,Start2: word;
  41.  
  42. {$ifdef MultiWorkWndws }
  43. procedure ResetWorkWndwStep;
  44. begin
  45.   case TWS.WSname of
  46.     Window1:  WorkWndwStep := 1;
  47.     Window2:  WorkWndwStep := 3;
  48.   end;
  49. end;
  50.  
  51. procedure HideWorkWndw;
  52. begin
  53.   HideWindow;
  54.   TopWorkWndwName := TWS.WSname;
  55.   ResetWorkWndwStep;
  56. end;
  57.  
  58. procedure AccessWorkWndw (WN: WindowNames);
  59. begin
  60.   if WN<>TWS.WSname then
  61.     begin
  62.       { -- if accessing a PermMode window, hide all upper windows. -- }
  63.       if (GetLevelIndex(WN)<=PLI) then
  64.         while (LI>PLI) do
  65.           HideWindow;         { Use RemoveWindow for serial access }
  66.       AccessWindow (WN);
  67.       ResetWorkWndwStep;
  68.     end;
  69. end;
  70. {$endif }
  71.  
  72. {$F+}
  73. procedure KbdIdle;
  74. begin
  75.   { Nothing to include this time, but fill in what you want to do while }
  76.   { the keyboard is idle. }
  77. end;
  78. {$F-}
  79.  
  80. procedure ShowFields;
  81. begin
  82.   WWrite (14,10,'Byte:');
  83.   WWrite (15,10,'Word:');
  84.   WWrite (16,10,'ShortInt:');
  85.   WWrite (17,10,'Integer:');
  86.   WWrite (18,10,'LongInt:');
  87.   WWrite (19,10,'Real:');
  88.   WWrite (14,39,'Hex:');
  89.   WWrite (15,39,'Char:');
  90.   WWrite (16,39,'String:');
  91.   WWrite (17,39,'File name:');
  92.   DisplayFields (ord(aByte2DE),ord(FileNameDE));
  93. end;
  94. {
  95. procedure MakeWorkWndw2;
  96. begin
  97.   SetWindowModes (HiddenMode);
  98.   MakeWindow ( 8,21,10,40,LightBlue+LightGrayBG,LightBlue+LightGrayBG,
  99.                DoubleBrdr,Window2);
  100.   SetWindowModes (0);
  101.   WriteToHidden (Window2);
  102.   TitleWindow (Top   ,Left  ,SameAttr,'2');
  103.   TitleWindow (Top   ,Center,SameAttr,' Work Window 2 ');
  104.   TitleWindow (Bottom,Center,SameAttr,' Press ESC to Hide ');
  105.   WWriteC (1,'Type in any input');
  106.   WGotoRC (2,1);
  107.   WriteToCRT;
  108. end;
  109. }
  110. procedure EditFields;
  111. begin
  112.   { Only FileName may have been changed }
  113.   DisplayFields (ord(FileNameDE),ord(FileNameDE));
  114.   EnterSeq (ord(aByte2DE),ord(FileNameDE),Start1);
  115. end;
  116.  
  117. procedure InitWorkWndws;
  118. begin
  119.   ShowFields;
  120.   WorkWndwStep := 1;
  121.   Key := NullKey;  { #00 }
  122. end;
  123.  
  124. procedure WorkWndw;
  125. begin
  126.   {$ifdef MultiWorkWndws }
  127.   AccessWorkWndw (TopWorkWndwName);
  128.   {$endif }
  129.   case WorkWndwStep of
  130.     0:  InitWorkWndws;
  131.     1:  EditFields;
  132.   end;
  133. end;
  134.  
  135. BEGIN
  136.   WorkWndwStep := 0;          { Initial step for work windows. }
  137.   {$ifdef MultiWorkWndws }
  138.   TopWorkWndwName := Window1;
  139.   {$endif }
  140.   Start1 := ord(aByte2DE);
  141.   Start2 := ord(aHex2DE);
  142.   AddrWorkWndw := @WorkWndw;
  143.   AddrKbdIdle  := @KbdIdle;
  144. END.
  145.  
  146.