Changeset 48 for DockManager/Lazarus
- Timestamp:
- Sep 17, 2010, 3:34:31 PM (14 years ago)
- Location:
- DockManager/Lazarus
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
DockManager/Lazarus
-
Property svn:ignore
set to
lib
-
Property svn:ignore
set to
-
DockManager/Lazarus/Demo/Demo.lpi
r47 r48 27 27 </local> 28 28 </RunParams> 29 <RequiredPackages Count=" 1">29 <RequiredPackages Count="2"> 30 30 <Item1> 31 <PackageName Value="CustomDockManager"/> 32 </Item1> 33 <Item2> 31 34 <PackageName Value="LCL"/> 32 </Item 1>35 </Item2> 33 36 </RequiredPackages> 34 <Units Count=" 29">37 <Units Count="31"> 35 38 <Unit0> 36 39 <Filename Value="Demo.lpr"/> 37 40 <IsPartOfProject Value="True"/> 38 41 <UnitName Value="Demo"/> 39 <EditorIndex Value=" 2"/>42 <EditorIndex Value="4"/> 40 43 <WindowIndex Value="0"/> 41 44 <TopLine Value="1"/> 42 45 <CursorPos X="7" Y="3"/> 43 <UsageCount Value="3 6"/>46 <UsageCount Value="37"/> 44 47 <Loaded Value="True"/> 45 48 <DefaultSyntaxHighlighter Value="Delphi"/> … … 53 56 <EditorIndex Value="0"/> 54 57 <WindowIndex Value="0"/> 55 <TopLine Value=" 47"/>56 <CursorPos X="2 6" Y="61"/>57 <UsageCount Value="3 6"/>58 <TopLine Value="1"/> 59 <CursorPos X="20" Y="17"/> 60 <UsageCount Value="37"/> 58 61 <Loaded Value="True"/> 59 62 <LoadedDesigner Value="True"/> … … 63 66 <Filename Value="E:\Programy\Lazarus\lcl\controls.pp"/> 64 67 <UnitName Value="Controls"/> 65 <EditorIndex Value=" 7"/>68 <EditorIndex Value="9"/> 66 69 <WindowIndex Value="0"/> 67 70 <TopLine Value="3840"/> … … 81 84 <Unit4> 82 85 <Filename Value="E:\Programy\Lazarus\lcl\include\control.inc"/> 83 <EditorIndex Value="1 0"/>86 <EditorIndex Value="12"/> 84 87 <WindowIndex Value="0"/> 85 88 <TopLine Value="1035"/> … … 90 93 <Unit5> 91 94 <Filename Value="E:\Programy\Lazarus\lcl\include\wincontrol.inc"/> 92 <EditorIndex Value=" 8"/>95 <EditorIndex Value="10"/> 93 96 <WindowIndex Value="0"/> 94 97 <TopLine Value="7631"/> … … 171 174 <ResourceBaseClass Value="Form"/> 172 175 <UnitName Value="UDockForm"/> 173 <EditorIndex Value="1 2"/>176 <EditorIndex Value="14"/> 174 177 <WindowIndex Value="0"/> 175 178 <TopLine Value="1"/> 176 179 <CursorPos X="47" Y="8"/> 177 <UsageCount Value="3 5"/>180 <UsageCount Value="36"/> 178 181 <Loaded Value="True"/> 179 182 <LoadedDesigner Value="True"/> … … 199 202 <Filename Value="E:\Projekty jine\Lazarus\examples\anchordocking\anchordocking.pas"/> 200 203 <UnitName Value="AnchorDocking"/> 201 <EditorIndex Value="1 1"/>204 <EditorIndex Value="13"/> 202 205 <WindowIndex Value="0"/> 203 206 <TopLine Value="4754"/> … … 217 220 <Unit20> 218 221 <Filename Value="..\UCustomDockManager.pas"/> 219 <IsPartOfProject Value="True"/>220 222 <UnitName Value="UCustomDockManager"/> 221 223 <IsVisibleTab Value="True"/> 222 <EditorIndex Value=" 3"/>223 <WindowIndex Value="0"/> 224 <TopLine Value="1 84"/>225 <CursorPos X=" 45" Y="209"/>224 <EditorIndex Value="1"/> 225 <WindowIndex Value="0"/> 226 <TopLine Value="1"/> 227 <CursorPos X="39" Y="19"/> 226 228 <UsageCount Value="31"/> 227 229 <Loaded Value="True"/> … … 231 233 <Filename Value="E:\Programy\Lazarus\lcl\extctrls.pp"/> 232 234 <UnitName Value="ExtCtrls"/> 235 <EditorIndex Value="2"/> 233 236 <WindowIndex Value="0"/> 234 237 <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"/> 237 241 </Unit21> 238 242 <Unit22> … … 246 250 <Unit23> 247 251 <Filename Value="E:\Programy\Lazarus\lcl\include\dragmanager.inc"/> 248 <EditorIndex Value=" 5"/>252 <EditorIndex Value="7"/> 249 253 <WindowIndex Value="0"/> 250 254 <TopLine Value="553"/> … … 263 267 <Filename Value="E:\Programy\Lazarus\lcl\widgetset\wscontrols.pp"/> 264 268 <UnitName Value="WSControls"/> 265 <EditorIndex Value=" 9"/>269 <EditorIndex Value="11"/> 266 270 <WindowIndex Value="0"/> 267 271 <TopLine Value="267"/> … … 273 277 <Filename Value="E:\Programy\Lazarus\lcl\comctrls.pp"/> 274 278 <UnitName Value="ComCtrls"/> 275 <EditorIndex Value=" 1"/>279 <EditorIndex Value="3"/> 276 280 <WindowIndex Value="0"/> 277 281 <TopLine Value="545"/> … … 283 287 <Filename Value="E:\Programy\Lazarus\lcl\forms.pp"/> 284 288 <UnitName Value="Forms"/> 285 <EditorIndex Value=" 6"/>289 <EditorIndex Value="8"/> 286 290 <WindowIndex Value="0"/> 287 291 <TopLine Value="687"/> … … 293 297 <Filename Value="E:\Programy\Lazarus\lcl\themes.pas"/> 294 298 <UnitName Value="Themes"/> 295 <EditorIndex Value=" 4"/>296 <WindowIndex Value="0"/> 297 <TopLine Value="5 43"/>298 <CursorPos X=" 24" Y="557"/>299 <EditorIndex Value="5"/> 300 <WindowIndex Value="0"/> 301 <TopLine Value="550"/> 302 <CursorPos X="13" Y="556"/> 299 303 <UsageCount Value="11"/> 300 304 <Loaded Value="True"/> 301 305 </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> 302 325 </Units> 303 326 <JumpHistory Count="30" HistoryIndex="29"> 304 327 <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"/> 307 330 </Position1> 308 331 <Position2> 309 332 <Filename Value="..\UCustomDockManager.pas"/> 310 <Caret Line="3 39" Column="62" TopLine="339"/>333 <Caret Line="361" Column="1" TopLine="354"/> 311 334 </Position2> 312 335 <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"/> 315 338 </Position3> 316 339 <Position4> 317 340 <Filename Value="..\UCustomDockManager.pas"/> 318 <Caret Line="3 81" Column="38" TopLine="368"/>341 <Caret Line="363" Column="1" TopLine="354"/> 319 342 </Position4> 320 343 <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"/> 323 346 </Position5> 324 347 <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"/> 327 350 </Position6> 328 351 <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"/> 331 354 </Position7> 332 355 <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"/> 335 358 </Position8> 336 359 <Position9> 337 360 <Filename Value="UMainForm.pas"/> 338 <Caret Line="6 0" Column="68" TopLine="47"/>361 <Caret Line="62" Column="1" TopLine="47"/> 339 362 </Position9> 340 363 <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"/> 343 366 </Position10> 344 367 <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"/> 347 370 </Position11> 348 371 <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"/> 351 374 </Position12> 352 375 <Position13> 353 376 <Filename Value="..\UCustomDockManager.pas"/> 354 <Caret Line=" 361" Column="1" TopLine="354"/>377 <Caret Line="90" Column="62" TopLine="77"/> 355 378 </Position13> 356 379 <Position14> 357 380 <Filename Value="..\UCustomDockManager.pas"/> 358 <Caret Line="3 62" Column="1" TopLine="354"/>381 <Caret Line="359" Column="1" TopLine="354"/> 359 382 </Position14> 360 383 <Position15> 361 384 <Filename Value="..\UCustomDockManager.pas"/> 362 <Caret Line="36 3" Column="1" TopLine="354"/>385 <Caret Line="360" Column="1" TopLine="354"/> 363 386 </Position15> 364 387 <Position16> 365 388 <Filename Value="..\UCustomDockManager.pas"/> 366 <Caret Line="36 9" Column="1" TopLine="354"/>389 <Caret Line="361" Column="1" TopLine="354"/> 367 390 </Position16> 368 391 <Position17> 369 392 <Filename Value="..\UCustomDockManager.pas"/> 370 <Caret Line="3 80" Column="1" TopLine="367"/>393 <Caret Line="362" Column="1" TopLine="354"/> 371 394 </Position17> 372 395 <Position18> 373 396 <Filename Value="..\UCustomDockManager.pas"/> 374 <Caret Line="3 81" Column="1" TopLine="367"/>397 <Caret Line="363" Column="1" TopLine="354"/> 375 398 </Position18> 376 399 <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"/> 379 402 </Position19> 380 403 <Position20> 381 404 <Filename Value="UMainForm.pas"/> 382 <Caret Line="6 2" Column="1" TopLine="47"/>405 <Caret Line="61" Column="26" TopLine="47"/> 383 406 </Position20> 384 407 <Position21> 385 408 <Filename Value="UMainForm.pas"/> 386 <Caret Line=" 63" Column="1" TopLine="47"/>409 <Caret Line="17" Column="18" TopLine="1"/> 387 410 </Position21> 388 411 <Position22> 389 412 <Filename Value="UMainForm.pas"/> 390 <Caret Line=" 64" Column="1" TopLine="47"/>413 <Caret Line="18" Column="23" TopLine="1"/> 391 414 </Position22> 392 415 <Position23> 393 416 <Filename Value="UMainForm.pas"/> 394 <Caret Line=" 60" Column="64" TopLine="47"/>417 <Caret Line="17" Column="20" TopLine="1"/> 395 418 </Position23> 396 419 <Position24> 397 420 <Filename Value="..\UCustomDockManager.pas"/> 398 <Caret Line=" 90" Column="62" TopLine="77"/>421 <Caret Line="167" Column="44" TopLine="157"/> 399 422 </Position24> 400 423 <Position25> 401 424 <Filename Value="..\UCustomDockManager.pas"/> 402 <Caret Line=" 359" Column="1" TopLine="354"/>425 <Caret Line="2" Column="52" TopLine="1"/> 403 426 </Position25> 404 427 <Position26> 405 428 <Filename Value="..\UCustomDockManager.pas"/> 406 <Caret Line=" 360" Column="1" TopLine="354"/>429 <Caret Line="108" Column="5" TopLine="83"/> 407 430 </Position26> 408 431 <Position27> 409 432 <Filename Value="..\UCustomDockManager.pas"/> 410 <Caret Line=" 361" Column="1" TopLine="354"/>433 <Caret Line="106" Column="45" TopLine="90"/> 411 434 </Position27> 412 435 <Position28> 413 436 <Filename Value="..\UCustomDockManager.pas"/> 414 <Caret Line=" 362" Column="1" TopLine="354"/>437 <Caret Line="635" Column="1" TopLine="626"/> 415 438 </Position28> 416 439 <Position29> 417 440 <Filename Value="..\UCustomDockManager.pas"/> 418 <Caret Line=" 363" Column="1" TopLine="354"/>441 <Caret Line="100" Column="40" TopLine="97"/> 419 442 </Position29> 420 443 <Position30> 421 444 <Filename Value="..\UCustomDockManager.pas"/> 422 <Caret Line=" 242" Column="20" TopLine="224"/>445 <Caret Line="11" Column="72" TopLine="1"/> 423 446 </Position30> 424 447 </JumpHistory> … … 440 463 </SyntaxOptions> 441 464 </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> 442 474 <Linking> 443 475 <Options> -
DockManager/Lazarus/Demo/Demo.lpr
r41 r48 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UMainForm, UDockForm, UCustomDockManager 11 { you can add units after this }; 10 Forms, UMainForm, UDockForm, CustomDockManager; 12 11 13 12 {$R *.res} -
DockManager/Lazarus/Demo/UMainForm.lfm
r47 r48 1 1 object MainForm: TMainForm 2 Left = 3 112 Left = 341 3 3 Height = 435 4 Top = 914 Top = 158 5 5 Width = 576 6 6 Caption = 'MainForm' … … 22 22 object Panel1: TPanel 23 23 Left = 0 24 Height = 3 9525 Top = 4 024 Height = 387 25 Top = 48 26 26 Width = 576 27 27 Align = alBottom 28 28 Anchors = [akTop, akLeft, akRight, akBottom] 29 BevelOuter = bvNone30 29 DockSite = True 31 30 TabOrder = 1 32 31 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 46 37 end 47 38 end -
DockManager/Lazarus/Demo/UMainForm.pas
r47 r48 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ExtCtrls, Buttons, UCustomDockManager, UDockForm;9 ComCtrls, ExtCtrls, Buttons, Menus, UCustomDockManager, UDockForm; 10 10 11 11 type … … 15 15 TMainForm = class(TForm) 16 16 Button1: TButton; 17 CustomDockMaster1: TCustomDockMaster; 17 18 Panel1: TPanel; 18 TabControl1: TTabControl;19 19 procedure Button1Click(Sender: TObject); 20 20 procedure FormCreate(Sender: TObject); … … 54 54 begin 55 55 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); 58 58 ConjoinedDockForm1.Name := 'Model';; 59 ConjoinedDockForm1.ManualDock(Panel1);59 //ConjoinedDockForm1.ManualDock(Panel1); 60 60 TCustomDockManager(ConjoinedDockForm1.Panel.DockManager).DockStyle := dsTabs; 61 61 NewDockForm.ManualDock(ConjoinedDockForm1.Panel); -
DockManager/Lazarus/UCustomDockManager.pas
r47 r48 2 2 3 3 {$mode delphi}{$H+} 4 5 // Date: 2010-09-17 4 6 5 7 interface … … 7 9 uses 8 10 Classes, SysUtils, Controls, LCLType, LMessages, Graphics, StdCtrls, 9 Buttons, ExtCtrls, Contnrs, Forms, ComCtrls, Dialogs ;11 Buttons, ExtCtrls, Contnrs, Forms, ComCtrls, Dialogs, Menus, FileUtil; 10 12 11 13 const 12 GrabberSize = 18;14 GrabberSize = 22; 13 15 14 16 type 15 17 TDockDirection = (ddNone, ddHorizontal, ddVertical); 18 THeaderPos = (hpAuto, hpLeft, hpTop, hpRight, hpBottom); 16 19 17 20 TCustomDockManager = class; … … 53 56 TCustomDockManager = class(TDockManager) 54 57 private 58 PopupMenu1: TPopupMenu; 55 59 FDockStyle: TDockStyle; 56 60 TabControl: TTabControl; … … 64 68 procedure UpdateClientSize; 65 69 procedure TabControlChange(Sender: TObject); 70 procedure PopupMenuListClick(Sender: TObject); 71 procedure PopupMenuTabsClick(Sender: TObject); 66 72 public 67 73 constructor Create(ADockSite: TWinControl); override; … … 87 93 function AutoFreeByControl: Boolean; override; 88 94 89 function CreateContainer : TConjoinDockForm;95 function CreateContainer(InsertAt: TAlign): TConjoinDockForm; 90 96 property DockStyle: TDockStyle read FDockStyle write SetDockStyle; 91 97 end; 92 98 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 117 procedure Register; 118 93 119 implementation 120 121 procedure Register; 122 begin 123 RegisterComponents('CustomDocking', [TCustomDockMaster]); 124 end; 125 94 126 95 127 { TCustomDockManager } … … 108 140 109 141 constructor TCustomDockManager.Create(ADockSite: TWinControl); 110 begin 142 var 143 NewMenuItem: TMenuItem; 144 begin 145 inherited Create(ADockSite); 111 146 FDockSite := ADockSite; 112 147 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); 113 157 TabControl := TTabControl.Create(FDockSite); 114 158 with TabControl do begin … … 118 162 Height := 24; 119 163 OnChange := TabControlChange; 120 end;121 inherited Create(ADockSite);164 PopupMenu := PopupMenu1; 165 end; 122 166 end; 123 167 … … 156 200 DropCtl: TControl); 157 201 var 158 NewSplitter: TSplitter;159 202 NewPanel: TDockClientPanel; 160 203 I: Integer; … … 171 214 //end; 172 215 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; 185 227 end; 186 228 … … 194 236 NewPanel := TDockClientPanel.Create(nil); 195 237 with NewPanel do begin 196 Splitter := NewSplitter;197 238 Parent := FDockSite; 198 239 OwnerDockManager := Self; 199 240 if DockStyle = dsList then Visible := True; 200 241 Align := alClient; 242 PopupMenu := PopupMenu1; 201 243 end; 202 244 203 245 if DockStyle = dsTabs then begin 204 TabControl.Tabs.Add(Control. Name);246 TabControl.Tabs.Add(Control.Caption); 205 247 TabControlChange(Self); 206 248 end; … … 342 384 end; 343 385 344 function TCustomDockManager.CreateContainer : TConjoinDockForm;386 function TCustomDockManager.CreateContainer(InsertAt: TAlign): TConjoinDockForm; 345 387 var 346 388 NewDockSite: TWinControl; … … 354 396 NewDockSite := FDockSite.HostDockSite; 355 397 // FDockSite.ManualFloat(FDockSite.BoundsRect); 356 NewConjoinDockForm.ManualDock(NewDockSite );398 NewConjoinDockForm.ManualDock(NewDockSite, nil, InsertAt); 357 399 Result := NewConjoinDockForm; 358 400 end; … … 367 409 TabControl.Tabs.Clear; 368 410 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; 371 414 TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := False; 372 415 TDockClientPanel(FDockPanels[I]).Visible := False; … … 378 421 TabControl.Tabs.Clear; 379 422 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; 381 425 TDockClientPanel(FDockPanels[I]).Visible := True; 382 426 TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Parent := TDockClientPanel(FDockPanels[I]); 427 TDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := True; 383 428 end; 384 429 end; … … 416 461 end; 417 462 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; 420 468 // TDockClientPanel(FDockPanels[TabControl.TabIndex]).Visible := True; 421 469 end; 470 end; 471 472 procedure TCustomDockManager.PopupMenuTabsClick(Sender: TObject); 473 begin 474 DockStyle := dsTabs; 475 end; 476 477 procedure TCustomDockManager.PopupMenuListClick(Sender: TObject); 478 begin 479 DockStyle := dsList; 422 480 end; 423 481 … … 439 497 Caption := 'X'; 440 498 Font.Size := 6; 441 Width := 14;442 Height := 14;499 Width := GrabberSize - 4; 500 Height := GrabberSize - 4; 443 501 Visible := False; 444 502 OnClick := CloseButtonClick; … … 459 517 //Color := clGreen; 460 518 end; 519 Splitter := TSplitter.Create(Self); 520 with Splitter do begin 521 //Color := clRed; 522 end; 461 523 OnPaint := DockPanelPaint; 462 524 OnMouseDown := DockPanelMouseDown; … … 483 545 else Font.Style := Font.Style - [fsBold]; 484 546 Rectangle(1, 1, AControl.Width - 1, GrabberSize - 1); 485 TextOut(6, 2, AControl.Caption);547 TextOut(6, 4, AControl.Caption); 486 548 487 549 CloseButton.Left := AControl.Width - CloseButton.Width - 2; … … 526 588 begin 527 589 if Control is TForm then begin 528 TForm(Control).SetFocus;590 //TForm(Control).SetFocus; 529 591 DockPanelPaint(Self); 530 592 end; … … 545 607 UseDockManager := True; 546 608 Align := alClient; 609 // Color := clYellow; 547 610 end; 548 611 DragKind := dkDock; … … 550 613 end; 551 614 615 { TCustomDockMaster } 616 617 procedure TCustomDockMaster.SetTabsEnabled(const AValue: Boolean); 618 begin 619 if FTabsEnabled=AValue then exit; 620 FTabsEnabled:=AValue; 621 end; 622 623 procedure TCustomDockMaster.SaveLayoutToStream(Stream: TStream); 624 begin 625 626 end; 627 628 procedure TCustomDockMaster.LoadLayoutFromStream(Stream: TStream); 629 begin 630 631 end; 632 633 procedure TCustomDockMaster.SaveLayoutToFile(FileName: string); 634 var 635 LayoutFile: TFileStream; 636 begin 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; 645 end; 646 647 procedure TCustomDockMaster.LoadLayoutFromFile(FileName: string); 648 var 649 LayoutFile: TFileStream; 650 begin 651 LayoutFile := TFileStream.Create(FileName, fmOpenRead); 652 try 653 LoadLayoutFromStream(LayoutFile); 654 finally 655 Free; 656 end; 657 end; 658 552 659 initialization 553 660 DefaultDockManagerClass := TCustomDockManager;
Note:
See TracChangeset
for help on using the changeset viewer.