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

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDockCustomize.pas

    r180 r181  
    77uses
    88  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
    9   ComCtrls, StdCtrls, Spin, UCoolDockLayout;
     9  ComCtrls, StdCtrls, Spin, UCoolDockLayout, UCoolDockCommon;
    1010
    1111type
     
    4545  end;
    4646
     47  { TCoolDockCustomize }
     48
     49  TCoolDockCustomize = class(TCoolDockCustomizeBase)
     50  private
     51    FLayoutList: TCoolDockLayoutList;
     52    Form: TCoolDockCustomizeForm;
     53    procedure SetLayoutList(const AValue: TCoolDockLayoutList);
     54  public
     55    function Execute: Boolean;
     56    constructor Create(AOwner: TComponent); override;
     57    destructor Destroy; override;
     58  published
     59    property LayoutList: TCoolDockLayoutList read FLayoutList write SetLayoutList;
     60  end;
     61
     62
    4763implementation
     64
     65uses
     66  UCoolDocking, UCoolDockClientPanel;
    4867
    4968resourcestring
     
    115134end;
    116135
     136
     137{ TCoolDockCustomize }
     138
     139procedure TCoolDockCustomize.SetLayoutList(const AValue: TCoolDockLayoutList);
     140begin
     141  if FLayoutList=AValue then exit;
     142  FLayoutList:=AValue;
     143end;
     144
     145function TCoolDockCustomize.Execute: Boolean;
     146begin
     147  Form := TCoolDockCustomizeForm.Create(Self);
     148  if Assigned(Master) then begin
     149    Form.SpinEdit1.Value := TCoolDockMaster(Master).DefaultMoveSpeed;
     150    Form.ComboBox1.ItemIndex := Integer(TCoolDockMaster(Master).DefaultTabsPos);
     151    Form.ComboBox2.ItemIndex := Integer(TCoolDockMaster(Master).DefaultHeaderPos);
     152    Form.LayoutList := FLayoutList;
     153  end;
     154  Form.ShowModal;
     155  if Assigned(Master) then begin
     156    TCoolDockMaster(Master).DefaultMoveSpeed := Form.SpinEdit1.Value;
     157    TCoolDockMaster(Master).DefaultTabsPos := THeaderPos(Form.ComboBox1.ItemIndex);
     158    TCoolDockMaster(Master).DefaultHeaderPos := THeaderPos(Form.ComboBox2.ItemIndex);
     159  end;
     160  Form.Free;
     161  Result := True;
     162end;
     163
     164constructor TCoolDockCustomize.Create(AOwner: TComponent);
     165begin
     166  inherited Create(AOwner);
     167end;
     168
     169destructor TCoolDockCustomize.Destroy;
     170begin
     171  Master := nil;
     172  inherited Destroy;
     173end;
     174
     175
    117176initialization
    118177  {$I UCoolDockCustomize.lrs}
Note: See TracChangeset for help on using the changeset viewer.