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

  1. program DemoIOTwelve;
  2. {demIO12 - radio buttons & check boxes}
  3.  
  4. Uses DOS, CRT,
  5.      totFAST, totIO1, totIO2, totSTR;
  6.  
  7. var
  8.   Field1: CheckIOOBJ;
  9.   Field2,
  10.   Field3,
  11.   Field4: RadioIOOBJ;
  12.   Keys: ControlKeysIOOBJ;
  13.   Manager: FormOBJ;
  14.  
  15. procedure InitVars;
  16. {}
  17. begin
  18.    with Field1 do
  19.    begin
  20.       Init(17,5,25,4,'Options');
  21.       AddItem('~C~ase sensitive',67,false);
  22.       AddItem('~W~hole words only',87,false);
  23.       AddItem('~R~egular expression',82,false);
  24.    end;
  25.    with Field2 do
  26.    begin
  27.       Init(17,10,25,3,'Scope');
  28.       AddItem('~G~lobal',71,true);
  29.       AddItem('~S~elected text',83,false);
  30.    end;
  31.    with Field3 do
  32.    begin
  33.       Init(45,5,17,3,'Direction');
  34.       AddItem('Forwar~d~',68,true);
  35.       AddItem('~B~ackward',66,false);
  36.    end;
  37.    with Field4 do
  38.    begin
  39.       Init(45,10,17,3,'Origin');
  40.       AddItem('~F~rom cursor',70,false);
  41.       AddItem('~E~ntire scope',69,true);
  42.    end;
  43.    Keys.Init;
  44. end; {InitVars}
  45.  
  46. procedure DisposeVars;
  47. {}
  48. begin
  49.    Field1.Done;
  50.    Field2.Done;
  51.    Field3.Done;
  52.    Field4.Done;
  53.    Keys.Done;
  54. end; {DisposeVars}
  55.  
  56. begin
  57.    InitVars;
  58.    ClrScr;
  59.    Screen.FillBox(14,2,65,16,79,1);
  60.    Screen.WriteCenter(16,79,' Press Tab to change fields. F10 to finish. ');
  61.    with manager do
  62.    begin
  63.       Init;
  64.       AddItem(Keys);
  65.       AddItem(Field1);
  66.       AddItem(Field2);
  67.       AddItem(Field3);
  68.       AddItem(Field4);
  69.       if Go = Finished then
  70.       begin
  71.          GotoXY(1,18);
  72.          with Field1 do
  73.          begin
  74.            writeln('Case sensitive: ',GetValue(1));
  75.            writeln('Whole words: ',GetValue(2));
  76.            writeln('Regular Expressions: ',GetValue(3));
  77.          end;
  78.          write('Scope: ');
  79.          if Field2.GetValue = 1 then
  80.             writeln('Global')
  81.          else
  82.             writeln('Selected text');
  83.          if Field3.GetValue = 1 then
  84.             writeln('Forward')
  85.          else
  86.             writeln('Backward');
  87.          if Field4.GetValue = 1 then
  88.             writeln('From cursor')
  89.          else
  90.             writeln('Entire scope');
  91.       end
  92.       else
  93.       begin
  94.          GotoXY(1,20);
  95.          writeln('You escaped!');
  96.       end;
  97.       DisposeVars;
  98.       Done;
  99.    end;
  100. end.