home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 11
/
Freelog011.iso
/
BestOf
/
PhoenixMail
/
Source
/
phoenix
/
FMFolder.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-02-05
|
5KB
|
160 lines
{*****************************************************************************
*
* FMFolder.pas - Folder form (28-July-1998)
*
* Copyright (c) 1998-99 Michael Haller
*
* Author: Michael Haller
* E-mail: michael@discountdrive.com
* Homepage: http://www.discountdrive.com/sunrise
*
* 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;
*
* 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
*
*----------------------------------------------------------------------------
*
* Revision history:
*
* DATE REV DESCRIPTION
* ----------- --- ----------------------------------------------------------
*
*****************************************************************************}
unit FMFolder;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls, PXStuff, FileCtrl, LangSup;
type
TFolderForm = class(TForm)
Panel1: TPanel;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Button1: TButton;
Button2: TButton;
Label16: TLabel;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Bevel1: TBevel;
Edit2: TEdit;
Bevel5: TBevel;
Button3: TButton;
Panel2: TPanel;
Image1: TImage;
Image2: TImage;
Label4: TLabel;
Label20: TLabel;
Label23: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure Button1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
Folder: String;
public
{ Public declarations }
procedure LoadFolderData(Data: PFolderData);
procedure SaveFolderData(var Data: PFolderData);
end;
var
FolderForm: TFolderForm;
implementation
{$R *.DFM}
uses
Main;
procedure TFolderForm.LoadFolderData(Data: PFolderData);
begin
RadioButton1.Checked := True;
Edit1.Text := Data^.Name;
Edit2.Text := Data^.Filter;
RadioButton2.Checked := Data^.Outbox;
RadioButton3.Checked := Data^.Inbox;
Folder := Data^.Path;
CheckBox1Click(Self);
end;
procedure TFolderForm.SaveFolderData(var Data: PFolderData);
begin
Data^.Name := Edit1.Text;
Data^.Filter := Edit2.Text;
Data^.OutBox := RadioButton2.Checked;
Data^.InBox := RadioButton3.Checked;
Data^.Path := GetParentFolder(Folder)+Edit1.Text+'\';
end;
procedure TFolderForm.Button1Click(Sender: TObject);
var
S: String;
I: Integer;
begin
for I := 1 to Length(Edit1.Text) do
if Edit1.Text[I] in ['\','/','<','>',':','?','*','"','|',#19] then begin
MessageDlg(MainForm.ListBox1.Items[44], mtWarning, [mbOK], 0);
Exit;
end;
S := GetParentFolder(Folder)+Edit1.Text+'\';
if LowerCase(Folder) <> LowerCase(S) then
if DirectoryExists(S) then begin
MessageDlg(Format(MainForm.ListBox1.Items[50], [Edit1.Text]), mtWarning, [mbOK], 0);
Exit;
end;
ModalResult := mrOK;
end;
procedure TFolderForm.CheckBox1Click(Sender: TObject);
var
S: String;
begin
S := MainForm.ListBox1.Items[51];
if RadioButton3.Checked then begin
if Edit2.Text = S then Edit2.Text := '';
Edit2.Enabled := True;
Label20.Enabled := True;
Label23.Enabled := True;
end else begin
Edit2.Text := S;
Edit2.Enabled := False;
Label20.Enabled := False;
Label23.Enabled := False;
end;
end;
procedure TFolderForm.FormCreate(Sender: TObject);
begin
AttachLanguageToForm(Self);
if bOfficeFonts then Font.Name := sOfficeFontName;
Label16.Caption := Label16.Caption+' ';
Label2.Caption := Label2.Caption+' ';
Image1.Picture.Bitmap := MainForm.Image5.Picture.Bitmap;
end;
procedure TFolderForm.Button3Click(Sender: TObject);
begin
Application.HelpContext(11);
end;
end.