home *** CD-ROM | disk | FTP | other *** search
/ Freelog 11 / Freelog011.iso / BestOf / PhoenixMail / Source / phoenix / FMTips.pas < prev    next >
Pascal/Delphi Source File  |  1999-02-05  |  3KB  |  103 lines

  1. {*****************************************************************************
  2.  *
  3.  *  FMTips.pas - Tip of the day form  (17-August-1998)
  4.  *
  5.  *  Copyright (c) 1998-99 Michael Haller
  6.  *
  7.  *  Author:     Michael Haller
  8.  *  E-mail:     michael@discountdrive.com
  9.  *  Homepage:   http://www.discountdrive.com/sunrise
  10.  *
  11.  *  This program is free software; you can redistribute it and/or
  12.  *  modify it under the terms of the GNU General Public License
  13.  *  as published by the Free Software Foundation;
  14.  *
  15.  *  This program is distributed in the hope that it will be useful,
  16.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  *  GNU General Public License for more details.
  19.  *
  20.  *  You should have received a copy of the GNU General Public License
  21.  *  along with this program; if not, write to the Free Software
  22.  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  23.  *
  24.  *----------------------------------------------------------------------------
  25.  *
  26.  *  Revision history:
  27.  *
  28.  *     DATE     REV                 DESCRIPTION
  29.  *  ----------- --- ----------------------------------------------------------
  30.  *
  31.  *****************************************************************************}
  32.  
  33. unit FMTips;
  34.  
  35. interface
  36.  
  37. uses
  38.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  39.   PXStuff, StdCtrls, ExtCtrls, LangSup;
  40.  
  41. type
  42.   TTipsForm = class(TForm)
  43.     Button1: TButton;
  44.     CheckBox1: TCheckBox;
  45.     Button2: TButton;
  46.     Panel3: TPanel;
  47.     Image2: TImage;
  48.     Label1: TLabel;
  49.     Label2: TLabel;
  50.     ListBox1: TListBox;
  51.     procedure FormShow(Sender: TObject);
  52.     procedure Button2Click(Sender: TObject);
  53.     procedure CheckBox1Click(Sender: TObject);
  54.     procedure Button1Click(Sender: TObject);
  55.     procedure FormCreate(Sender: TObject);
  56.   private
  57.     { Private declarations }
  58.   public
  59.     { Public declarations }
  60.   end;
  61.  
  62. var
  63.   TipsForm: TTipsForm;
  64.  
  65. implementation
  66.  
  67. {$R *.DFM}
  68.  
  69. procedure TTipsForm.FormShow(Sender: TObject);
  70. begin
  71.   if iActualTip < 0 then iActualTip := 0;
  72.   if iActualTip > ListBox1.Items.Count-1 then iActualTip := ListBox1.Items.Count-1;
  73.   CheckBox1.Checked := bShowTips;
  74.   Label1.Caption := ListBox1.Items[iActualTip];
  75.   Inc(iActualTip);
  76.   if iActualTip = ListBox1.Items.Count then iActualTip := 0;
  77. end;
  78.  
  79. procedure TTipsForm.Button2Click(Sender: TObject);
  80. begin
  81.   Label1.Caption := ListBox1.Items[iActualTip];
  82.   Inc(iActualTip);
  83.   if iActualTip = ListBox1.Items.Count then iActualTip := 0;
  84. end;
  85.  
  86. procedure TTipsForm.CheckBox1Click(Sender: TObject);
  87. begin
  88.   bShowTips := CheckBox1.Checked;
  89. end;
  90.  
  91. procedure TTipsForm.Button1Click(Sender: TObject);
  92. begin
  93.   Close;
  94. end;
  95.  
  96. procedure TTipsForm.FormCreate(Sender: TObject);
  97. begin
  98.   AttachLanguageToForm(Self);
  99.   if bOfficeFonts then Font.Name := sOfficeFontName;
  100. end;
  101.  
  102. end.
  103.