Changeset 48


Ignore:
Timestamp:
Sep 17, 2010, 3:34:31 PM (14 years ago)
Author:
george
Message:
  • Přidáno: Balíček Lazarusu pro snadnější instalaci. Součástí je také komponenta globálního správce ukotvení.
  • Přidáno: Kontextové menu pro doplňující volby ukotvení oken. Nyní možnost přepínat mezi zobrazením seznamu a záložek.
Location:
DockManager/Lazarus
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • DockManager/Lazarus

    • Property svn:ignore set to
      lib
  • DockManager/Lazarus/Demo/Demo.lpi

    r47 r48  
    2727      </local>
    2828    </RunParams>
    29     <RequiredPackages Count="1">
     29    <RequiredPackages Count="2">
    3030      <Item1>
     31        <PackageName Value="CustomDockManager"/>
     32      </Item1>
     33      <Item2>
    3134        <PackageName Value="LCL"/>
    32       </Item1>
     35      </Item2>
    3336    </RequiredPackages>
    34     <Units Count="29">
     37    <Units Count="31">
    3538      <Unit0>
    3639        <Filename Value="Demo.lpr"/>
    3740        <IsPartOfProject Value="True"/>
    3841        <UnitName Value="Demo"/>
    39         <EditorIndex Value="2"/>
     42        <EditorIndex Value="4"/>
    4043        <WindowIndex Value="0"/>
    4144        <TopLine Value="1"/>
    4245        <CursorPos X="7" Y="3"/>
    43         <UsageCount Value="36"/>
     46        <UsageCount Value="37"/>
    4447        <Loaded Value="True"/>
    4548        <DefaultSyntaxHighlighter Value="Delphi"/>
     
    5356        <EditorIndex Value="0"/>
    5457        <WindowIndex Value="0"/>
    55         <TopLine Value="47"/>
    56         <CursorPos X="26" Y="61"/>
    57         <UsageCount Value="36"/>
     58        <TopLine Value="1"/>
     59        <CursorPos X="20" Y="17"/>
     60        <UsageCount Value="37"/>
    5861        <Loaded Value="True"/>
    5962        <LoadedDesigner Value="True"/>
     
    6366        <Filename Value="E:\Programy\Lazarus\lcl\controls.pp"/>
    6467        <UnitName Value="Controls"/>
    65         <EditorIndex Value="7"/>
     68        <EditorIndex Value="9"/>
    6669        <WindowIndex Value="0"/>
    6770        <TopLine Value="3840"/>
     
    8184      <Unit4>
    8285        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    83         <EditorIndex Value="10"/>
     86        <EditorIndex Value="12"/>
    8487        <WindowIndex Value="0"/>
    8588        <TopLine Value="1035"/>
     
    9093      <Unit5>
    9194        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    92         <EditorIndex Value="8"/>
     95        <EditorIndex Value="10"/>
    9396        <WindowIndex Value="0"/>
    9497        <TopLine Value="7631"/>
     
    171174        <ResourceBaseClass Value="Form"/>
    172175        <UnitName Value="UDockForm"/>
    173         <EditorIndex Value="12"/>
     176        <EditorIndex Value="14"/>
    174177        <WindowIndex Value="0"/>
    175178        <TopLine Value="1"/>
    176179        <CursorPos X="47" Y="8"/>
    177         <UsageCount Value="35"/>
     180        <UsageCount Value="36"/>
    178181        <Loaded Value="True"/>
    179182        <LoadedDesigner Value="True"/>
     
    199202        <Filename Value="E:\Projekty jine\Lazarus\examples\anchordocking\anchordocking.pas"/>
    200203        <UnitName Value="AnchorDocking"/>
    201         <EditorIndex Value="11"/>
     204        <EditorIndex Value="13"/>
    202205        <WindowIndex Value="0"/>
    203206        <TopLine Value="4754"/>
     
    217220      <Unit20>
    218221        <Filename Value="..\UCustomDockManager.pas"/>
    219         <IsPartOfProject Value="True"/>
    220222        <UnitName Value="UCustomDockManager"/>
    221223        <IsVisibleTab Value="True"/>
    222         <EditorIndex Value="3"/>
    223         <WindowIndex Value="0"/>
    224         <TopLine Value="184"/>
    225         <CursorPos X="45" Y="209"/>
     224        <EditorIndex Value="1"/>
     225        <WindowIndex Value="0"/>
     226        <TopLine Value="1"/>
     227        <CursorPos X="39" Y="19"/>
    226228        <UsageCount Value="31"/>
    227229        <Loaded Value="True"/>
     
    231233        <Filename Value="E:\Programy\Lazarus\lcl\extctrls.pp"/>
    232234        <UnitName Value="ExtCtrls"/>
     235        <EditorIndex Value="2"/>
    233236        <WindowIndex Value="0"/>
    234237        <TopLine Value="1183"/>
    235         <CursorPos X="9" Y="1183"/>
    236         <UsageCount Value="9"/>
     238        <CursorPos X="24" Y="1199"/>
     239        <UsageCount Value="10"/>
     240        <Loaded Value="True"/>
    237241      </Unit21>
    238242      <Unit22>
     
    246250      <Unit23>
    247251        <Filename Value="E:\Programy\Lazarus\lcl\include\dragmanager.inc"/>
    248         <EditorIndex Value="5"/>
     252        <EditorIndex Value="7"/>
    249253        <WindowIndex Value="0"/>
    250254        <TopLine Value="553"/>
     
    263267        <Filename Value="E:\Programy\Lazarus\lcl\widgetset\wscontrols.pp"/>
    264268        <UnitName Value="WSControls"/>
    265         <EditorIndex Value="9"/>
     269        <EditorIndex Value="11"/>
    266270        <WindowIndex Value="0"/>
    267271        <TopLine Value="267"/>
     
    273277        <Filename Value="E:\Programy\Lazarus\lcl\comctrls.pp"/>
    274278        <UnitName Value="ComCtrls"/>
    275         <EditorIndex Value="1"/>
     279        <EditorIndex Value="3"/>
    276280        <WindowIndex Value="0"/>
    277281        <TopLine Value="545"/>
     
    283287        <Filename Value="E:\Programy\Lazarus\lcl\forms.pp"/>
    284288        <UnitName Value="Forms"/>
    285         <EditorIndex Value="6"/>
     289        <EditorIndex Value="8"/>
    286290        <WindowIndex Value="0"/>
    287291        <TopLine Value="687"/>
     
    293297        <Filename Value="E:\Programy\Lazarus\lcl\themes.pas"/>
    294298        <UnitName Value="Themes"/>
    295         <EditorIndex Value="4"/>
    296         <WindowIndex Value="0"/>
    297         <TopLine Value="543"/>
    298         <CursorPos X="24" Y="557"/>
     299        <EditorIndex Value="5"/>
     300        <WindowIndex Value="0"/>
     301        <TopLine Value="550"/>
     302        <CursorPos X="13" Y="556"/>
    299303        <UsageCount Value="11"/>
    300304        <Loaded Value="True"/>
    301305      </Unit28>
     306      <Unit29>
     307        <Filename Value="E:\Programy\Lazarus\lcl\menus.pp"/>
     308        <UnitName Value="Menus"/>
     309        <WindowIndex Value="0"/>
     310        <TopLine Value="374"/>
     311        <CursorPos X="3" Y="387"/>
     312        <UsageCount Value="10"/>
     313      </Unit29>
     314      <Unit30>
     315        <Filename Value="..\..\..\ExceptionLogger\UExceptionLogger.pas"/>
     316        <UnitName Value="UExceptionLogger"/>
     317        <EditorIndex Value="6"/>
     318        <WindowIndex Value="0"/>
     319        <TopLine Value="34"/>
     320        <CursorPos X="1" Y="56"/>
     321        <UsageCount Value="10"/>
     322        <Loaded Value="True"/>
     323        <DefaultSyntaxHighlighter Value="Delphi"/>
     324      </Unit30>
    302325    </Units>
    303326    <JumpHistory Count="30" HistoryIndex="29">
    304327      <Position1>
    305         <Filename Value="UMainForm.pas"/>
    306         <Caret Line="57" Column="80" TopLine="44"/>
     328        <Filename Value="..\UCustomDockManager.pas"/>
     329        <Caret Line="360" Column="1" TopLine="354"/>
    307330      </Position1>
    308331      <Position2>
    309332        <Filename Value="..\UCustomDockManager.pas"/>
    310         <Caret Line="339" Column="62" TopLine="339"/>
     333        <Caret Line="361" Column="1" TopLine="354"/>
    311334      </Position2>
    312335      <Position3>
    313         <Filename Value="UMainForm.pas"/>
    314         <Caret Line="61" Column="39" TopLine="44"/>
     336        <Filename Value="..\UCustomDockManager.pas"/>
     337        <Caret Line="362" Column="1" TopLine="354"/>
    315338      </Position3>
    316339      <Position4>
    317340        <Filename Value="..\UCustomDockManager.pas"/>
    318         <Caret Line="381" Column="38" TopLine="368"/>
     341        <Caret Line="363" Column="1" TopLine="354"/>
    319342      </Position4>
    320343      <Position5>
    321         <Filename Value="UMainForm.pas"/>
    322         <Caret Line="60" Column="50" TopLine="44"/>
     344        <Filename Value="..\UCustomDockManager.pas"/>
     345        <Caret Line="369" Column="1" TopLine="354"/>
    323346      </Position5>
    324347      <Position6>
    325         <Filename Value="UMainForm.pas"/>
    326         <Caret Line="58" Column="38" TopLine="44"/>
     348        <Filename Value="..\UCustomDockManager.pas"/>
     349        <Caret Line="380" Column="1" TopLine="367"/>
    327350      </Position6>
    328351      <Position7>
    329         <Filename Value="UMainForm.pas"/>
    330         <Caret Line="60" Column="47" TopLine="47"/>
     352        <Filename Value="..\UCustomDockManager.pas"/>
     353        <Caret Line="381" Column="1" TopLine="367"/>
    331354      </Position7>
    332355      <Position8>
    333         <Filename Value="..\UCustomDockManager.pas"/>
    334         <Caret Line="416" Column="1" TopLine="399"/>
     356        <Filename Value="UMainForm.pas"/>
     357        <Caret Line="61" Column="1" TopLine="47"/>
    335358      </Position8>
    336359      <Position9>
    337360        <Filename Value="UMainForm.pas"/>
    338         <Caret Line="60" Column="68" TopLine="47"/>
     361        <Caret Line="62" Column="1" TopLine="47"/>
    339362      </Position9>
    340363      <Position10>
    341         <Filename Value="..\UCustomDockManager.pas"/>
    342         <Caret Line="90" Column="66" TopLine="77"/>
     364        <Filename Value="UMainForm.pas"/>
     365        <Caret Line="63" Column="1" TopLine="47"/>
    343366      </Position10>
    344367      <Position11>
    345         <Filename Value="..\UCustomDockManager.pas"/>
    346         <Caret Line="359" Column="1" TopLine="354"/>
     368        <Filename Value="UMainForm.pas"/>
     369        <Caret Line="64" Column="1" TopLine="47"/>
    347370      </Position11>
    348371      <Position12>
    349         <Filename Value="..\UCustomDockManager.pas"/>
    350         <Caret Line="360" Column="1" TopLine="354"/>
     372        <Filename Value="UMainForm.pas"/>
     373        <Caret Line="60" Column="64" TopLine="47"/>
    351374      </Position12>
    352375      <Position13>
    353376        <Filename Value="..\UCustomDockManager.pas"/>
    354         <Caret Line="361" Column="1" TopLine="354"/>
     377        <Caret Line="90" Column="62" TopLine="77"/>
    355378      </Position13>
    356379      <Position14>
    357380        <Filename Value="..\UCustomDockManager.pas"/>
    358         <Caret Line="362" Column="1" TopLine="354"/>
     381        <Caret Line="359" Column="1" TopLine="354"/>
    359382      </Position14>
    360383      <Position15>
    361384        <Filename Value="..\UCustomDockManager.pas"/>
    362         <Caret Line="363" Column="1" TopLine="354"/>
     385        <Caret Line="360" Column="1" TopLine="354"/>
    363386      </Position15>
    364387      <Position16>
    365388        <Filename Value="..\UCustomDockManager.pas"/>
    366         <Caret Line="369" Column="1" TopLine="354"/>
     389        <Caret Line="361" Column="1" TopLine="354"/>
    367390      </Position16>
    368391      <Position17>
    369392        <Filename Value="..\UCustomDockManager.pas"/>
    370         <Caret Line="380" Column="1" TopLine="367"/>
     393        <Caret Line="362" Column="1" TopLine="354"/>
    371394      </Position17>
    372395      <Position18>
    373396        <Filename Value="..\UCustomDockManager.pas"/>
    374         <Caret Line="381" Column="1" TopLine="367"/>
     397        <Caret Line="363" Column="1" TopLine="354"/>
    375398      </Position18>
    376399      <Position19>
    377         <Filename Value="UMainForm.pas"/>
    378         <Caret Line="61" Column="1" TopLine="47"/>
     400        <Filename Value="..\UCustomDockManager.pas"/>
     401        <Caret Line="242" Column="20" TopLine="224"/>
    379402      </Position19>
    380403      <Position20>
    381404        <Filename Value="UMainForm.pas"/>
    382         <Caret Line="62" Column="1" TopLine="47"/>
     405        <Caret Line="61" Column="26" TopLine="47"/>
    383406      </Position20>
    384407      <Position21>
    385408        <Filename Value="UMainForm.pas"/>
    386         <Caret Line="63" Column="1" TopLine="47"/>
     409        <Caret Line="17" Column="18" TopLine="1"/>
    387410      </Position21>
    388411      <Position22>
    389412        <Filename Value="UMainForm.pas"/>
    390         <Caret Line="64" Column="1" TopLine="47"/>
     413        <Caret Line="18" Column="23" TopLine="1"/>
    391414      </Position22>
    392415      <Position23>
    393416        <Filename Value="UMainForm.pas"/>
    394         <Caret Line="60" Column="64" TopLine="47"/>
     417        <Caret Line="17" Column="20" TopLine="1"/>
    395418      </Position23>
    396419      <Position24>
    397420        <Filename Value="..\UCustomDockManager.pas"/>
    398         <Caret Line="90" Column="62" TopLine="77"/>
     421        <Caret Line="167" Column="44" TopLine="157"/>
    399422      </Position24>
    400423      <Position25>
    401424        <Filename Value="..\UCustomDockManager.pas"/>
    402         <Caret Line="359" Column="1" TopLine="354"/>
     425        <Caret Line="2" Column="52" TopLine="1"/>
    403426      </Position25>
    404427      <Position26>
    405428        <Filename Value="..\UCustomDockManager.pas"/>
    406         <Caret Line="360" Column="1" TopLine="354"/>
     429        <Caret Line="108" Column="5" TopLine="83"/>
    407430      </Position26>
    408431      <Position27>
    409432        <Filename Value="..\UCustomDockManager.pas"/>
    410         <Caret Line="361" Column="1" TopLine="354"/>
     433        <Caret Line="106" Column="45" TopLine="90"/>
    411434      </Position27>
    412435      <Position28>
    413436        <Filename Value="..\UCustomDockManager.pas"/>
    414         <Caret Line="362" Column="1" TopLine="354"/>
     437        <Caret Line="635" Column="1" TopLine="626"/>
    415438      </Position28>
    416439      <Position29>
    417440        <Filename Value="..\UCustomDockManager.pas"/>
    418         <Caret Line="363" Column="1" TopLine="354"/>
     441        <Caret Line="100" Column="40" TopLine="97"/>
    419442      </Position29>
    420443      <Position30>
    421444        <Filename Value="..\UCustomDockManager.pas"/>
    422         <Caret Line="242" Column="20" TopLine="224"/>
     445        <Caret Line="11" Column="72" TopLine="1"/>
    423446      </Position30>
    424447    </JumpHistory>
     
    440463      </SyntaxOptions>
    441464    </Parsing>
     465    <CodeGeneration>
     466      <Checks>
     467        <IOChecks Value="True"/>
     468        <RangeChecks Value="True"/>
     469        <OverflowChecks Value="True"/>
     470        <StackChecks Value="True"/>
     471      </Checks>
     472      <VerifyObjMethodCallValidity Value="True"/>
     473    </CodeGeneration>
    442474    <Linking>
    443475      <Options>
  • DockManager/Lazarus/Demo/Demo.lpr

    r41 r48  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UMainForm, UDockForm, UCustomDockManager
    11   { you can add units after this };
     10  Forms, UMainForm, UDockForm, CustomDockManager;
    1211
    1312{$R *.res}
  • DockManager/Lazarus/Demo/UMainForm.lfm

    r47 r48  
    11object MainForm: TMainForm
    2   Left = 311
     2  Left = 341
    33  Height = 435
    4   Top = 91
     4  Top = 158
    55  Width = 576
    66  Caption = 'MainForm'
     
    2222  object Panel1: TPanel
    2323    Left = 0
    24     Height = 395
    25     Top = 40
     24    Height = 387
     25    Top = 48
    2626    Width = 576
    2727    Align = alBottom
    2828    Anchors = [akTop, akLeft, akRight, akBottom]
    29     BevelOuter = bvNone
    3029    DockSite = True
    3130    TabOrder = 1
    3231  end
    33   object TabControl1: TTabControl
    34     Left = 118
    35     Height = 33
    36     Top = 7
    37     Width = 184
    38     TabIndex = 0
    39     TabOrder = 2
    40     Tabs.Strings = (
    41       'dd'
    42       'ffdfd'
    43       'fdf'
    44     )
    45     TabStop = False
     32  object CustomDockMaster1: TCustomDockMaster
     33    TabsEnabled = False
     34    DefaultHeaderPos = hpAuto
     35    left = 376
     36    top = 24
    4637  end
    4738end
  • DockManager/Lazarus/Demo/UMainForm.pas

    r47 r48  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, ExtCtrls, Buttons, UCustomDockManager, UDockForm;
     9  ComCtrls, ExtCtrls, Buttons, Menus, UCustomDockManager, UDockForm;
    1010
    1111type
     
    1515  TMainForm = class(TForm)
    1616    Button1: TButton;
     17    CustomDockMaster1: TCustomDockMaster;
    1718    Panel1: TPanel;
    18     TabControl1: TTabControl;
    1919    procedure Button1Click(Sender: TObject);
    2020    procedure FormCreate(Sender: TObject);
     
    5454begin
    5555  NewDockForm.ManualDock(Panel1);
    56   NewDockForm.ManualDock(Panel1, nil, alBottom);
    57   ConjoinedDockForm1 := TCustomDockManager(TForm(DockForms[1]).DockManager).CreateContainer;
     56//  NewDockForm.ManualDock(Panel1, nil, a);
     57  ConjoinedDockForm1 := TCustomDockManager(Panel1.DockManager).CreateContainer(alRight);
    5858  ConjoinedDockForm1.Name := 'Model';;
    59   ConjoinedDockForm1.ManualDock(Panel1);
     59  //ConjoinedDockForm1.ManualDock(Panel1);
    6060  TCustomDockManager(ConjoinedDockForm1.Panel.DockManager).DockStyle := dsTabs;
    6161  NewDockForm.ManualDock(ConjoinedDockForm1.Panel);
  • DockManager/Lazarus/UCustomDockManager.pas

    r47 r48  
    22
    33{$mode delphi}{$H+}
     4
     5// Date: 2010-09-17
    46
    57interface
     
    79uses
    810  Classes, SysUtils, Controls, LCLType, LMessages, Graphics, StdCtrls,
    9   Buttons, ExtCtrls, Contnrs, Forms, ComCtrls, Dialogs;
     11  Buttons, ExtCtrls, Contnrs, Forms, ComCtrls, Dialogs, Menus, FileUtil;
    1012
    1113const
    12   GrabberSize = 18;
     14  GrabberSize = 22;
    1315
    1416type
    1517  TDockDirection = (ddNone, ddHorizontal, ddVertical);
     18  THeaderPos = (hpAuto, hpLeft, hpTop, hpRight, hpBottom);
    1619
    1720  TCustomDockManager = class;
     
    5356  TCustomDockManager = class(TDockManager)
    5457  private
     58    PopupMenu1: TPopupMenu;
    5559    FDockStyle: TDockStyle;
    5660    TabControl: TTabControl;
     
    6468    procedure UpdateClientSize;
    6569    procedure TabControlChange(Sender: TObject);
     70    procedure PopupMenuListClick(Sender: TObject);
     71    procedure PopupMenuTabsClick(Sender: TObject);
    6672  public
    6773    constructor Create(ADockSite: TWinControl); override;
     
    8793    function AutoFreeByControl: Boolean; override;
    8894
    89     function CreateContainer: TConjoinDockForm;
     95    function CreateContainer(InsertAt: TAlign): TConjoinDockForm;
    9096    property DockStyle: TDockStyle read FDockStyle write SetDockStyle;
    9197  end;
    9298
     99  { TCustomDockMaster }
     100
     101  TCustomDockMaster = class(TComponent)
     102  private
     103    FDefaultHeaderPos: THeaderPos;
     104    FTabsEnabled: Boolean;
     105    procedure SetTabsEnabled(const AValue: Boolean);
     106  public
     107    procedure SaveLayoutToStream(Stream: TStream);
     108    procedure LoadLayoutFromStream(Stream: TStream);
     109    procedure SaveLayoutToFile(FileName: string);
     110    procedure LoadLayoutFromFile(FileName: string);
     111  published
     112    property TabsEnabled: Boolean read FTabsEnabled write SetTabsEnabled;
     113    property DefaultHeaderPos: THeaderPos read FDefaultHeaderPos
     114      write FDefaultHeaderPos;
     115  end;
     116
     117procedure Register;
     118
    93119implementation
     120
     121procedure Register;
     122begin
     123  RegisterComponents('CustomDocking', [TCustomDockMaster]);
     124end;
     125
    94126
    95127{ TCustomDockManager }
     
    108140
    109141constructor TCustomDockManager.Create(ADockSite: TWinControl);
    110 begin
     142var
     143  NewMenuItem: TMenuItem;
     144begin
     145  inherited Create(ADockSite);
    111146  FDockSite := ADockSite;
    112147  FDockPanels := TObjectList.Create;
     148  PopupMenu1 := TPopupMenu.Create(FDockSite);
     149  NewMenuItem := TMenuItem.Create(PopupMenu1);
     150  NewMenuItem.Caption := 'List';
     151  PopupMenu1.Items.Add(NewMenuItem);
     152  NewMenuItem.OnClick := PopupMenuListClick;
     153  NewMenuItem := TMenuItem.Create(PopupMenu1);
     154  NewMenuItem.Caption := 'Tabs';
     155  NewMenuItem.OnClick := PopupMenuTabsClick;
     156  PopupMenu1.Items.Add(NewMenuItem);
    113157  TabControl := TTabControl.Create(FDockSite);
    114158  with TabControl do begin
     
    118162    Height := 24;
    119163    OnChange := TabControlChange;
    120   end;
    121   inherited Create(ADockSite);
     164    PopupMenu := PopupMenu1;
     165  end;
    122166end;
    123167
     
    156200  DropCtl: TControl);
    157201var
    158   NewSplitter: TSplitter;
    159202  NewPanel: TDockClientPanel;
    160203  I: Integer;
     
    171214    //end;
    172215    if FDockSite.DockClientCount > 1 then begin
    173       NewSplitter := TSplitter.Create(nil);
    174       NewSplitter.Parent := FDockSite;
    175       NewSplitter.Visible := True;
    176       NewSplitter.Color := clRed;
    177       with NewSplitter do
    178       if FDockDirection = ddVertical then begin
    179         Align := alTop;
    180         Top := FDockSite.Height;
    181       end else
    182       if FDockDirection = ddHorizontal then begin
    183         Align := alLeft;
    184         Left := FDockSite.Width;
     216      with TDockClientPanel(FDockPanels.Last).Splitter do begin
     217        Parent := FDockSite;
     218        Visible := True;
     219        if FDockDirection = ddVertical then begin
     220          Align := alTop;
     221          Top := FDockSite.Height;
     222        end else
     223        if FDockDirection = ddHorizontal then begin
     224          Align := alLeft;
     225          Left := FDockSite.Width;
     226        end;
    185227      end;
    186228
     
    194236    NewPanel := TDockClientPanel.Create(nil);
    195237    with NewPanel do begin
    196       Splitter := NewSplitter;
    197238      Parent := FDockSite;
    198239      OwnerDockManager := Self;
    199240      if DockStyle = dsList then Visible := True;
    200241      Align := alClient;
     242      PopupMenu := PopupMenu1;
    201243    end;
    202244
    203245    if DockStyle = dsTabs then begin
    204       TabControl.Tabs.Add(Control.Name);
     246      TabControl.Tabs.Add(Control.Caption);
    205247      TabControlChange(Self);
    206248    end;
     
    342384end;
    343385
    344 function TCustomDockManager.CreateContainer: TConjoinDockForm;
     386function TCustomDockManager.CreateContainer(InsertAt: TAlign): TConjoinDockForm;
    345387var
    346388  NewDockSite: TWinControl;
     
    354396  NewDockSite := FDockSite.HostDockSite;
    355397  //      FDockSite.ManualFloat(FDockSite.BoundsRect);
    356   NewConjoinDockForm.ManualDock(NewDockSite);
     398  NewConjoinDockForm.ManualDock(NewDockSite, nil, InsertAt);
    357399  Result := NewConjoinDockForm;
    358400end;
     
    367409    TabControl.Tabs.Clear;
    368410    for I := 0 to FDockPanels.Count - 1 do begin
    369       TabControl.Tabs.Add(TDockClientPanel(FDockPanels[I]).Control.Name);
    370       TDockClientPanel(FDockPanels[I]).Splitter.Visible := False;
     411      TabControl.Tabs.Add(TDockClientPanel(FDockPanels[I]).Control.Caption);
     412      if Assigned(TDockClientPanel(FDockPanels[I]).Splitter) then
     413        TDockClientPanel(FDockPanels[I]).Splitter.Visible := False;
    371414      TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := False;
    372415      TDockClientPanel(FDockPanels[I]).Visible := False;
     
    378421    TabControl.Tabs.Clear;
    379422    for I := 0 to FDockPanels.Count - 1 do begin
    380       TDockClientPanel(FDockPanels[I]).Splitter.Visible := True;
     423      if Assigned(TDockClientPanel(FDockPanels[I]).Splitter) then
     424        TDockClientPanel(FDockPanels[I]).Splitter.Visible := True;
    381425      TDockClientPanel(FDockPanels[I]).Visible := True;
    382426      TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Parent := TDockClientPanel(FDockPanels[I]);
     427      TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := True;
    383428    end;
    384429  end;
     
    416461  end;
    417462  if (TabControl.TabIndex <> -1) and (FDockPanels.Count > TabControl.TabIndex) then begin
    418     TDockClientPanel(FDockPanels[TabControl.TabIndex]).ClientAreaPanel.Parent := FDockSite;
    419     TDockClientPanel(FDockPanels[TabControl.TabIndex]).ClientAreaPanel.Visible := True;
     463    with TDockClientPanel(FDockPanels[TabControl.TabIndex]).ClientAreaPanel do begin
     464      Parent := FDockSite;
     465      Visible := True;
     466      UpdateClientSize;
     467    end;
    420468//  TDockClientPanel(FDockPanels[TabControl.TabIndex]).Visible := True;
    421469  end;
     470end;
     471
     472procedure TCustomDockManager.PopupMenuTabsClick(Sender: TObject);
     473begin
     474  DockStyle := dsTabs;
     475end;
     476
     477procedure TCustomDockManager.PopupMenuListClick(Sender: TObject);
     478begin
     479  DockStyle := dsList;
    422480end;
    423481
     
    439497    Caption := 'X';
    440498    Font.Size := 6;
    441     Width := 14;
    442     Height := 14;
     499    Width := GrabberSize - 4;
     500    Height := GrabberSize - 4;
    443501    Visible := False;
    444502    OnClick := CloseButtonClick;
     
    459517    //Color := clGreen;
    460518  end;
     519  Splitter := TSplitter.Create(Self);
     520  with Splitter do begin
     521    //Color := clRed;
     522  end;
    461523  OnPaint := DockPanelPaint;
    462524  OnMouseDown := DockPanelMouseDown;
     
    483545      else Font.Style := Font.Style - [fsBold];
    484546    Rectangle(1, 1, AControl.Width - 1, GrabberSize - 1);
    485     TextOut(6, 2, AControl.Caption);
     547    TextOut(6, 4, AControl.Caption);
    486548
    487549    CloseButton.Left := AControl.Width - CloseButton.Width - 2;
     
    526588begin
    527589  if Control is TForm then begin
    528     TForm(Control).SetFocus;
     590    //TForm(Control).SetFocus;
    529591    DockPanelPaint(Self);
    530592  end;
     
    545607    UseDockManager := True;
    546608    Align := alClient;
     609  //  Color := clYellow;
    547610  end;
    548611  DragKind := dkDock;
     
    550613end;
    551614
     615{ TCustomDockMaster }
     616
     617procedure TCustomDockMaster.SetTabsEnabled(const AValue: Boolean);
     618begin
     619  if FTabsEnabled=AValue then exit;
     620  FTabsEnabled:=AValue;
     621end;
     622
     623procedure TCustomDockMaster.SaveLayoutToStream(Stream: TStream);
     624begin
     625
     626end;
     627
     628procedure TCustomDockMaster.LoadLayoutFromStream(Stream: TStream);
     629begin
     630
     631end;
     632
     633procedure TCustomDockMaster.SaveLayoutToFile(FileName: string);
     634var
     635  LayoutFile: TFileStream;
     636begin
     637  if FileExistsUTF8(FileName) then
     638  LayoutFile := TFileStream.Create(FileName, fmOpenReadWrite)
     639  else LayoutFile := TFileStream.Create(FileName, fmCreate);
     640  try
     641    SaveLayoutToStream(LayoutFile);
     642  finally
     643    Free;
     644  end;
     645end;
     646
     647procedure TCustomDockMaster.LoadLayoutFromFile(FileName: string);
     648var
     649  LayoutFile: TFileStream;
     650begin
     651  LayoutFile := TFileStream.Create(FileName, fmOpenRead);
     652  try
     653    LoadLayoutFromStream(LayoutFile);
     654  finally
     655    Free;
     656  end;
     657end;
     658
    552659initialization
    553660  DefaultDockManagerClass := TCustomDockManager;
Note: See TracChangeset for help on using the changeset viewer.