home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / Cooldemo / Main.pas < prev   
Pascal/Delphi Source File  |  1998-04-23  |  2KB  |  70 lines

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ComCtrls, ToolWin, StdCtrls, Buttons, ImgList;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     CoolBar1: TCoolBar;
  12.     ToolBar1: TToolBar;
  13.     NavigatorImages: TImageList;
  14.     NavigatorHotImages: TImageList;
  15.     DateTimePicker1: TDateTimePicker;
  16.     ToolButton1: TToolButton;
  17.     ToolButton2: TToolButton;
  18.     ToolButton3: TToolButton;
  19.     ToolButton4: TToolButton;
  20.     ToolButton5: TToolButton;
  21.     BitBtn1: TBitBtn;
  22.     BitBtn2: TBitBtn;
  23.     Animate1: TAnimate;
  24.     Button1: TButton;
  25.     procedure BitBtn1Click(Sender: TObject);
  26.     procedure Button1Click(Sender: TObject);
  27.     procedure ToolButton1Click(Sender: TObject);
  28.   private
  29.     { Private declarations }
  30.   public
  31.     { Public declarations }
  32.   end;
  33.  
  34. var
  35.   MainForm: TMainForm;
  36.  
  37. implementation
  38.  
  39. {$R *.DFM}
  40.  
  41. procedure TMainForm.BitBtn1Click(Sender: TObject);
  42. var
  43.   TF: Boolean;  // True or False flag
  44.   S: String;
  45. begin
  46.   TF := ToolButton1.Enabled;
  47.   ToolButton1.Enabled := not TF;
  48.   ToolButton2.Enabled := not TF;
  49.   if TF
  50.     then S := 'Enable'
  51.     else S := 'Disable';
  52.   BitBtn1.Caption := S + ' Back and Forward Buttons';
  53. end;
  54.  
  55. procedure TMainForm.Button1Click(Sender: TObject);
  56. begin
  57.   Animate1.Active := not Animate1.Active;
  58.   if Animate1.Active
  59.     then Button1.Caption := 'Stop Animation'
  60.     else Button1.Caption := 'Begin Animation';
  61. end;
  62.  
  63. procedure TMainForm.ToolButton1Click(Sender: TObject);
  64. begin
  65.   with Sender as TToolButton do
  66.     ShowMessage('Button selected: ' + Caption);
  67. end;
  68.  
  69. end.
  70.