home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 11
/
Freelog011.iso
/
BestOf
/
PhoenixMail
/
Source
/
phoenix
/
FMEditAdr.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-02-05
|
4KB
|
127 lines
{*****************************************************************************
*
* FMEditAdr.pas - Edit Address Form (20-August-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 FMEditAdr;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, ComboBoxEx, LangSup, ComCtrls, PXStuff;
type
TEditAdrForm = class(TForm)
Button1: TButton;
Button2: TButton;
Panel1: TPanel;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Bevel5: TBevel;
Label16: TLabel;
Panel2: TPanel;
Image1: TImage;
Image2: TImage;
Label11: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
ComboBox1: TComboBoxEx;
Edit5: TEdit;
ComboBoxEx1: TComboBoxEx;
Button3: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
CheckUnique: Boolean;
end;
var
EditAdrForm: TEditAdrForm;
implementation
uses
FMAddress, Main;
{$R *.DFM}
procedure TEditAdrForm.FormCreate(Sender: TObject);
begin
AttachLanguageToForm(Self);
if bOfficeFonts then Font.Name := sOfficeFontName;
ComboBox1.Images := AddressForm.ImageList1;
ComboBoxex1.Images := AddressForm.ImageList1;
ComboBox1.Items.Assign(AddressForm.ComboBox1.Items);
ComboBox1.Values.Assign(AddressForm.ComboBox1.Values);
ComboBox1.ImgIndexes.Assign(AddressForm.ComboBox1.ImgIndexes);
ComboBox1.ItemIndex := 0;
ComboBoxEx1.ItemIndex := 0;
Label16.Caption := Label16.Caption+' ';
Image1.Picture.Bitmap := MainForm.Image5.Picture.Bitmap;
end;
procedure TEditAdrForm.Button1Click(Sender: TObject);
var
S: String;
I: Integer;
begin
if CheckUnique then begin
if ComboBox1.ItemIndex = AddressForm.Combobox1.ItemIndex then
if Edit2.Text <> '' then
for I := 0 to AddressForm.ListView1.Items.Count-1 do
if LowerCase(AddressForm.ListView1.Items[I].SubItems[2]) = LowerCase(Edit2.Text) then begin
if MessageDlg(MainForm.ListBox1.Items[78], mtConfirmation, [mbYes, mbNo], 0) = mrNo then Exit;
Break;
end;
end;
S := Edit1.Text+Edit2.Text+Edit3.Text+Edit4.Text+Edit5.Text;
for I := 1 to Length(S) do
if S[I] in [','] then begin
MessageDlg(MainForm.ListBox1.Items[49], mtWarning, [mbOK], 0);
Exit;
end;
ModalResult := mrOK;
end;
end.