home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 November / PCWorld_2005-11_cd.bin / software / vyzkuste / divfix / DivFix110.exe / Source / DirRequester.pas < prev    next >
Pascal/Delphi Source File  |  2003-03-24  |  3KB  |  102 lines

  1. {DivFix is a utility for reindexing partial DivX AVI movies
  2. Copyright (C) 2000-2003  Csaba Budai
  3.  
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA}
  17.  
  18. unit DirRequester;
  19. {$DEFINE WINDOWS}
  20.  
  21. interface
  22.  
  23. uses
  24.     SysUtils, Classes,
  25. {$IFDEF WINDOWS}
  26.   Windows, Messages, Graphics, Controls, Forms, Dialogs, StdCtrls, FileCtrl;
  27. {$ELSE}
  28.   QGraphics, QControls, QForms, QDialogs, QStdCtrls, QComCtrls, QFileCtrls;
  29. {$ENDIF}
  30.  
  31.  
  32. type
  33.   TForm4 = class(TForm)
  34.     Button1: TButton;
  35.     Button2: TButton;
  36. {$IFDEF WINDOWS}
  37.     DriveComboBox1: TDriveComboBox;
  38.     DirectoryListBox1: TDirectoryListBox;
  39. {$ELSE}
  40.     DirectoryTreeView1: TDirectoryTreeView;
  41. {$ENDIF}
  42.     procedure Button1Click(Sender: TObject);
  43.     procedure Button2Click(Sender: TObject);
  44.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  45. {$IFNDEF WINDOWS}
  46.     procedure FormShow(Sender: TObject);
  47. {$ENDIF}
  48.   private
  49.     { Private declarations }
  50.   public
  51.     { Public declarations }
  52.   end;
  53.  
  54. var
  55.   Form4: TForm4;
  56.  
  57. implementation
  58.  
  59. uses DivX;
  60.  
  61. {$IFDEF WINDOWS}
  62. {$R *.DFM}
  63. {$ELSE}
  64. {$R *.dfm}
  65. {$ENDIF}
  66.  
  67. procedure TForm4.Button1Click(Sender: TObject);
  68. begin
  69. {$IFDEF WINDOWS}
  70.     If Copy(DirectoryListBox1.Directory,Length(DirectoryListBox1.Directory),1)='\' Then
  71.   Form1.MaskEdit2.Text:=DirectoryListBox1.Directory
  72.   Else Form1.MaskEdit2.Text:=DirectoryListBox1.Directory+'\';
  73. {$ELSE}
  74.     If Copy(DirectoryTreeView1.Directory,Length(DirectoryTreeView1.Directory),1)='/' Then
  75.   Form1.MaskEdit2.Text:=DirectoryTreeView1.Directory
  76.   Else Form1.MaskEdit2.Text:=DirectoryTreeView1.Directory+'/';
  77. {$ENDIF}
  78.   Form1.Enabled:=True;
  79.   Form4.Close;
  80. end;
  81.  
  82. procedure TForm4.Button2Click(Sender: TObject);
  83. begin
  84.   Form1.Enabled:=True;
  85.   Form4.Close;
  86. end;
  87.  
  88. procedure TForm4.FormClose(Sender: TObject; var Action: TCloseAction);
  89. begin
  90.     Form1.Enabled:=True;
  91. end;
  92.  
  93. {$IFNDEF WINDOWS}
  94. procedure TForm4.FormShow(Sender: TObject);
  95. begin
  96.     DirectoryTreeView1.Directory:=Form1.MaskEdit2.Text;
  97. end;
  98. {$ENDIF}
  99.  
  100.  
  101. end.
  102.