home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 April A / Pcwk4a98.iso / PROGRAM / DELPHI16 / Calmira / Src / SRC / SELECT.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-15  |  3KB  |  77 lines

  1. {**************************************************************************}
  2. {                                                                          }
  3. {    Calmira shell for Microsoft« Windows(TM) 3.1                          }
  4. {    Source Release 1.0                                                    }
  5. {    Copyright (C) 1997  Li-Hsin Huang                                     }
  6. {                                                                          }
  7. {    This program is free software; you can redistribute it and/or modify  }
  8. {    it under the terms of the GNU General Public License as published by  }
  9. {    the Free Software Foundation; either version 2 of the License, or     }
  10. {    (at your option) any later version.                                   }
  11. {                                                                          }
  12. {    This program is distributed in the hope that it will be useful,       }
  13. {    but WITHOUT ANY WARRANTY; without even the implied warranty of        }
  14. {    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         }
  15. {    GNU General Public License for more details.                          }
  16. {                                                                          }
  17. {    You should have received a copy of the GNU General Public License     }
  18. {    along with this program; if not, write to the Free Software           }
  19. {    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             }
  20. {                                                                          }
  21. {**************************************************************************}
  22.  
  23. unit Select;
  24.  
  25. interface
  26.  
  27. uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
  28.   StdCtrls, ExtCtrls, StylSped;
  29.  
  30. type
  31.   TSelectFileEvent = procedure(Sender : TObject; const FileSpec : string;
  32.     select : Boolean) of object;
  33.  
  34.   TSelectFileDlg = class(TForm)
  35.     Edit: TEdit;
  36.     Bevel1: TBevel;
  37.     Label1: TLabel;
  38.     SelectBtn: TBitBtn;
  39.     DeselectBtn: TBitBtn;
  40.     CloseBtn: TBitBtn;
  41.     procedure SelectBtnClick(Sender: TObject);
  42.     procedure CloseBtnClick(Sender: TObject);
  43.     procedure FormCreate(Sender: TObject);
  44.   private
  45.     { Private declarations }
  46.     FSelectFiles : TSelectFileEvent;
  47.   public
  48.     { Public declarations }
  49.     property OnSelectFiles : TSelectFileEvent read FSelectFiles write FSelectFiles;
  50.   end;
  51.  
  52. var
  53.   SelectFileDlg: TSelectFileDlg;
  54.  
  55. implementation
  56.  
  57. {$R *.DFM}
  58.  
  59. procedure TSelectFileDlg.SelectBtnClick(Sender: TObject);
  60. begin
  61.   if Assigned(FSelectFiles) then FSelectFiles(self, Edit.Text, Sender = SelectBtn);
  62. end;
  63.  
  64.  
  65. procedure TSelectFileDlg.CloseBtnClick(Sender: TObject);
  66. begin
  67.   Close;
  68. end;
  69.  
  70.  
  71. procedure TSelectFileDlg.FormCreate(Sender: TObject);
  72. begin
  73.   CloseBtn.Cancel := True;
  74. end;
  75.  
  76. end.
  77.