home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / TOOLBAR1 / MAIN.PAS < prev    next >
Pascal/Delphi Source File  |  1998-04-13  |  889b  |  48 lines

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, Windows, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     Panel1: TPanel;
  12.     PromptSB: TSpeedButton;
  13.     ExitSB: TSpeedButton;
  14.     CloseBitBtn: TBitBtn;
  15.     Label1: TLabel;
  16.     Bevel1: TBevel;
  17.     procedure ExitSBClick(Sender: TObject);
  18.     procedure FormActivate(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24.  
  25. var
  26.   MainForm: TMainForm;
  27.  
  28. implementation
  29.  
  30. {$R *.DFM}
  31.  
  32. procedure TMainForm.ExitSBClick(Sender: TObject);
  33. begin
  34.   if not PromptSB.Down then
  35.     Close
  36.   else if MessageDlg('Exit program?',mtConfirmation,
  37.     [mbYes, mbNo], 0) = mrYes then
  38.     Close;
  39. end;
  40.  
  41. procedure TMainForm.FormActivate(Sender: TObject);
  42. begin
  43.   ExitSB.Glyph := CloseBitBtn.Glyph;
  44. end;
  45.  
  46. end.
  47.  
  48.