home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kolekce / d345 / JWTOOL.ZIP / jwtool / Demos / Unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2001-09-29  |  2.3 KB  |  95 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   JwFshCl, ExtCtrls, JwPopbtn, JwWrpbtn, StdCtrls, Jwlabel, Jwlinez,
  8.   JwStgPnl, JwAutAbt, jpeg, jwShellBrowseFolder;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     JwLinez1: TJwLinez;
  13.     JwLinez2: TJwLinez;
  14.     JwLinez3: TJwLinez;
  15.     JwLinez4: TJwLinez;
  16.     JwLinez7: TJwLinez;
  17.     JwLinez8: TJwLinez;
  18.     JwLinez5: TJwLinez;
  19.     JwLinez6: TJwLinez;
  20.     JwWrapButton1: TJwWrapButton;
  21.     JwPopButton1: TJwPopButton;
  22.     JwExpLabel1: TJwExpLabel;
  23.     JwFlashClick1: TJwFlashClick;
  24.     JwStagePanel1: TJwStagePanel;
  25.     JwAutoAbout1: TJwAutoAbout;
  26.     jwShellBrowseFolder1: TjwShellBrowseFolder;
  27.     JwFlashClick2: TJwFlashClick;
  28.     JwFlashClick3: TJwFlashClick;
  29.     JwFlashClick4: TJwFlashClick;
  30.     procedure JwWrapButton1Click(Sender: TObject);
  31.     procedure JwFlashClick1Click(Sender: TObject);
  32.     procedure JwFlashClick2Click(Sender: TObject);
  33.     procedure JwFlashClick3Click(Sender: TObject);
  34.     procedure JwFlashClick4Click(Sender: TObject);
  35.     procedure JwStagePanel1Click(Sender: TObject);
  36.   private
  37.     { Private declarations }
  38.   public
  39.     { Public declarations }
  40.   end;
  41.  
  42. var
  43.   Form1: TForm1;
  44.  
  45. implementation
  46.  
  47. uses ShellApi, FileCtrl;
  48. {$R *.DFM}
  49.  
  50. procedure TForm1.JwWrapButton1Click(Sender: TObject);
  51. begin
  52.   Close;
  53. end;
  54.  
  55. procedure TForm1.JwFlashClick1Click(Sender: TObject);
  56. begin
  57. JwAutoAbout1.Execute;
  58. end;
  59.  
  60. procedure TForm1.JwFlashClick2Click(Sender: TObject);
  61. begin
  62.   if jwShellBrowseFolder1.Execute then
  63.     ( Sender as TJwFlashClick ).Caption := jwShellBrowseFolder1.SelectedFolder;
  64. end;
  65.  
  66. procedure TForm1.JwFlashClick3Click(Sender: TObject);
  67. var
  68.   Opts: TShellExecuteInfo;
  69. begin
  70.   if DirectoryExists(JwFlashClick2.Caption) then
  71.   begin
  72.     FillChar(Opts, SizeOf(Opts), #0);
  73.     Opts.cbSize := SizeOf(Opts);
  74.     Opts.Wnd := Self.Handle;
  75.     Opts.lpVerb := PChar('open');
  76.     Opts.lpFile := PChar(JwFlashClick2.Caption);
  77.     Opts.nShow := SW_SHOWNORMAL;
  78.     ShellExecuteEx(@Opts);
  79.   end;
  80. end;
  81.  
  82. procedure TForm1.JwFlashClick4Click(Sender: TObject);
  83. begin
  84.   Randomize;
  85.   Self.Color := Random( 99999 );
  86.   JwExpLabel1.OverFontColor := Self.Color xor $0000FFFF;
  87. end;
  88.  
  89. procedure TForm1.JwStagePanel1Click(Sender: TObject);
  90. begin
  91.   Self.Color := ( Sender as TPanel ).Color;
  92. end;
  93.  
  94. end.
  95.