home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 August / VPR9608A.BIN / del20try / install / data.z / CUSTDATA.PAS < prev    next >
Pascal/Delphi Source File  |  1996-05-08  |  933b  |  46 lines

  1. unit CustData;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Grids, DBGrids;
  8.  
  9. type
  10.   TfmCustomer = class(TForm)
  11.     DBGrid1: TDBGrid;
  12.     procedure FormActivate(Sender: TObject);
  13.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  14.   end;
  15.  
  16. var
  17.   fmCustomer: TfmCustomer;
  18.  
  19. implementation
  20.  
  21. uses DM, Toolbar, CustOrds;
  22.  
  23. {$R *.DFM}
  24.  
  25. procedure TfmCustomer.FormActivate(Sender: TObject);
  26. begin
  27.   { fmToolBar.SetNavigatorToCustomer. }
  28.   fmToolBar.SetNavigator(dm1.CustomerSource);
  29. end;
  30.  
  31. procedure TfmCustomer.FormClose(Sender: TObject; var Action: TCloseAction);
  32. var
  33.  I: Integer;
  34.  bl : Boolean;
  35. begin
  36.   bl := False;
  37.   for I := Application.ComponentCount downto 1 do
  38.     if Application.Components[I] is TfmCustOrd then
  39.       bl := True;
  40.   if not bl then
  41.     fmToolBar.dbNavigator1.Datasource := nil;
  42.   Action := caFree;
  43. end;
  44.  
  45. end.
  46.