Ignore:
Timestamp:
Mar 9, 2011, 10:56:47 AM (14 years ago)
Author:
george
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDockCommon.pas

    r180 r181  
    66
    77uses
    8   Classes, SysUtils;
     8  Classes, SysUtils, Forms;
    99
    1010type
    1111  TDockStyle = (dsList, dsTabs, dsPopupTabs, dsPopupList);
    1212
     13  TCoolDockMasterBase = class;
     14
     15
     16  TCoolDockConjoinFormBase = class(TForm)
     17    constructor Create(TheOwner: TComponent); override;
     18  end;
     19
     20  TCoolDockCustomizeBase = class(TComponent)
     21  private
     22    FMaster: TCoolDockMasterBase;
     23    procedure SetMaster(const AValue: TCoolDockMasterBase);
     24  published
     25    property Master: TCoolDockMasterBase read FMaster write SetMaster;
     26  end;
     27
     28  TCoolDockMasterBase = class(TComponent)
     29  private
     30    FCoolDockCustomize: TCoolDockCustomizeBase;
     31    procedure SetCustomize(const AValue: TCoolDockCustomizeBase);
     32  published
     33    property Customize: TCoolDockCustomizeBase read FCoolDockCustomize
     34      write SetCustomize;
     35  end;
    1336
    1437implementation
    1538
     39{ TCoolDockConjoinFormBase }
     40
     41constructor TCoolDockConjoinFormBase.Create(TheOwner: TComponent);
     42begin
     43  inherited Create(TheOwner);
     44end;
     45
     46procedure TCoolDockCustomizeBase.SetMaster(const AValue: TCoolDockMasterBase);
     47var
     48  OldMaster: TCoolDockMasterBase;
     49begin
     50  if FMaster = AValue then Exit;
     51  OldMaster := FMaster;
     52  FMaster := AValue;
     53  if Assigned(AValue) then begin
     54    FMaster.Customize := Self;
     55  end else begin
     56    OldMaster.Customize := nil;
     57  end;
     58end;
     59
     60procedure TCoolDockMasterBase.SetCustomize(const AValue: TCoolDockCustomizeBase
     61  );
     62var
     63  OldCustomize: TCoolDockCustomizeBase;
     64begin
     65  if FCoolDockCustomize = AValue then Exit;
     66  OldCustomize := FCoolDockCustomize;
     67  FCoolDockCustomize := AValue;
     68  if Assigned(AValue) then begin
     69    FCoolDockCustomize.Master := Self;
     70  end else begin
     71    OldCustomize.Master := nil;
     72  end;
     73end;
     74
     75
    1676end.
    1777
Note: See TracChangeset for help on using the changeset viewer.