{DivFix is a utility for reindexing partial DivX AVI movies
Copyright (C) 2000-2003  Csaba Budai

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA}

unit DirRequester;
{$DEFINE WINDOWS}

interface

uses
	SysUtils, Classes,
{$IFDEF WINDOWS}
  Windows, Messages, Graphics, Controls, Forms, Dialogs, StdCtrls, FileCtrl;
{$ELSE}
  QGraphics, QControls, QForms, QDialogs, QStdCtrls, QComCtrls, QFileCtrls;
{$ENDIF}


type
  TForm4 = class(TForm)
    Button1: TButton;
    Button2: TButton;
{$IFDEF WINDOWS}
    DriveComboBox1: TDriveComboBox;
    DirectoryListBox1: TDirectoryListBox;
{$ELSE}
    DirectoryTreeView1: TDirectoryTreeView;
{$ENDIF}
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
{$IFNDEF WINDOWS}
    procedure FormShow(Sender: TObject);
{$ENDIF}
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

uses DivX;

{$IFDEF WINDOWS}
{$R *.DFM}
{$ELSE}
{$R *.dfm}
{$ENDIF}

procedure TForm4.Button1Click(Sender: TObject);
begin
{$IFDEF WINDOWS}
	If Copy(DirectoryListBox1.Directory,Length(DirectoryListBox1.Directory),1)='\' Then
  Form1.MaskEdit2.Text:=DirectoryListBox1.Directory
  Else Form1.MaskEdit2.Text:=DirectoryListBox1.Directory+'\';
{$ELSE}
	If Copy(DirectoryTreeView1.Directory,Length(DirectoryTreeView1.Directory),1)='/' Then
  Form1.MaskEdit2.Text:=DirectoryTreeView1.Directory
  Else Form1.MaskEdit2.Text:=DirectoryTreeView1.Directory+'/';
{$ENDIF}
  Form1.Enabled:=True;
  Form4.Close;
end;

procedure TForm4.Button2Click(Sender: TObject);
begin
  Form1.Enabled:=True;
  Form4.Close;
end;

procedure TForm4.FormClose(Sender: TObject; var Action: TCloseAction);
begin
	Form1.Enabled:=True;
end;

{$IFNDEF WINDOWS}
procedure TForm4.FormShow(Sender: TObject);
begin
	DirectoryTreeView1.Directory:=Form1.MaskEdit2.Text;
end;
{$ENDIF}


end.
