home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / nastroje / RTF2HTML.ZIP / r2hform.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-07-14  |  1.9 KB  |  77 lines

  1. unit r2hform;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, Buttons, FileCtrl, r2hconv;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     DirectoryListBox1: TDirectoryListBox;
  12.     FileListBox1: TFileListBox;
  13.     DriveComboBox1: TDriveComboBox;
  14.     ConvBtn: TBitBtn;
  15.     ExitBtn: TBitBtn;
  16.     procedure DirectoryListBox1Change(Sender: TObject);
  17.     procedure DriveComboBox1Change(Sender: TObject);
  18.     procedure ConvBtnClick(Sender: TObject);
  19.     procedure FileListBox1DblClick(Sender: TObject);
  20.   private
  21.     { Private-Deklarationen }
  22.   public
  23.     { Public-Deklarationen }
  24.   end;
  25.  
  26. var
  27.   Form1: TForm1;
  28.  
  29. implementation
  30.  
  31. {$R *.DFM}
  32.  
  33. procedure TForm1.DirectoryListBox1Change(Sender: TObject);
  34. begin
  35.     FileListBox1.Directory := DirectoryListBox1.Directory;
  36. end;
  37.  
  38. procedure TForm1.DriveComboBox1Change(Sender: TObject);
  39. begin
  40.     DirectoryListBox1.Drive := DriveComboBox1.Drive;
  41.     FileListBox1.Directory := DirectoryListBox1.Directory;
  42. end;
  43.  
  44. procedure TForm1.ConvBtnClick(Sender: TObject);
  45. var
  46.     i : integer;
  47.     dest : string;
  48.  
  49. begin
  50.     i := length(FileListBox1.FileName);
  51.     if i > 0 then
  52.     begin
  53.         dest := Copy(FileListBox1.FileName, 1, i-3) + 'htm';
  54.         Form1.Caption := 'Konvertiere ' + FileListBox1.FileName + '.....';
  55.         r2hconv.rtf2html(FileListBox1.FileName, dest, ['']);
  56.         Form1.Caption := FileListBox1.FileName + ' konvertiert.';
  57.     end;
  58. end;
  59.  
  60. procedure TForm1.FileListBox1DblClick(Sender: TObject);
  61. var
  62.     i : integer;
  63.     dest : string;
  64.  
  65. begin
  66.     i := length(FileListBox1.FileName);
  67.     if i > 0 then
  68.     begin
  69.         dest := Copy(FileListBox1.FileName, 1, i-3) + 'htm';
  70.         Form1.Caption := 'Konvertiere ' + FileListBox1.FileName + '.....';
  71.         r2hconv.rtf2html(FileListBox1.FileName, dest, ['']);
  72.         Form1.Caption := FileListBox1.FileName + ' konvertiert.';
  73.     end;
  74. end;
  75.  
  76. end.
  77.