home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tot5.zip / DEMIO19.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  2KB  |  83 lines

  1. program DemoIONineteen;
  2. {demIO19 - full field input with a char hook}
  3.  
  4. Uses DOS, CRT,
  5.      totFAST, totIO1, totIO2, totMSG, totMISC, totSTR;
  6.  
  7. Var
  8.    Name: LateralIOOBJ;
  9.    Phone: PictureIOOBJ;
  10.    Price: FixedRealIOOBJ;
  11.    Keys: ControlkeysIOOBJ;
  12.    Manager: FormOBJ;
  13.    Result: tAction;
  14.  
  15. {$F+}
  16. function ShowTime(var K:word; var X,Y:byte; var ID:word):tAction;
  17. {}
  18. var Msg:  MessageOBJ;
  19. begin
  20.    if K = 276 then {Alt-T}
  21.    begin
  22.       with Msg do
  23.       begin
  24.          Init(1,'The Time M''Lord');
  25.          Addline('');
  26.          AddLine(padcenter(CurrentTime,25,' '));
  27.          AddLine('');
  28.          Show;
  29.          Done;
  30.       end;
  31.       K := 0;
  32.    end;
  33.    ShowTime := none;
  34. end; {ShowTime}
  35. {$F-}
  36.  
  37. procedure InitVars;
  38. {}
  39. begin
  40.    with Name do
  41.    begin
  42.       Init(35,5,20,40);
  43.       SetLabel('Vendor Name');
  44.    end;
  45.    with Phone do
  46.    begin
  47.       Init(35,7,'(###) ###-####');
  48.       SetLabel('Tel');
  49.       SetRules(JumpIfFull);
  50.    end;
  51.    with Price do
  52.    begin
  53.       Init(35,9,8,2);
  54.       SetLabel('Unit Price');
  55.       SetValue(250.0);
  56.       SetMinMax(0.1,12250.0);
  57.       SetRules(EraseDefault);
  58.    end;
  59.    Keys.Init;
  60. end; {InitVars}
  61.  
  62. begin
  63.    ClrScr;
  64.    Screen.TitledBox(15,3,65,11,76,79,78,2,' Quicky Input Demo ');
  65.    Screen.WriteCenter(25,white,'Press TAB to switch fields and press ESC or F10 or Alt-T');
  66.    InitVars;
  67.    with Manager do
  68.    begin
  69.       Init;
  70.       AddItem(Keys);
  71.       AddItem(Name);
  72.       AddItem(Phone);
  73.       AddItem(Price);
  74.       SetCharHook(ShowTime);
  75.       Result := Go;
  76.       if Result = Finished then
  77.          {update the database..}
  78.       else
  79.          {call Esc routine};
  80.    end;
  81. end.
  82.  
  83.