home *** CD-ROM | disk | FTP | other *** search
/ PC Open 19 / pcopen19.iso / Zipped / CALMIR21.ZIP / SOURCE.ZIP / SRC / SELECT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-02-20  |  2.9 KB  |  87 lines

  1. {**************************************************************************}
  2. {                                                                          }
  3. {    Calmira shell for Microsoft« Windows(TM) 3.1                          }
  4. {    Source Release 2.1                                                    }
  5. {    Copyright (C) 1997-1998 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.     Label2: TLabel;
  42.     procedure SelectBtnClick(Sender: TObject);
  43.     procedure CloseBtnClick(Sender: TObject);
  44.     procedure FormCreate(Sender: TObject);
  45.   private
  46.     { Private declarations }
  47.     FSelectFiles : TSelectFileEvent;
  48.   public
  49.     { Public declarations }
  50.     property OnSelectFiles : TSelectFileEvent read FSelectFiles write FSelectFiles;
  51.   end;
  52.  
  53. var
  54.   SelectFileDlg: TSelectFileDlg;
  55.  
  56. implementation
  57.  
  58. {$R *.DFM}
  59.  
  60. uses Strings;
  61.  
  62. procedure TSelectFileDlg.SelectBtnClick(Sender: TObject);
  63. var
  64.   s: string;
  65. begin
  66.   if Assigned(FSelectFiles) then begin
  67.     s := Edit.Text;
  68.     repeat
  69.       FSelectFiles(self, GetWord(s, ';'), Sender = SelectBtn);
  70.     until s = '';
  71.   end;
  72. end;
  73.  
  74.  
  75. procedure TSelectFileDlg.CloseBtnClick(Sender: TObject);
  76. begin
  77.   Close;
  78. end;
  79.  
  80.  
  81. procedure TSelectFileDlg.FormCreate(Sender: TObject);
  82. begin
  83.   CloseBtn.Cancel := True;
  84. end;
  85.  
  86. end.
  87.