home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / infoscr.zip / ISCRDEM1.PAS < prev    next >
Pascal/Delphi Source File  |  1995-10-16  |  3KB  |  103 lines

  1. unit Iscrdem1;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Tinfoscr;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     InfoScreen1: TInfoScreen;
  12.     Button1: TButton;
  13.     Button2: TButton;
  14.     Button3: TButton;
  15.     Button4: TButton;
  16.     procedure Button1Click(Sender: TObject);
  17.     procedure Button2Click(Sender: TObject);
  18.     procedure Button3Click(Sender: TObject);
  19.     procedure Button4Click(Sender: TObject);
  20.     procedure InfoScreen1RegButtonClick(Sender: TObject);
  21.   private
  22.   public
  23.   end;
  24.  
  25. var
  26.   Form1: TForm1;
  27.  
  28. const
  29. standardcomment='This is a sample application to show the use of the '+
  30.                 'InfoScreen-Component. Please feel free to use the component '+
  31.                 'in your own programs. If you want the source-code please send '+
  32.                 '10 US$ to my address in Germany. For further information see '+
  33.                 'the "InfoScr.wri"';
  34.  
  35. implementation
  36.  
  37. {$R *.DFM}
  38.  
  39. procedure TForm1.Button1Click(Sender: TObject);
  40. begin
  41. With InfoScreen1 do begin
  42. comment:=standardcomment;
  43. Delay:=10;   (*delay=10 seconds*)
  44. ShowRegButton:=True;  (*Show "Register"-Button*)
  45. Execute;              (*It's so simple...*)
  46. end;
  47. end;
  48.  
  49. procedure TForm1.Button2Click(Sender: TObject);
  50. begin
  51. With InfoScreen1 do begin
  52. comment:=standardcomment;
  53. Delay:=0;   (*disable delay*)
  54. ShowRegButton:=False;  (*do not show "Register"-Button*)
  55. Execute;              (*It's so simple...*)
  56. end;
  57.  
  58. end;
  59.  
  60. procedure TForm1.Button3Click(Sender: TObject);
  61. begin
  62. With InfoScreen1 do begin
  63. comment:=standardcomment;
  64. Delay:=5;   (*delay=5 seconds*)
  65. ShowRegButton:=True;  (*Show "Register"-Button*)
  66. RegButtonCaption:='Yes.Ok.'; (*user-definded Caption*)
  67. ContButtonCaption:='&Go on now'; (*user-defined Caption*)
  68. Execute;              (*It's so simple...*)
  69. end;
  70.  
  71. end;
  72.  
  73. procedure TForm1.Button4Click(Sender: TObject);
  74. var gdires,sysres,userres:word;
  75. begin
  76. With InfoScreen1 do begin
  77. Delay:=0;   (*disable delay*)
  78. ShowRegButton:=True;  (*Show Register-Button*)
  79. RegistrationInfo:='registered to: unregistered';
  80.  
  81. (*Show some system information, each row delmited with #13*)
  82. sysres:=GetFreeSystemResources(0);
  83. gdires:=GetFreeSystemResources(1);
  84. userres:=GetFreeSystemResources(2);
  85. Comment:='Free Resources: '+#13+
  86.          'System: '+inttostr(sysres)+' %'+#13+
  87.          'GDI   : '+inttostr(gdires)+' %'+#13+
  88.          'User  : '+inttostr(userres)+' %';
  89. Execute;              (*It's so simple...*)
  90. end;
  91.  
  92. end;
  93.  
  94. procedure TForm1.InfoScreen1RegButtonClick(Sender: TObject);
  95. begin
  96.  MessageDlg('Here you can place the code that '+
  97.  'will be executed after the Register-Button has been clicked', mtInformation,[MbOk],0);
  98.  
  99. end;
  100.  
  101. end.
  102.  
  103.