home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue59 / Arch / Sample / UnitFormEntityBase.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-05-29  |  1.2 KB  |  56 lines

  1. unit UnitFormEntityBase;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   UnitCommonTypes, ToolWin, ComCtrls, ActnList, Menus, ImgList, UnitFormBase,
  8.   UnitObjectEntityBase;
  9.  
  10. type
  11.   TFormEntityBase = class(TFormBase)
  12.     StatusBarEntity: TStatusBar;
  13.     ToolBarEntityAbstract: TToolBar;
  14.     ActionListEntity: TActionList;
  15.     ActionSave: TAction;
  16.     PopupMenuEntity: TPopupMenu;
  17.     Save1: TMenuItem;
  18.     ToolButtonSaveAbstract: TToolButton;
  19.     ToolButtonEntityAbstractSeparator: TToolButton;
  20.     procedure ActionSaveExecute(Sender: TObject);
  21.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  22.     procedure ActionSaveUpdate(Sender: TObject);
  23.   private
  24.   protected
  25.   public
  26.   end;
  27.  
  28. implementation
  29.  
  30. {$R *.DFM}
  31.  
  32. { TFormEntityAbstract }
  33.  
  34. procedure TFormEntityBase.ActionSaveExecute(Sender: TObject);
  35. begin
  36.   inherited;
  37.   Save;
  38. end;
  39.  
  40. procedure TFormEntityBase.FormClose(Sender: TObject;
  41.   var Action: TCloseAction);
  42. begin
  43.   inherited;
  44.   Action := caFree;
  45. end;
  46.  
  47. procedure TFormEntityBase.ActionSaveUpdate(Sender: TObject);
  48. var b: boolean;
  49. begin
  50.   inherited;
  51.   b := BusinessObject.UpdatesPending;
  52.   ActionSave.Enabled := b;
  53. end;
  54.  
  55. end.
  56.