home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 11
/
Freelog011.iso
/
BestOf
/
PhoenixMail
/
Source
/
phoenix
/
FMSelectMail.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-02-05
|
5KB
|
167 lines
{*****************************************************************************
*
* FMSelectMail.pas - Select mails before download (30-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 FMSelectMail;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, ComCtrls, ImgList, EnhListView, ExtListView, Registry,
PXStuff, LangSup, IniFiles;
type
TSelectMailForm = class(TForm)
Button3: TButton;
Button5: TButton;
Button6: TButton;
ImageList1: TImageList;
Button1: TButton;
Notebook1: TNotebook;
ListView1: TExtListView;
Label4: TLabel;
Label7: TLabel;
Label5: TLabel;
Label6: TLabel;
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Label2: TLabel;
Bevel2: TBevel;
Label1: TLabel;
Label8: TLabel;
Label10: TLabel;
Label9: TLabel;
Image5: TImage;
Label11: TLabel;
Bevel3: TBevel;
Label3: TLabel;
procedure ListView1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure ListView1DrawHeader(Control: TWinControl;
var ACanvas: TCanvas; Index: Integer; var ARect: TRect;
Selected: Boolean; var DefaultDrawing: Boolean);
procedure Button1Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
SelectMailForm: TSelectMailForm;
implementation
uses
FMOnline, Main;
{$R *.DFM}
procedure TSelectMailForm.ListView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
Item: TListItem;
I: Integer;
begin
if (X > 0) and (X < 18) then begin
Item := ListView1.GetItemAt(X, Y);
if Assigned(Item) then begin
I := Item.StateIndex;
Inc(I); if I > 3 then I := 0;
Item.StateIndex := I;
end;
end;
end;
procedure TSelectMailForm.FormCreate(Sender: TObject);
var
IniFile: TIniFile;
begin
AttachLanguageToForm(Self);
if bOfficeFonts then Font.Name := sOfficeFontName;
Button1.Caption := Label9.Caption;
//ListView
if MainForm.CheckBox1.Checked then begin
ListView1.AutoSortStyle := assSmart;
end;
IniFile := TIniFile.Create(sSettingsFile);
ListView1.ReadSettingsFromIniFile('NewMailList', IniFile);
IniFile.Free;
//Resources
ImageList1.ResourceLoad(rtBitmap, 'PX501', clFuchsia);
//Size
ListView1.Width := NoteBook1.Width-(ListView1.Left*2);
ListView1.Height := NoteBook1.Height-(ListView1.Top*2)-9;
end;
procedure TSelectMailForm.FormDestroy(Sender: TObject);
var
IniFile: TIniFile;
begin
IniFile := TIniFile.Create(sSettingsFile);
ListView1.WriteSettingsToIniFile('NewMailList', IniFile);
IniFile.Free;
end;
procedure TSelectMailForm.ListView1DrawHeader(Control: TWinControl;
var ACanvas: TCanvas; Index: Integer; var ARect: TRect;
Selected: Boolean; var DefaultDrawing: Boolean);
begin
if Index = 0 then begin
DefaultDrawing := False;
ACanvas.BrushCopy(Rect(ARect.Left+2, ARect.Top, ARect.Left+18, ARect.Top+16), Image5.Picture.Bitmap, Rect(0, 0, 16, 16), clFuchsia);
end else
DefaultDrawing := True;
end;
procedure TSelectMailForm.Button1Click(Sender: TObject);
begin
if NoteBook1.ActivePage = 'Legend' then begin
NoteBook1.ActivePage := 'Mails';
Button1.Caption := Label9.Caption;
end else begin
NoteBook1.ActivePage := 'Legend';
Button1.Caption := Label10.Caption;
end;
end;
procedure TSelectMailForm.Button6Click(Sender: TObject);
begin
Application.HelpContext(5);
end;
end.