Changeset 46 for DockManager/Lazarus


Ignore:
Timestamp:
Sep 17, 2010, 8:02:32 AM (14 years ago)
Author:
george
Message:
  • Upraveno: Ukotvení do podoken předěláno s využitím panelů.
Location:
DockManager/Lazarus
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • DockManager/Lazarus/Demo/Demo.lpi

    r45 r46  
    3232      </Item1>
    3333    </RequiredPackages>
    34     <Units Count="25">
     34    <Units Count="26">
    3535      <Unit0>
    3636        <Filename Value="Demo.lpr"/>
    3737        <IsPartOfProject Value="True"/>
    3838        <UnitName Value="Demo"/>
     39        <EditorIndex Value="1"/>
    3940        <WindowIndex Value="0"/>
    4041        <TopLine Value="1"/>
    4142        <CursorPos X="1" Y="19"/>
    42         <UsageCount Value="25"/>
     43        <UsageCount Value="26"/>
     44        <Loaded Value="True"/>
    4345        <DefaultSyntaxHighlighter Value="Delphi"/>
    4446      </Unit0>
     
    5153        <EditorIndex Value="0"/>
    5254        <WindowIndex Value="0"/>
    53         <TopLine Value="52"/>
    54         <CursorPos X="48" Y="57"/>
    55         <UsageCount Value="25"/>
     55        <TopLine Value="29"/>
     56        <CursorPos X="18" Y="38"/>
     57        <UsageCount Value="26"/>
    5658        <Loaded Value="True"/>
    5759        <LoadedDesigner Value="True"/>
     
    6163        <Filename Value="E:\Programy\Lazarus\lcl\controls.pp"/>
    6264        <UnitName Value="Controls"/>
    63         <EditorIndex Value="2"/>
    64         <WindowIndex Value="0"/>
    65         <TopLine Value="1242"/>
    66         <CursorPos X="14" Y="1255"/>
    67         <UsageCount Value="12"/>
     65        <EditorIndex Value="3"/>
     66        <WindowIndex Value="0"/>
     67        <TopLine Value="1773"/>
     68        <CursorPos X="14" Y="1786"/>
     69        <UsageCount Value="13"/>
    6870        <Loaded Value="True"/>
    6971      </Unit2>
     
    7981      <Unit4>
    8082        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    81         <WindowIndex Value="0"/>
    82         <TopLine Value="3906"/>
    83         <CursorPos X="1" Y="3927"/>
    84         <UsageCount Value="12"/>
     83        <EditorIndex Value="6"/>
     84        <WindowIndex Value="0"/>
     85        <TopLine Value="3825"/>
     86        <CursorPos X="31" Y="3839"/>
     87        <UsageCount Value="12"/>
     88        <Loaded Value="True"/>
    8589      </Unit4>
    8690      <Unit5>
    8791        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    88         <WindowIndex Value="0"/>
    89         <TopLine Value="7260"/>
    90         <CursorPos X="1" Y="7231"/>
    91         <UsageCount Value="12"/>
     92        <EditorIndex Value="4"/>
     93        <WindowIndex Value="0"/>
     94        <TopLine Value="7737"/>
     95        <CursorPos X="3" Y="7739"/>
     96        <UsageCount Value="12"/>
     97        <Loaded Value="True"/>
    9298      </Unit5>
    9399      <Unit6>
     
    165171        <ResourceBaseClass Value="Form"/>
    166172        <UnitName Value="UDockForm"/>
    167         <EditorIndex Value="4"/>
     173        <EditorIndex Value="8"/>
    168174        <WindowIndex Value="0"/>
    169175        <TopLine Value="1"/>
    170176        <CursorPos X="47" Y="8"/>
    171         <UsageCount Value="24"/>
     177        <UsageCount Value="25"/>
    172178        <Loaded Value="True"/>
    173179        <LoadedDesigner Value="True"/>
     
    193199        <Filename Value="E:\Projekty jine\Lazarus\examples\anchordocking\anchordocking.pas"/>
    194200        <UnitName Value="AnchorDocking"/>
    195         <EditorIndex Value="3"/>
     201        <EditorIndex Value="7"/>
    196202        <WindowIndex Value="0"/>
    197203        <TopLine Value="4754"/>
    198204        <CursorPos X="5" Y="4763"/>
    199         <UsageCount Value="11"/>
     205        <UsageCount Value="12"/>
    200206        <Loaded Value="True"/>
    201207        <DefaultSyntaxHighlighter Value="Delphi"/>
     
    214220        <UnitName Value="UCustomDockManager"/>
    215221        <IsVisibleTab Value="True"/>
    216         <EditorIndex Value="1"/>
    217         <WindowIndex Value="0"/>
    218         <TopLine Value="202"/>
    219         <CursorPos X="1" Y="217"/>
    220         <UsageCount Value="20"/>
     222        <EditorIndex Value="2"/>
     223        <WindowIndex Value="0"/>
     224        <TopLine Value="329"/>
     225        <CursorPos X="15" Y="347"/>
     226        <UsageCount Value="21"/>
    221227        <Loaded Value="True"/>
    222228        <DefaultSyntaxHighlighter Value="Delphi"/>
     
    252258        <UsageCount Value="10"/>
    253259      </Unit24>
     260      <Unit25>
     261        <Filename Value="E:\Programy\Lazarus\lcl\widgetset\wscontrols.pp"/>
     262        <UnitName Value="WSControls"/>
     263        <EditorIndex Value="5"/>
     264        <WindowIndex Value="0"/>
     265        <TopLine Value="267"/>
     266        <CursorPos X="1" Y="269"/>
     267        <UsageCount Value="10"/>
     268        <Loaded Value="True"/>
     269      </Unit25>
    254270    </Units>
    255     <JumpHistory Count="14" HistoryIndex="13">
     271    <JumpHistory Count="29" HistoryIndex="28">
    256272      <Position1>
    257         <Filename Value="..\UCustomDockManager.pas"/>
    258         <Caret Line="129" Column="1" TopLine="116"/>
     273        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     274        <Caret Line="7679" Column="29" TopLine="7664"/>
    259275      </Position1>
    260276      <Position2>
    261         <Filename Value="..\UCustomDockManager.pas"/>
    262         <Caret Line="226" Column="1" TopLine="213"/>
     277        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     278        <Caret Line="7703" Column="30" TopLine="7690"/>
    263279      </Position2>
    264280      <Position3>
    265         <Filename Value="..\UCustomDockManager.pas"/>
    266         <Caret Line="129" Column="1" TopLine="116"/>
     281        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     282        <Caret Line="7701" Column="20" TopLine="7690"/>
    267283      </Position3>
    268284      <Position4>
    269         <Filename Value="UMainForm.pas"/>
    270         <Caret Line="56" Column="1" TopLine="42"/>
     285        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     286        <Caret Line="7703" Column="30" TopLine="7690"/>
    271287      </Position4>
    272288      <Position5>
     289        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     290        <Caret Line="7704" Column="19" TopLine="7690"/>
     291      </Position5>
     292      <Position6>
     293        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     294        <Caret Line="140" Column="53" TopLine="133"/>
     295      </Position6>
     296      <Position7>
     297        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     298        <Caret Line="6224" Column="18" TopLine="6211"/>
     299      </Position7>
     300      <Position8>
     301        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     302        <Caret Line="6225" Column="27" TopLine="6211"/>
     303      </Position8>
     304      <Position9>
     305        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     306        <Caret Line="6230" Column="36" TopLine="6211"/>
     307      </Position9>
     308      <Position10>
     309        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     310        <Caret Line="6232" Column="18" TopLine="6211"/>
     311      </Position10>
     312      <Position11>
     313        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     314        <Caret Line="6233" Column="36" TopLine="6211"/>
     315      </Position11>
     316      <Position12>
     317        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     318        <Caret Line="6343" Column="25" TopLine="6330"/>
     319      </Position12>
     320      <Position13>
     321        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     322        <Caret Line="6356" Column="27" TopLine="6343"/>
     323      </Position13>
     324      <Position14>
     325        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     326        <Caret Line="7677" Column="18" TopLine="7664"/>
     327      </Position14>
     328      <Position15>
     329        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     330        <Caret Line="7678" Column="22" TopLine="7664"/>
     331      </Position15>
     332      <Position16>
     333        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     334        <Caret Line="7679" Column="29" TopLine="7664"/>
     335      </Position16>
     336      <Position17>
     337        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     338        <Caret Line="7703" Column="30" TopLine="7690"/>
     339      </Position17>
     340      <Position18>
     341        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
     342        <Caret Line="7704" Column="19" TopLine="7690"/>
     343      </Position18>
     344      <Position19>
     345        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
     346        <Caret Line="3980" Column="19" TopLine="3974"/>
     347      </Position19>
     348      <Position20>
     349        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
     350        <Caret Line="5" Column="69" TopLine="1"/>
     351      </Position20>
     352      <Position21>
     353        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
     354        <Caret Line="3819" Column="66" TopLine="3806"/>
     355      </Position21>
     356      <Position22>
     357        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
     358        <Caret Line="3820" Column="37" TopLine="3806"/>
     359      </Position22>
     360      <Position23>
     361        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
     362        <Caret Line="3821" Column="58" TopLine="3806"/>
     363      </Position23>
     364      <Position24>
     365        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
     366        <Caret Line="3822" Column="33" TopLine="3806"/>
     367      </Position24>
     368      <Position25>
     369        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
     370        <Caret Line="3838" Column="66" TopLine="3825"/>
     371      </Position25>
     372      <Position26>
     373        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
     374        <Caret Line="3839" Column="31" TopLine="3825"/>
     375      </Position26>
     376      <Position27>
     377        <Filename Value="..\UCustomDockManager.pas"/>
     378        <Caret Line="170" Column="37" TopLine="153"/>
     379      </Position27>
     380      <Position28>
     381        <Filename Value="..\UCustomDockManager.pas"/>
     382        <Caret Line="225" Column="7" TopLine="204"/>
     383      </Position28>
     384      <Position29>
    273385        <Filename Value="..\UCustomDockManager.pas"/>
    274386        <Caret Line="199" Column="1" TopLine="186"/>
    275       </Position5>
    276       <Position6>
    277         <Filename Value="..\UCustomDockManager.pas"/>
    278         <Caret Line="217" Column="20" TopLine="205"/>
    279       </Position6>
    280       <Position7>
    281         <Filename Value="..\UCustomDockManager.pas"/>
    282         <Caret Line="220" Column="1" TopLine="205"/>
    283       </Position7>
    284       <Position8>
    285         <Filename Value="..\UCustomDockManager.pas"/>
    286         <Caret Line="218" Column="1" TopLine="205"/>
    287       </Position8>
    288       <Position9>
    289         <Filename Value="..\UCustomDockManager.pas"/>
    290         <Caret Line="287" Column="1" TopLine="274"/>
    291       </Position9>
    292       <Position10>
    293         <Filename Value="..\UCustomDockManager.pas"/>
    294         <Caret Line="288" Column="1" TopLine="274"/>
    295       </Position10>
    296       <Position11>
    297         <Filename Value="..\UCustomDockManager.pas"/>
    298         <Caret Line="290" Column="1" TopLine="274"/>
    299       </Position11>
    300       <Position12>
    301         <Filename Value="..\UCustomDockManager.pas"/>
    302         <Caret Line="291" Column="1" TopLine="274"/>
    303       </Position12>
    304       <Position13>
    305         <Filename Value="..\UCustomDockManager.pas"/>
    306         <Caret Line="294" Column="1" TopLine="274"/>
    307       </Position13>
    308       <Position14>
    309         <Filename Value="..\UCustomDockManager.pas"/>
    310         <Caret Line="218" Column="1" TopLine="202"/>
    311       </Position14>
     387      </Position29>
    312388    </JumpHistory>
    313389  </ProjectOptions>
  • DockManager/Lazarus/Demo/UMainForm.lfm

    r44 r46  
    88  ClientWidth = 320
    99  OnCreate = FormCreate
     10  OnDestroy = FormDestroy
    1011  OnShow = FormShow
    1112  LCLVersion = '0.9.29'
  • DockManager/Lazarus/Demo/UMainForm.pas

    r44 r46  
    1818    procedure Button1Click(Sender: TObject);
    1919    procedure FormCreate(Sender: TObject);
     20    procedure FormDestroy(Sender: TObject);
    2021    procedure FormShow(Sender: TObject);
    2122  private
     
    2324  public
    2425    FormIndex: Integer;
    25     LastDockForm: TDockForm;
     26    DockForms: TList;
    2627    function NewDockForm: TDockForm;
    2728  end;
     
    3839procedure TMainForm.FormCreate(Sender: TObject);
    3940begin
     41  DockForms := TList.Create;
     42end;
     43
     44procedure TMainForm.FormDestroy(Sender: TObject);
     45begin
     46  DockForms.Free;
    4047end;
    4148
     
    4653  DockForm3: TDockForm;
    4754begin
    48   DockForm1 := NewDockForm;
    49   DockForm1.ManualDock(Panel1);
    50 
    51   DockForm2 := NewDockForm;
    52   DockForm2.ManualDock(Panel1);
    53 
    54   DockForm3 := NewDockForm;
    55   DockForm3.ManualDock(DockForm2);
     55  NewDockForm.ManualDock(Panel1);
     56  NewDockForm.ManualDock(Panel1, nil, alBottom);
     57  NewDockForm.ManualDock(TForm(DockForms[1]).Parent);
     58  NewDockForm.ManualDock(TForm(DockForms[1]).Parent);
    5659end;
    5760
     
    6770  Inc(FormIndex);
    6871  Result.Show;
     72  DockForms.Add(Result);
    6973end;
    7074
  • DockManager/Lazarus/UCustomDockManager.pas

    r45 r46  
    3131    Control: TControl;
    3232    Splitter: TSplitter;
     33    ClientAreaPanel: TPanel;
    3334    constructor Create(TheOwner: TComponent); override;
    3435    destructor Destroy; override;
     
    177178    end;
    178179    NewPanel.Control := Control;
    179     Control.Parent := NewPanel;
     180    Control.Parent := NewPanel.ClientAreaPanel;
     181    Control.Align := alClient;
    180182    FDockPanels.Add(NewPanel);
    181183
     
    202204      NewConjoinDockForm := TConjoinDockForm.Create(nil);
    203205      NewConjoinDockForm.Visible := True;
     206      NewConjoinDockForm.BoundsRect := FDockSite.BoundsRect;
    204207      Control.ManualDock(NewConjoinDockForm.Panel);
    205208      FDockSite.ManualDock(NewConjoinDockForm.Panel);
    206209    end else begin
    207       NewPanel := TPanel.Create(nil);
    208       NewPanel.Parent := FDockSite.Parent;
    209       NewPanel.Visible := True;
    210       NewPanel.Left := FDockSite.Left;
    211       NewPanel.Top := FDockSite.Top;
    212       NewPanel.Width := FDockSite.Width;
    213       NewPanel.Height := FDockSite.Height;
    214       NewPanel.UseDockManager := True;
    215       NewPanel.DockSite := True;
    216       NewPanel.Color := clGreen;
    217       NewPanel.ManualDock(FDockSite.HostDockSite);
    218 //      FDockSite.Parent := nil;
    219       Control.ManualDock(NewPanel);
    220       FDockSite.ManualDock(NewPanel);
     210      Control.ManualDock(FDockSite.Parent);
    221211    end;
    222212  end else
    223   if FDockSite is TPanel then begin
     213  if (FDockSite is TPanel) or (FDockSite is TDockClientPanel) then begin
    224214    InsertControlPanel(Control, InsertAt, DropCtl);
    225215  end;
     
    332322    OnClick := CloseButtonClick;
    333323  end;
     324  ClientAreaPanel := TPanel.Create(Self);
     325  with ClientAreaPanel do begin
     326    Parent := Self;
     327    Visible := True;
     328    DockSite := True;
     329    UseDockManager := True;
     330    Left := 0;
     331    Top := GrabberSize;
     332    Width := Self.Width;
     333    Height := Self.Height;
     334    Anchors := [akTop, akBottom, akLeft, akRight];
     335    BevelInner := bvNone;
     336    BevelOuter := bvNone;
     337  end;
    334338  OnPaint := DockPanelPaint;
    335339  OnMouseDown := DockPanelMouseDown;
Note: See TracChangeset for help on using the changeset viewer.