Changeset 47 for DockManager/Lazarus


Ignore:
Timestamp:
Sep 17, 2010, 12:55:46 PM (14 years ago)
Author:
george
Message:
  • Přidáno: Zkušební podpora pro záložky.
Location:
DockManager/Lazarus
Files:
4 edited

Legend:

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

    r46 r47  
    3232      </Item1>
    3333    </RequiredPackages>
    34     <Units Count="26">
     34    <Units Count="29">
    3535      <Unit0>
    3636        <Filename Value="Demo.lpr"/>
    3737        <IsPartOfProject Value="True"/>
    3838        <UnitName Value="Demo"/>
    39         <EditorIndex Value="1"/>
     39        <EditorIndex Value="2"/>
    4040        <WindowIndex Value="0"/>
    4141        <TopLine Value="1"/>
    42         <CursorPos X="1" Y="19"/>
    43         <UsageCount Value="26"/>
     42        <CursorPos X="7" Y="3"/>
     43        <UsageCount Value="36"/>
    4444        <Loaded Value="True"/>
    4545        <DefaultSyntaxHighlighter Value="Delphi"/>
     
    5353        <EditorIndex Value="0"/>
    5454        <WindowIndex Value="0"/>
    55         <TopLine Value="29"/>
    56         <CursorPos X="18" Y="38"/>
    57         <UsageCount Value="26"/>
     55        <TopLine Value="47"/>
     56        <CursorPos X="26" Y="61"/>
     57        <UsageCount Value="36"/>
    5858        <Loaded Value="True"/>
    5959        <LoadedDesigner Value="True"/>
     
    6363        <Filename Value="E:\Programy\Lazarus\lcl\controls.pp"/>
    6464        <UnitName Value="Controls"/>
    65         <EditorIndex Value="3"/>
    66         <WindowIndex Value="0"/>
    67         <TopLine Value="1773"/>
    68         <CursorPos X="14" Y="1786"/>
    69         <UsageCount Value="13"/>
     65        <EditorIndex Value="7"/>
     66        <WindowIndex Value="0"/>
     67        <TopLine Value="3840"/>
     68        <CursorPos X="1" Y="3853"/>
     69        <UsageCount Value="18"/>
    7070        <Loaded Value="True"/>
    7171      </Unit2>
     
    7676        <TopLine Value="98"/>
    7777        <CursorPos X="27" Y="110"/>
    78         <UsageCount Value="25"/>
     78        <UsageCount Value="24"/>
    7979        <DefaultSyntaxHighlighter Value="Delphi"/>
    8080      </Unit3>
    8181      <Unit4>
    8282        <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    83         <EditorIndex Value="6"/>
    84         <WindowIndex Value="0"/>
    85         <TopLine Value="3825"/>
    86         <CursorPos X="31" Y="3839"/>
    87         <UsageCount Value="12"/>
     83        <EditorIndex Value="10"/>
     84        <WindowIndex Value="0"/>
     85        <TopLine Value="1035"/>
     86        <CursorPos X="1" Y="1048"/>
     87        <UsageCount Value="17"/>
    8888        <Loaded Value="True"/>
    8989      </Unit4>
    9090      <Unit5>
    9191        <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    92         <EditorIndex Value="4"/>
    93         <WindowIndex Value="0"/>
    94         <TopLine Value="7737"/>
    95         <CursorPos X="3" Y="7739"/>
    96         <UsageCount Value="12"/>
     92        <EditorIndex Value="8"/>
     93        <WindowIndex Value="0"/>
     94        <TopLine Value="7631"/>
     95        <CursorPos X="1" Y="7644"/>
     96        <UsageCount Value="17"/>
    9797        <Loaded Value="True"/>
    9898      </Unit5>
     
    103103        <TopLine Value="28"/>
    104104        <CursorPos X="54" Y="32"/>
    105         <UsageCount Value="12"/>
     105        <UsageCount Value="11"/>
    106106      </Unit6>
    107107      <Unit7>
     
    110110        <TopLine Value="113"/>
    111111        <CursorPos X="3" Y="120"/>
    112         <UsageCount Value="12"/>
     112        <UsageCount Value="11"/>
    113113      </Unit7>
    114114      <Unit8>
     
    117117        <TopLine Value="206"/>
    118118        <CursorPos X="8" Y="219"/>
    119         <UsageCount Value="12"/>
     119        <UsageCount Value="11"/>
    120120      </Unit8>
    121121      <Unit9>
     
    125125        <TopLine Value="114"/>
    126126        <CursorPos X="3" Y="127"/>
    127         <UsageCount Value="10"/>
     127        <UsageCount Value="9"/>
    128128      </Unit9>
    129129      <Unit10>
     
    133133        <TopLine Value="180"/>
    134134        <CursorPos X="1" Y="1"/>
    135         <UsageCount Value="10"/>
     135        <UsageCount Value="9"/>
    136136      </Unit10>
    137137      <Unit11>
     
    140140        <TopLine Value="417"/>
    141141        <CursorPos X="60" Y="434"/>
    142         <UsageCount Value="10"/>
     142        <UsageCount Value="9"/>
    143143      </Unit11>
    144144      <Unit12>
     
    147147        <TopLine Value="67"/>
    148148        <CursorPos X="10" Y="80"/>
    149         <UsageCount Value="10"/>
     149        <UsageCount Value="9"/>
    150150      </Unit12>
    151151      <Unit13>
     
    155155        <TopLine Value="280"/>
    156156        <CursorPos X="3" Y="282"/>
    157         <UsageCount Value="12"/>
     157        <UsageCount Value="11"/>
    158158      </Unit13>
    159159      <Unit14>
     
    162162        <TopLine Value="200"/>
    163163        <CursorPos X="3" Y="218"/>
    164         <UsageCount Value="12"/>
     164        <UsageCount Value="11"/>
    165165      </Unit14>
    166166      <Unit15>
     
    171171        <ResourceBaseClass Value="Form"/>
    172172        <UnitName Value="UDockForm"/>
    173         <EditorIndex Value="8"/>
     173        <EditorIndex Value="12"/>
    174174        <WindowIndex Value="0"/>
    175175        <TopLine Value="1"/>
    176176        <CursorPos X="47" Y="8"/>
    177         <UsageCount Value="25"/>
     177        <UsageCount Value="35"/>
    178178        <Loaded Value="True"/>
    179179        <LoadedDesigner Value="True"/>
     
    186186        <TopLine Value="675"/>
    187187        <CursorPos X="24" Y="688"/>
    188         <UsageCount Value="12"/>
     188        <UsageCount Value="11"/>
    189189      </Unit16>
    190190      <Unit17>
     
    194194        <TopLine Value="1092"/>
    195195        <CursorPos X="9" Y="1098"/>
    196         <UsageCount Value="11"/>
     196        <UsageCount Value="10"/>
    197197      </Unit17>
    198198      <Unit18>
    199199        <Filename Value="E:\Projekty jine\Lazarus\examples\anchordocking\anchordocking.pas"/>
    200200        <UnitName Value="AnchorDocking"/>
    201         <EditorIndex Value="7"/>
     201        <EditorIndex Value="11"/>
    202202        <WindowIndex Value="0"/>
    203203        <TopLine Value="4754"/>
    204204        <CursorPos X="5" Y="4763"/>
    205         <UsageCount Value="12"/>
     205        <UsageCount Value="17"/>
    206206        <Loaded Value="True"/>
    207207        <DefaultSyntaxHighlighter Value="Delphi"/>
     
    213213        <TopLine Value="362"/>
    214214        <CursorPos X="21" Y="369"/>
    215         <UsageCount Value="11"/>
     215        <UsageCount Value="10"/>
    216216      </Unit19>
    217217      <Unit20>
     
    220220        <UnitName Value="UCustomDockManager"/>
    221221        <IsVisibleTab Value="True"/>
    222         <EditorIndex Value="2"/>
    223         <WindowIndex Value="0"/>
    224         <TopLine Value="329"/>
    225         <CursorPos X="15" Y="347"/>
    226         <UsageCount Value="21"/>
     222        <EditorIndex Value="3"/>
     223        <WindowIndex Value="0"/>
     224        <TopLine Value="184"/>
     225        <CursorPos X="45" Y="209"/>
     226        <UsageCount Value="31"/>
    227227        <Loaded Value="True"/>
    228228        <DefaultSyntaxHighlighter Value="Delphi"/>
     
    234234        <TopLine Value="1183"/>
    235235        <CursorPos X="9" Y="1183"/>
    236         <UsageCount Value="10"/>
     236        <UsageCount Value="9"/>
    237237      </Unit21>
    238238      <Unit22>
     
    242242        <TopLine Value="479"/>
    243243        <CursorPos X="30" Y="488"/>
    244         <UsageCount Value="10"/>
     244        <UsageCount Value="9"/>
    245245      </Unit22>
    246246      <Unit23>
    247247        <Filename Value="E:\Programy\Lazarus\lcl\include\dragmanager.inc"/>
    248         <WindowIndex Value="0"/>
    249         <TopLine Value="665"/>
    250         <CursorPos X="23" Y="681"/>
    251         <UsageCount Value="10"/>
     248        <EditorIndex Value="5"/>
     249        <WindowIndex Value="0"/>
     250        <TopLine Value="553"/>
     251        <CursorPos X="18" Y="574"/>
     252        <UsageCount Value="13"/>
     253        <Loaded Value="True"/>
    252254      </Unit23>
    253255      <Unit24>
    254256        <Filename Value="E:\Programy\Lazarus\lcl\include\customform.inc"/>
    255257        <WindowIndex Value="0"/>
    256         <TopLine Value="937"/>
    257         <CursorPos X="1" Y="950"/>
    258         <UsageCount Value="10"/>
     258        <TopLine Value="359"/>
     259        <CursorPos X="1" Y="372"/>
     260        <UsageCount Value="9"/>
    259261      </Unit24>
    260262      <Unit25>
    261263        <Filename Value="E:\Programy\Lazarus\lcl\widgetset\wscontrols.pp"/>
    262264        <UnitName Value="WSControls"/>
    263         <EditorIndex Value="5"/>
     265        <EditorIndex Value="9"/>
    264266        <WindowIndex Value="0"/>
    265267        <TopLine Value="267"/>
    266268        <CursorPos X="1" Y="269"/>
    267         <UsageCount Value="10"/>
     269        <UsageCount Value="15"/>
    268270        <Loaded Value="True"/>
    269271      </Unit25>
     272      <Unit26>
     273        <Filename Value="E:\Programy\Lazarus\lcl\comctrls.pp"/>
     274        <UnitName Value="ComCtrls"/>
     275        <EditorIndex Value="1"/>
     276        <WindowIndex Value="0"/>
     277        <TopLine Value="545"/>
     278        <CursorPos X="3" Y="558"/>
     279        <UsageCount Value="15"/>
     280        <Loaded Value="True"/>
     281      </Unit26>
     282      <Unit27>
     283        <Filename Value="E:\Programy\Lazarus\lcl\forms.pp"/>
     284        <UnitName Value="Forms"/>
     285        <EditorIndex Value="6"/>
     286        <WindowIndex Value="0"/>
     287        <TopLine Value="687"/>
     288        <CursorPos X="14" Y="700"/>
     289        <UsageCount Value="14"/>
     290        <Loaded Value="True"/>
     291      </Unit27>
     292      <Unit28>
     293        <Filename Value="E:\Programy\Lazarus\lcl\themes.pas"/>
     294        <UnitName Value="Themes"/>
     295        <EditorIndex Value="4"/>
     296        <WindowIndex Value="0"/>
     297        <TopLine Value="543"/>
     298        <CursorPos X="24" Y="557"/>
     299        <UsageCount Value="11"/>
     300        <Loaded Value="True"/>
     301      </Unit28>
    270302    </Units>
    271     <JumpHistory Count="29" HistoryIndex="28">
     303    <JumpHistory Count="30" HistoryIndex="29">
    272304      <Position1>
    273         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    274         <Caret Line="7679" Column="29" TopLine="7664"/>
     305        <Filename Value="UMainForm.pas"/>
     306        <Caret Line="57" Column="80" TopLine="44"/>
    275307      </Position1>
    276308      <Position2>
    277         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    278         <Caret Line="7703" Column="30" TopLine="7690"/>
     309        <Filename Value="..\UCustomDockManager.pas"/>
     310        <Caret Line="339" Column="62" TopLine="339"/>
    279311      </Position2>
    280312      <Position3>
    281         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    282         <Caret Line="7701" Column="20" TopLine="7690"/>
     313        <Filename Value="UMainForm.pas"/>
     314        <Caret Line="61" Column="39" TopLine="44"/>
    283315      </Position3>
    284316      <Position4>
    285         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    286         <Caret Line="7703" Column="30" TopLine="7690"/>
     317        <Filename Value="..\UCustomDockManager.pas"/>
     318        <Caret Line="381" Column="38" TopLine="368"/>
    287319      </Position4>
    288320      <Position5>
    289         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    290         <Caret Line="7704" Column="19" TopLine="7690"/>
     321        <Filename Value="UMainForm.pas"/>
     322        <Caret Line="60" Column="50" TopLine="44"/>
    291323      </Position5>
    292324      <Position6>
    293         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    294         <Caret Line="140" Column="53" TopLine="133"/>
     325        <Filename Value="UMainForm.pas"/>
     326        <Caret Line="58" Column="38" TopLine="44"/>
    295327      </Position6>
    296328      <Position7>
    297         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    298         <Caret Line="6224" Column="18" TopLine="6211"/>
     329        <Filename Value="UMainForm.pas"/>
     330        <Caret Line="60" Column="47" TopLine="47"/>
    299331      </Position7>
    300332      <Position8>
    301         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    302         <Caret Line="6225" Column="27" TopLine="6211"/>
     333        <Filename Value="..\UCustomDockManager.pas"/>
     334        <Caret Line="416" Column="1" TopLine="399"/>
    303335      </Position8>
    304336      <Position9>
    305         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    306         <Caret Line="6230" Column="36" TopLine="6211"/>
     337        <Filename Value="UMainForm.pas"/>
     338        <Caret Line="60" Column="68" TopLine="47"/>
    307339      </Position9>
    308340      <Position10>
    309         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    310         <Caret Line="6232" Column="18" TopLine="6211"/>
     341        <Filename Value="..\UCustomDockManager.pas"/>
     342        <Caret Line="90" Column="66" TopLine="77"/>
    311343      </Position10>
    312344      <Position11>
    313         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    314         <Caret Line="6233" Column="36" TopLine="6211"/>
     345        <Filename Value="..\UCustomDockManager.pas"/>
     346        <Caret Line="359" Column="1" TopLine="354"/>
    315347      </Position11>
    316348      <Position12>
    317         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    318         <Caret Line="6343" Column="25" TopLine="6330"/>
     349        <Filename Value="..\UCustomDockManager.pas"/>
     350        <Caret Line="360" Column="1" TopLine="354"/>
    319351      </Position12>
    320352      <Position13>
    321         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    322         <Caret Line="6356" Column="27" TopLine="6343"/>
     353        <Filename Value="..\UCustomDockManager.pas"/>
     354        <Caret Line="361" Column="1" TopLine="354"/>
    323355      </Position13>
    324356      <Position14>
    325         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    326         <Caret Line="7677" Column="18" TopLine="7664"/>
     357        <Filename Value="..\UCustomDockManager.pas"/>
     358        <Caret Line="362" Column="1" TopLine="354"/>
    327359      </Position14>
    328360      <Position15>
    329         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    330         <Caret Line="7678" Column="22" TopLine="7664"/>
     361        <Filename Value="..\UCustomDockManager.pas"/>
     362        <Caret Line="363" Column="1" TopLine="354"/>
    331363      </Position15>
    332364      <Position16>
    333         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    334         <Caret Line="7679" Column="29" TopLine="7664"/>
     365        <Filename Value="..\UCustomDockManager.pas"/>
     366        <Caret Line="369" Column="1" TopLine="354"/>
    335367      </Position16>
    336368      <Position17>
    337         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    338         <Caret Line="7703" Column="30" TopLine="7690"/>
     369        <Filename Value="..\UCustomDockManager.pas"/>
     370        <Caret Line="380" Column="1" TopLine="367"/>
    339371      </Position17>
    340372      <Position18>
    341         <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/>
    342         <Caret Line="7704" Column="19" TopLine="7690"/>
     373        <Filename Value="..\UCustomDockManager.pas"/>
     374        <Caret Line="381" Column="1" TopLine="367"/>
    343375      </Position18>
    344376      <Position19>
    345         <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    346         <Caret Line="3980" Column="19" TopLine="3974"/>
     377        <Filename Value="UMainForm.pas"/>
     378        <Caret Line="61" Column="1" TopLine="47"/>
    347379      </Position19>
    348380      <Position20>
    349         <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    350         <Caret Line="5" Column="69" TopLine="1"/>
     381        <Filename Value="UMainForm.pas"/>
     382        <Caret Line="62" Column="1" TopLine="47"/>
    351383      </Position20>
    352384      <Position21>
    353         <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    354         <Caret Line="3819" Column="66" TopLine="3806"/>
     385        <Filename Value="UMainForm.pas"/>
     386        <Caret Line="63" Column="1" TopLine="47"/>
    355387      </Position21>
    356388      <Position22>
    357         <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    358         <Caret Line="3820" Column="37" TopLine="3806"/>
     389        <Filename Value="UMainForm.pas"/>
     390        <Caret Line="64" Column="1" TopLine="47"/>
    359391      </Position22>
    360392      <Position23>
    361         <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    362         <Caret Line="3821" Column="58" TopLine="3806"/>
     393        <Filename Value="UMainForm.pas"/>
     394        <Caret Line="60" Column="64" TopLine="47"/>
    363395      </Position23>
    364396      <Position24>
    365         <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    366         <Caret Line="3822" Column="33" TopLine="3806"/>
     397        <Filename Value="..\UCustomDockManager.pas"/>
     398        <Caret Line="90" Column="62" TopLine="77"/>
    367399      </Position24>
    368400      <Position25>
    369         <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    370         <Caret Line="3838" Column="66" TopLine="3825"/>
     401        <Filename Value="..\UCustomDockManager.pas"/>
     402        <Caret Line="359" Column="1" TopLine="354"/>
    371403      </Position25>
    372404      <Position26>
    373         <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/>
    374         <Caret Line="3839" Column="31" TopLine="3825"/>
     405        <Filename Value="..\UCustomDockManager.pas"/>
     406        <Caret Line="360" Column="1" TopLine="354"/>
    375407      </Position26>
    376408      <Position27>
    377409        <Filename Value="..\UCustomDockManager.pas"/>
    378         <Caret Line="170" Column="37" TopLine="153"/>
     410        <Caret Line="361" Column="1" TopLine="354"/>
    379411      </Position27>
    380412      <Position28>
    381413        <Filename Value="..\UCustomDockManager.pas"/>
    382         <Caret Line="225" Column="7" TopLine="204"/>
     414        <Caret Line="362" Column="1" TopLine="354"/>
    383415      </Position28>
    384416      <Position29>
    385417        <Filename Value="..\UCustomDockManager.pas"/>
    386         <Caret Line="199" Column="1" TopLine="186"/>
     418        <Caret Line="363" Column="1" TopLine="354"/>
    387419      </Position29>
     420      <Position30>
     421        <Filename Value="..\UCustomDockManager.pas"/>
     422        <Caret Line="242" Column="20" TopLine="224"/>
     423      </Position30>
    388424    </JumpHistory>
    389425  </ProjectOptions>
     
    419455  </CompilerOptions>
    420456  <Debugging>
     457    <Watches Count="1">
     458      <Item1>
     459        <Expression Value="TabControl"/>
     460      </Item1>
     461    </Watches>
    421462    <Exceptions Count="3">
    422463      <Item1>
  • DockManager/Lazarus/Demo/UMainForm.lfm

    r46 r47  
    11object MainForm: TMainForm
    2   Left = 462
    3   Height = 240
    4   Top = 108
    5   Width = 320
     2  Left = 311
     3  Height = 435
     4  Top = 91
     5  Width = 576
    66  Caption = 'MainForm'
    7   ClientHeight = 240
    8   ClientWidth = 320
     7  ClientHeight = 435
     8  ClientWidth = 576
    99  OnCreate = FormCreate
    1010  OnDestroy = FormDestroy
     
    2222  object Panel1: TPanel
    2323    Left = 0
    24     Height = 200
     24    Height = 395
    2525    Top = 40
    26     Width = 320
     26    Width = 576
    2727    Align = alBottom
    2828    Anchors = [akTop, akLeft, akRight, akBottom]
     
    3131    TabOrder = 1
    3232  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
     46  end
    3347end
  • DockManager/Lazarus/Demo/UMainForm.pas

    r46 r47  
    1616    Button1: TButton;
    1717    Panel1: TPanel;
     18    TabControl1: TTabControl;
    1819    procedure Button1Click(Sender: TObject);
    1920    procedure FormCreate(Sender: TObject);
     
    4950procedure TMainForm.FormShow(Sender: TObject);
    5051var
    51   DockForm1: TDockForm;
    52   DockForm2: TDockForm;
    53   DockForm3: TDockForm;
     52  ConjoinedDockForm1: TConjoinDockForm;
     53  ConjoinedDockForm2: TConjoinDockForm;
    5454begin
    5555  NewDockForm.ManualDock(Panel1);
    5656  NewDockForm.ManualDock(Panel1, nil, alBottom);
    57   NewDockForm.ManualDock(TForm(DockForms[1]).Parent);
    58   NewDockForm.ManualDock(TForm(DockForms[1]).Parent);
     57  ConjoinedDockForm1 := TCustomDockManager(TForm(DockForms[1]).DockManager).CreateContainer;
     58  ConjoinedDockForm1.Name := 'Model';;
     59  ConjoinedDockForm1.ManualDock(Panel1);
     60  TCustomDockManager(ConjoinedDockForm1.Panel.DockManager).DockStyle := dsTabs;
     61  NewDockForm.ManualDock(ConjoinedDockForm1.Panel);
     62  NewDockForm.ManualDock(ConjoinedDockForm1.Panel);
     63  NewDockForm.ManualDock(TForm(DockForms[0]));
     64  NewDockForm.ManualDock(TForm(DockForms[0]));
     65  NewDockForm.ManualDock(TForm(DockForms[0]));
     66//  TCustomDockManager(TDockForm(DockForms[0]).DockManager).DockStyle := dsTabs;
    5967end;
    6068
  • DockManager/Lazarus/UCustomDockManager.pas

    r46 r47  
    77uses
    88  Classes, SysUtils, Controls, LCLType, LMessages, Graphics, StdCtrls,
    9   Buttons, ExtCtrls, Contnrs, Forms;
     9  Buttons, ExtCtrls, Contnrs, Forms, ComCtrls, Dialogs;
    1010
    1111const
     
    2424  end;
    2525
     26  TDockStyle = (dsList, dsTabs);
     27
    2628  { TDockClientPanel }
    2729
    2830  TDockClientPanel = class(TPanel)
     31  private
     32    FShowHeader: Boolean;
     33    procedure SetShowHeader(const AValue: Boolean);
     34  public
    2935    OwnerDockManager: TCustomDockManager;
    3036    CloseButton: TSpeedButton;
     
    4046    procedure CloseButtonClick(Sender: TObject);
    4147    procedure ResizeExecute(Sender: TObject);
     48    property ShowHeader: Boolean read FShowHeader write SetShowHeader;
    4249  end;
    4350
     
    4653  TCustomDockManager = class(TDockManager)
    4754  private
     55    FDockStyle: TDockStyle;
     56    TabControl: TTabControl;
    4857    FDockDirection: TDockDirection;
    4958    FDockSite: TWinControl;
     
    5261    procedure InsertControlPanel(Control: TControl; InsertAt: TAlign;
    5362      DropCtl: TControl);
     63    procedure SetDockStyle(const AValue: TDockStyle);
     64    procedure UpdateClientSize;
     65    procedure TabControlChange(Sender: TObject);
    5466  public
    5567    constructor Create(ADockSite: TWinControl); override;
     
    7486    procedure SetReplacingControl(Control: TControl); override;
    7587    function AutoFreeByControl: Boolean; override;
     88
     89    function CreateContainer: TConjoinDockForm;
     90    property DockStyle: TDockStyle read FDockStyle write SetDockStyle;
    7691  end;
    7792
     
    96111  FDockSite := ADockSite;
    97112  FDockPanels := TObjectList.Create;
     113  TabControl := TTabControl.Create(FDockSite);
     114  with TabControl do begin
     115    Parent := FDockSite;
     116    Visible := False;
     117    Align := alTop;
     118    Height := 24;
     119    OnChange := TabControlChange;
     120  end;
    98121  inherited Create(ADockSite);
    99122end;
     
    174197      Parent := FDockSite;
    175198      OwnerDockManager := Self;
    176       Visible := True;
     199      if DockStyle = dsList then Visible := True;
    177200      Align := alClient;
     201    end;
     202
     203    if DockStyle = dsTabs then begin
     204      TabControl.Tabs.Add(Control.Name);
     205      TabControlChange(Self);
    178206    end;
    179207    NewPanel.Control := Control;
     
    181209    Control.Align := alClient;
    182210    FDockPanels.Add(NewPanel);
    183 
    184     for I := 0 to FDockPanels.Count - 1 do begin
    185       TDockClientPanel(FDockPanels[I]).Height := FDockSite.Height div
    186         FDockSite.DockClientCount;
    187       TDockClientPanel(FDockPanels[I]).Width := FDockSite.Width div
    188         FDockSite.DockClientCount;
    189     end;
     211    UpdateClientSize;
    190212end;
    191213
     
    198220  I: Integer;
    199221  NewConjoinDockForm: TConjoinDockForm;
     222  NewDockSite: TWinControl;
     223  NewForm: TForm;
    200224begin
    201225  if (FDockSite is TForm) then begin
     
    205229      NewConjoinDockForm.Visible := True;
    206230      NewConjoinDockForm.BoundsRect := FDockSite.BoundsRect;
    207       Control.ManualDock(NewConjoinDockForm.Panel);
    208231      FDockSite.ManualDock(NewConjoinDockForm.Panel);
     232      Control.ManualDock(NewConjoinDockForm.Panel, nil, InsertAt);
    209233    end else begin
    210       Control.ManualDock(FDockSite.Parent);
     234      NewConjoinDockForm := TConjoinDockForm.Create(nil);
     235      NewConjoinDockForm.Visible := True;
     236      NewConjoinDockForm.BoundsRect := FDockSite.BoundsRect;
     237      NewConjoinDockForm.DragMode := dmAutomatic;
     238      NewConjoinDockForm.DragKind := dkDock;
     239      NewDockSite := FDockSite.HostDockSite;
     240//      FDockSite.ManualFloat(FDockSite.BoundsRect);
     241      NewConjoinDockForm.ManualDock(NewDockSite);
     242      FDockSite.ManualDock(NewConjoinDockForm.Panel);
     243      Control.ManualDock(NewConjoinDockForm.Panel, nil, InsertAt);
    211244    end;
    212245  end else
     
    282315    if FDockSite.DockClientCount = 2 then FDockDirection := ddNone;
    283316    //FDockSite.Invalidate;
     317    //if (FDockSite is TConjoinDockForm) and (FDockSite.DockClientCount = 1) then
     318    //  FDockSite.Free;
    284319  end;
    285320end;
     
    307342end;
    308343
     344function TCustomDockManager.CreateContainer: TConjoinDockForm;
     345var
     346  NewDockSite: TWinControl;
     347  NewConjoinDockForm: TConjoinDockForm;
     348begin
     349  NewConjoinDockForm := TConjoinDockForm.Create(nil);
     350  NewConjoinDockForm.Visible := True;
     351  NewConjoinDockForm.BoundsRect := FDockSite.BoundsRect;
     352  NewConjoinDockForm.DragMode := dmAutomatic;
     353  NewConjoinDockForm.DragKind := dkDock;
     354  NewDockSite := FDockSite.HostDockSite;
     355  //      FDockSite.ManualFloat(FDockSite.BoundsRect);
     356  NewConjoinDockForm.ManualDock(NewDockSite);
     357  Result := NewConjoinDockForm;
     358end;
     359
     360procedure TCustomDockManager.SetDockStyle(const AValue: TDockStyle);
     361var
     362  I: Integer;
     363begin
     364  FDockStyle := AValue;
     365  if AValue = dsTabs then begin
     366    TabControl.Visible := True;
     367    TabControl.Tabs.Clear;
     368    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;
     371      TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := False;
     372      TDockClientPanel(FDockPanels[I]).Visible := False;
     373    end;
     374    TabControlChange(Self);
     375  end else
     376  if AValue = dsList then begin
     377    TabControl.Visible := False;
     378    TabControl.Tabs.Clear;
     379    for I := 0 to FDockPanels.Count - 1 do begin
     380      TDockClientPanel(FDockPanels[I]).Splitter.Visible := True;
     381      TDockClientPanel(FDockPanels[I]).Visible := True;
     382      TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Parent := TDockClientPanel(FDockPanels[I]);
     383    end;
     384  end;
     385  UpdateClientSize;
     386end;
     387
     388procedure TCustomDockManager.UpdateClientSize;
     389var
     390  I: Integer;
     391begin
     392  if DockStyle = dsList then begin
     393    for I := 0 to FDockPanels.Count - 1 do begin
     394      TDockClientPanel(FDockPanels[I]).Height := FDockSite.Height div
     395        FDockSite.DockClientCount;
     396      TDockClientPanel(FDockPanels[I]).Width := FDockSite.Width div
     397        FDockSite.DockClientCount;
     398      //TDockClientPanel(FDockPanels[I]).DockPanelPaint(Self);
     399    end;
     400  end else
     401  if DockStyle = dsTabs then begin
     402    for I := 0 to FDockPanels.Count - 1 do begin
     403      TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Width := FDockSite.Width;
     404      TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Height := FDockSite.Height - TabControl.Height;
     405      //TDockClientPanel(FDockPanels[I]).DockPanelPaint(Self);
     406    end;
     407  end;
     408end;
     409
     410procedure TCustomDockManager.TabControlChange(Sender: TObject);
     411var
     412  I: Integer;
     413begin
     414  for I := 0 to FDockPanels.Count - 1 do begin
     415    TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := False;
     416  end;
     417  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;
     420//  TDockClientPanel(FDockPanels[TabControl.TabIndex]).Visible := True;
     421  end;
     422end;
     423
    309424{ TDockClientPanel }
     425
     426procedure TDockClientPanel.SetShowHeader(const AValue: Boolean);
     427begin
     428  if FShowHeader=AValue then exit;
     429  FShowHeader := AValue;
     430  DockPanelPaint(Self);
     431end;
    310432
    311433constructor TDockClientPanel.Create(TheOwner: TComponent);
     
    319441    Width := 14;
    320442    Height := 14;
    321     Visible := True;
     443    Visible := False;
    322444    OnClick := CloseButtonClick;
    323445  end;
     
    331453    Top := GrabberSize;
    332454    Width := Self.Width;
    333     Height := Self.Height;
     455    Height := Self.Height - GrabberSize;
    334456    Anchors := [akTop, akBottom, akLeft, akRight];
    335457    BevelInner := bvNone;
    336458    BevelOuter := bvNone;
     459    //Color := clGreen;
    337460  end;
    338461  OnPaint := DockPanelPaint;
     
    341464  BevelInner := bvNone;
    342465  BevelOuter := bvNone;
     466  ShowHeader := True;
    343467end;
    344468
     
    386510  R: TRect;
    387511begin
    388   R := Control.ClientRect;
    389   Canvas.FillRect(R);
    390   DrawGrabber(Canvas, Control);
     512  if Assigned(Control) then begin
     513    R := Control.ClientRect;
     514    Canvas.FillRect(R);
     515    CloseButton.Visible := ShowHeader;
     516    if ShowHeader then begin
     517      if ClientAreaPanel.DockClientCount = 0 then
     518        DrawGrabber(Canvas, Control) else
     519      DrawGrabber(Canvas, ClientAreaPanel);
     520    end;
     521  end;
    391522end;
    392523
     
    394525  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    395526begin
    396   if (Button=mbLeft) then begin
     527  if Control is TForm then begin
     528    TForm(Control).SetFocus;
     529    DockPanelPaint(Self);
     530  end;
     531  if (Button = mbLeft) then begin
    397532    DragManager.DragStart(Control, False, 1);
    398533  end;
Note: See TracChangeset for help on using the changeset viewer.