- Timestamp:
- Mar 22, 2011, 11:32:28 AM (14 years ago)
- Location:
- Docking/CoolDocking
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Demo/IDE/IDE.lpi
r216 r217 47 47 </Item4> 48 48 </RequiredPackages> 49 <Units Count="5 0">49 <Units Count="51"> 50 50 <Unit0> 51 51 <Filename Value="IDE.lpr"/> 52 52 <IsPartOfProject Value="True"/> 53 53 <UnitName Value="IDE"/> 54 <EditorIndex Value="8"/>55 54 <WindowIndex Value="0"/> 56 55 <TopLine Value="10"/> 57 56 <CursorPos X="1" Y="34"/> 58 57 <UsageCount Value="314"/> 59 <Loaded Value="True"/>60 58 </Unit0> 61 59 <Unit1> … … 67 65 <EditorIndex Value="1"/> 68 66 <WindowIndex Value="0"/> 69 <TopLine Value=" 90"/>70 <CursorPos X=" 27" Y="102"/>67 <TopLine Value="171"/> 68 <CursorPos X="32" Y="185"/> 71 69 <UsageCount Value="314"/> 72 70 <Loaded Value="True"/> … … 108 106 <Unit5> 109 107 <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/> 110 <EditorIndex Value="1 0"/>111 <WindowIndex Value="0"/> 112 <TopLine Value=" 3934"/>113 <CursorPos X="1" Y=" 3955"/>108 <EditorIndex Value="12"/> 109 <WindowIndex Value="0"/> 110 <TopLine Value="2412"/> 111 <CursorPos X="1" Y="2425"/> 114 112 <UsageCount Value="144"/> 115 113 <Loaded Value="True"/> … … 223 221 <Filename Value="..\..\UCDLayout.pas"/> 224 222 <UnitName Value="UCDLayout"/> 225 <EditorIndex Value="1 3"/>223 <EditorIndex Value="15"/> 226 224 <WindowIndex Value="0"/> 227 225 <TopLine Value="361"/> 228 <CursorPos X="4 4" Y="374"/>226 <CursorPos X="49" Y="376"/> 229 227 <UsageCount Value="49"/> 230 228 <Loaded Value="True"/> … … 232 230 <Unit17> 233 231 <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\FPC\rtl\objpas\classes\classesh.inc"/> 234 <WindowIndex Value="0"/> 235 <TopLine Value="285"/> 236 <CursorPos X="14" Y="298"/> 237 <UsageCount Value="2"/> 232 <EditorIndex Value="5"/> 233 <WindowIndex Value="0"/> 234 <TopLine Value="1883"/> 235 <CursorPos X="10" Y="1896"/> 236 <UsageCount Value="10"/> 237 <Loaded Value="True"/> 238 238 </Unit17> 239 239 <Unit18> … … 244 244 <TopLine Value="22"/> 245 245 <CursorPos X="26" Y="32"/> 246 <UsageCount Value="1 8"/>246 <UsageCount Value="19"/> 247 247 <Loaded Value="True"/> 248 248 </Unit18> … … 250 250 <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\controls.pp"/> 251 251 <UnitName Value="Controls"/> 252 <EditorIndex Value=" 6"/>253 <WindowIndex Value="0"/> 254 <TopLine Value=" 512"/>255 <CursorPos X=" 26" Y="525"/>252 <EditorIndex Value="9"/> 253 <WindowIndex Value="0"/> 254 <TopLine Value="126"/> 255 <CursorPos X="53" Y="130"/> 256 256 <UsageCount Value="124"/> 257 257 <Loaded Value="True"/> … … 259 259 <Unit20> 260 260 <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\wincontrol.inc"/> 261 <EditorIndex Value=" 9"/>261 <EditorIndex Value="11"/> 262 262 <WindowIndex Value="0"/> 263 263 <TopLine Value="6263"/> … … 280 280 <Filename Value="..\..\UCDCommon.pas"/> 281 281 <UnitName Value="UCDCommon"/> 282 <EditorIndex Value=" 5"/>282 <EditorIndex Value="8"/> 283 283 <WindowIndex Value="0"/> 284 284 <TopLine Value="1"/> 285 <CursorPos X=" 32" Y="12"/>286 <UsageCount Value="4 7"/>285 <CursorPos X="1" Y="78"/> 286 <UsageCount Value="48"/> 287 287 <Loaded Value="True"/> 288 288 </Unit22> … … 290 290 <Filename Value="..\..\UCDPopupMenu.pas"/> 291 291 <UnitName Value="UCDPopupMenu"/> 292 <WindowIndex Value="0"/> 293 <TopLine Value="319"/> 294 <CursorPos X="1" Y="335"/> 292 <EditorIndex Value="7"/> 293 <WindowIndex Value="0"/> 294 <TopLine Value="219"/> 295 <CursorPos X="18" Y="232"/> 295 296 <UsageCount Value="128"/> 297 <Loaded Value="True"/> 296 298 </Unit23> 297 299 <Unit24> 298 300 <Filename Value="..\..\Managers\UCDManagerTabs.pas"/> 299 301 <UnitName Value="UCDManagerTabs"/> 300 <EditorIndex Value="1 4"/>301 <WindowIndex Value="0"/> 302 <TopLine Value="2 6"/>303 <CursorPos X=" 28" Y="36"/>302 <EditorIndex Value="16"/> 303 <WindowIndex Value="0"/> 304 <TopLine Value="243"/> 305 <CursorPos X="44" Y="256"/> 304 306 <UsageCount Value="130"/> 305 307 <Loaded Value="True"/> … … 308 310 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 309 311 <UnitName Value="UCDManagerRegions"/> 310 <IsVisibleTab Value="True"/> 311 <EditorIndex Value="7"/> 312 <WindowIndex Value="0"/> 313 <TopLine Value="231"/> 314 <CursorPos X="12" Y="244"/> 312 <EditorIndex Value="10"/> 313 <WindowIndex Value="0"/> 314 <TopLine Value="301"/> 315 <CursorPos X="1" Y="314"/> 315 316 <UsageCount Value="129"/> 316 317 <Loaded Value="True"/> … … 321 322 <EditorIndex Value="0"/> 322 323 <WindowIndex Value="0"/> 323 <TopLine Value="2 62"/>324 <CursorPos X=" 52" Y="272"/>324 <TopLine Value="235"/> 325 <CursorPos X="1" Y="248"/> 325 326 <UsageCount Value="120"/> 326 327 <Loaded Value="True"/> … … 341 342 <Filename Value="..\..\UCDManager.pas"/> 342 343 <UnitName Value="UCDManager"/> 344 <IsVisibleTab Value="True"/> 343 345 <EditorIndex Value="4"/> 344 346 <WindowIndex Value="0"/> 345 <TopLine Value=" 84"/>346 <CursorPos X=" 5" Y="97"/>347 <TopLine Value="723"/> 348 <CursorPos X="30" Y="744"/> 347 349 <UsageCount Value="105"/> 348 350 <Loaded Value="True"/> … … 351 353 <Filename Value="..\..\UCDConjoinForm.pas"/> 352 354 <UnitName Value="UCDConjoinForm"/> 353 <EditorIndex Value="1 2"/>355 <EditorIndex Value="14"/> 354 356 <WindowIndex Value="0"/> 355 357 <TopLine Value="33"/> … … 510 512 <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\stdctrls.pp"/> 511 513 <UnitName Value="StdCtrls"/> 512 <EditorIndex Value="1 1"/>514 <EditorIndex Value="13"/> 513 515 <WindowIndex Value="0"/> 514 516 <TopLine Value="1447"/> 515 517 <CursorPos X="14" Y="1460"/> 516 <UsageCount Value="1 1"/>518 <UsageCount Value="12"/> 517 519 <Loaded Value="True"/> 518 520 </Unit49> 521 <Unit50> 522 <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\graphics.pp"/> 523 <UnitName Value="Graphics"/> 524 <EditorIndex Value="6"/> 525 <WindowIndex Value="0"/> 526 <TopLine Value="959"/> 527 <CursorPos X="14" Y="1161"/> 528 <UsageCount Value="10"/> 529 <Loaded Value="True"/> 530 </Unit50> 519 531 </Units> 520 532 <JumpHistory Count="30" HistoryIndex="29"> 521 533 <Position1> 522 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>523 <Caret Line=" 3931" Column="1" TopLine="3916"/>534 <Filename Value="..\..\UCDPopupMenu.pas"/> 535 <Caret Line="257" Column="16" TopLine="244"/> 524 536 </Position1> 525 537 <Position2> 526 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>527 <Caret Line=" 3932" Column="1" TopLine="3922"/>538 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 539 <Caret Line="126" Column="1" TopLine="113"/> 528 540 </Position2> 529 541 <Position3> 530 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>531 <Caret Line="3 939" Column="1" TopLine="3922"/>542 <Filename Value="..\..\UCDManager.pas"/> 543 <Caret Line="32" Column="19" TopLine="27"/> 532 544 </Position3> 533 545 <Position4> 534 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>535 <Caret Line=" 3942" Column="1" TopLine="3922"/>546 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 547 <Caret Line="18" Column="15" TopLine="5"/> 536 548 </Position4> 537 549 <Position5> 538 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>539 <Caret Line=" 3945" Column="1" TopLine="3924"/>550 <Filename Value="..\..\Managers\UCDManagerRegions.pas"/> 551 <Caret Line="92" Column="1" TopLine="79"/> 540 552 </Position5> 541 553 <Position6> 542 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>543 <Caret Line="3 946" Column="1" TopLine="3925"/>554 <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/> 555 <Caret Line="330" Column="44" TopLine="317"/> 544 556 </Position6> 545 557 <Position7> 546 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>547 <Caret Line=" 3948" Column="1" TopLine="3927"/>558 <Filename Value="..\..\UCDManager.pas"/> 559 <Caret Line="668" Column="3" TopLine="657"/> 548 560 </Position7> 549 561 <Position8> 550 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>551 <Caret Line=" 3951" Column="1" TopLine="3930"/>562 <Filename Value="..\..\UCDManager.pas"/> 563 <Caret Line="605" Column="1" TopLine="592"/> 552 564 </Position8> 553 565 <Position9> 554 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>555 <Caret Line=" 3952" Column="1" TopLine="3931"/>566 <Filename Value="..\..\UCDManager.pas"/> 567 <Caret Line="679" Column="31" TopLine="665"/> 556 568 </Position9> 557 569 <Position10> 558 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>559 <Caret Line=" 3953" Column="1" TopLine="3932"/>570 <Filename Value="..\..\UCDPopupMenu.pas"/> 571 <Caret Line="246" Column="16" TopLine="237"/> 560 572 </Position10> 561 573 <Position11> 562 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>563 <Caret Line=" 3954" Column="1" TopLine="3933"/>574 <Filename Value="..\..\UCDPopupMenu.pas"/> 575 <Caret Line="232" Column="18" TopLine="219"/> 564 576 </Position11> 565 577 <Position12> 566 <Filename Value=" E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>567 <Caret Line=" 3955" Column="1" TopLine="3934"/>578 <Filename Value="..\..\UCDManager.pas"/> 579 <Caret Line="602" Column="20" TopLine="594"/> 568 580 </Position12> 569 581 <Position13> 570 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>571 <Caret Line=" 220" Column="1" TopLine="215"/>582 <Filename Value="..\..\UCDManager.pas"/> 583 <Caret Line="727" Column="11" TopLine="708"/> 572 584 </Position13> 573 585 <Position14> 574 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>575 <Caret Line=" 221" Column="1" TopLine="215"/>586 <Filename Value="..\..\UCDManager.pas"/> 587 <Caret Line="659" Column="17" TopLine="643"/> 576 588 </Position14> 577 589 <Position15> 578 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>579 <Caret Line=" 222" Column="1" TopLine="215"/>590 <Filename Value="..\..\UCDManager.pas"/> 591 <Caret Line="729" Column="32" TopLine="8"/> 580 592 </Position15> 581 593 <Position16> 582 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>583 <Caret Line=" 225" Column="1" TopLine="215"/>594 <Filename Value="..\..\UCDManager.pas"/> 595 <Caret Line="660" Column="14" TopLine="638"/> 584 596 </Position16> 585 597 <Position17> 586 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>587 <Caret Line=" 226" Column="1" TopLine="215"/>598 <Filename Value="..\..\UCDManager.pas"/> 599 <Caret Line="731" Column="70" TopLine="719"/> 588 600 </Position17> 589 601 <Position18> 590 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>591 <Caret Line=" 229" Column="1" TopLine="215"/>602 <Filename Value="..\..\UCDManager.pas"/> 603 <Caret Line="743" Column="47" TopLine="730"/> 592 604 </Position18> 593 605 <Position19> 594 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>595 <Caret Line=" 231" Column="13" TopLine="215"/>606 <Filename Value="..\..\UCDManager.pas"/> 607 <Caret Line="740" Column="9" TopLine="730"/> 596 608 </Position19> 597 609 <Position20> 598 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>599 <Caret Line=" 232" Column="1" TopLine="215"/>610 <Filename Value="..\..\UCDManager.pas"/> 611 <Caret Line="738" Column="1" TopLine="730"/> 600 612 </Position20> 601 613 <Position21> 602 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>603 <Caret Line=" 233" Column="1" TopLine="215"/>614 <Filename Value="..\..\UCDManager.pas"/> 615 <Caret Line="729" Column="1" TopLine="718"/> 604 616 </Position21> 605 617 <Position22> 606 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>607 <Caret Line=" 243" Column="14" TopLine="220"/>618 <Filename Value="..\..\UCDManager.pas"/> 619 <Caret Line="730" Column="1" TopLine="718"/> 608 620 </Position22> 609 621 <Position23> 610 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>611 <Caret Line=" 201" Column="1" TopLine="188"/>622 <Filename Value="..\..\UCDManager.pas"/> 623 <Caret Line="731" Column="33" TopLine="718"/> 612 624 </Position23> 613 625 <Position24> 614 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>615 <Caret Line=" 203" Column="1" TopLine="188"/>626 <Filename Value="..\..\UCDManager.pas"/> 627 <Caret Line="732" Column="3" TopLine="718"/> 616 628 </Position24> 617 629 <Position25> 618 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>619 <Caret Line=" 230" Column="12" TopLine="217"/>630 <Filename Value="..\..\UCDManager.pas"/> 631 <Caret Line="736" Column="1" TopLine="718"/> 620 632 </Position25> 621 633 <Position26> 622 634 <Filename Value="..\..\UCDManager.pas"/> 623 <Caret Line=" 128" Column="24" TopLine="115"/>635 <Caret Line="729" Column="36" TopLine="718"/> 624 636 </Position26> 625 637 <Position27> 626 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>627 <Caret Line=" 231" Column="15" TopLine="217"/>638 <Filename Value="..\..\UCDManager.pas"/> 639 <Caret Line="740" Column="1" TopLine="719"/> 628 640 </Position27> 629 641 <Position28> 630 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>631 <Caret Line=" 201" Column="18" TopLine="188"/>642 <Filename Value="..\..\UCDManager.pas"/> 643 <Caret Line="744" Column="8" TopLine="723"/> 632 644 </Position28> 633 645 <Position29> 634 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>635 <Caret Line=" 205" Column="34" TopLine="188"/>646 <Filename Value="..\..\UCDManager.pas"/> 647 <Caret Line="739" Column="1" TopLine="723"/> 636 648 </Position29> 637 649 <Position30> 638 <Filename Value="..\..\ Managers\UCDManagerRegions.pas"/>639 <Caret Line=" 231" Column="5" TopLine="218"/>650 <Filename Value="..\..\UCDManager.pas"/> 651 <Caret Line="740" Column="1" TopLine="723"/> 640 652 </Position30> 641 653 </JumpHistory> … … 678 690 </CompilerOptions> 679 691 <Debugging> 680 <BreakPoints Count="1">681 <Item1>682 <Source Value="..\..\Managers\UCDManagerRegions.pas"/>683 <Line Value="202"/>684 </Item1>685 </BreakPoints>686 692 <Watches Count="1"> 687 693 <Item1> -
Docking/CoolDocking/Managers/UCDManagerRegions.pas
r216 r217 90 90 PanelHeader.Header.ManagerItem := Self; 91 91 PanelHeader.Header.OnMouseDown := DockPanelMouseDown; 92 PanelHeader.Header.Title.OnMouseDown := DockPanelMouseDown;93 92 PanelHeader.Header.Icon.OnMouseDown := DockPanelMouseDown; 94 93 … … 123 122 begin 124 123 inherited SetHeaderPos(AValue); 125 case AValue of 124 if Assigned(DockSite.Parent) then 125 TCDManager(DockSite.Parent.DockManager).UpdateClientSize; 126 (* case AValue of 126 127 hpBottom, hpTop: FDockDirection := ddVertical; 127 128 hpLeft, hpRight: FDockDirection := ddHorizontal; 128 end; 129 end;*) 129 130 end; 130 131 … … 172 173 NewItem.PanelHeader.Parent := DockSite; 173 174 174 NewItem.Control := Control;175 NewItem.Control := TWinControl(Control); 175 176 Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange); 176 177 Control.Parent := NewItem.PanelHeader.ControlPanel; … … 199 200 // Direction change, create conjoin form 200 201 NewConjoinDockForm := CreateContainer(InsertAt); 201 FreeParentIfEmpty := False; 202 for I := DockSite.DockClientCount - 1 downto 0 do begin 203 DockSite.DockClients[I].ManualDock(NewConjoinDockForm); 202 try 203 FreeParentIfEmpty := False; 204 for I := DockSite.DockClientCount - 1 downto 0 do begin 205 DockSite.DockClients[I].ManualDock(NewConjoinDockForm); 206 end; 207 finally 208 FreeParentIfEmpty := True; 204 209 end; 205 FreeParentIfEmpty := True;206 210 NewConjoinDockForm.ManualDock(DockSite); 207 211 Control.ManualDock(DockSite, nil, InsertAt); … … 308 312 if Assigned(TWinControl(Control).DockManager) then 309 313 PanelHeader.Header.Visible := TCDManager(TWinControl(Control).DockManager).HeaderVisible; 310 PanelHeader.Header.Title.Caption := TForm(Control).Caption;311 314 PanelHeader.Visible := Control.Visible; 312 315 Paint(Self); -
Docking/CoolDocking/Managers/UCDManagerTabs.pas
r216 r217 254 254 NewItem.IconImage.Picture.Assign((Control as TForm).Icon); 255 255 256 NewItem.Control := Control;256 NewItem.Control := TWinControl(Control); 257 257 Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange); 258 258 //AControl.Parent := NewItem.ClientAreaPanel; … … 272 272 if Assigned(ManagerItem) then begin 273 273 Control.RemoveHandlerOnVisibleChanged(ManagerItem.VisibleChange); 274 end 274 end; //else raise Exception.Create(Format('Control %s not found in DockItems', [Control.Name])); 275 275 276 276 DockItems.Remove(ManagerItem); -
Docking/CoolDocking/Managers/UCDManagerTabsPopup.pas
r208 r217 246 246 C.Align := alClient; 247 247 C.Parent := HeaderPanel.ControlPanel; 248 HeaderPanel.Header.Title.Caption := C.Caption;249 248 //AutoHide.Control.Align := alCustom; 250 249 //Pos := DockSite.ClientToScreen(Pos); … … 328 327 NewItem.IconImage.Picture.Assign((Control as TForm).Icon); 329 328 330 NewItem.Control := Control;329 NewItem.Control := TWinControl(Control); 331 330 Control.AddHandlerOnVisibleChanged(NewItem.VisibleChange); 332 331 //AControl.Parent := NewItem.ClientAreaPanel; -
Docking/CoolDocking/UCDCommon.pas
r198 r217 75 75 76 76 function GetUniqueName(BaseName: string): string; 77 function HeaderPosToTabPos(HeaderPos: THeaderPos): TTabPosition; 77 78 78 79 implementation … … 87 88 end; 88 89 90 function HeaderPosToTabPos(HeaderPos: THeaderPos): TTabPosition; 91 begin 92 case HeaderPos of 93 hpBottom: Result := tpBottom; 94 hpLeft: Result := tpLeft; 95 hpTop: Result := tpTop; 96 hpRight: Result := tpRight; 97 hpAuto: Result := tpTop; 98 end; 99 end; 89 100 90 101 { TCDManagerBase } -
Docking/CoolDocking/UCDManager.pas
r216 r217 7 7 uses 8 8 Classes, SysUtils, UCDCommon, Controls, Contnrs, Dialogs, 9 UCDPopupMenu, LCLType, L Messages, Graphics, Buttons,9 UCDPopupMenu, LCLType, LCLIntf, LMessages, Graphics, Buttons, 10 10 UCDConjoinForm, Menus, StdCtrls, ExtCtrls, Forms; 11 11 … … 30 30 TCDHeader = class(TPanel) 31 31 private 32 MyFont: hFont; 32 33 procedure CloseButtonClick(Sender: TObject); 33 34 procedure PaintExecute(Sender: TObject); … … 35 36 public 36 37 Buttons: TObjectList; // TList<TCDHeaderButton> 37 Title: TLabel;38 38 Icon: TImage; 39 39 ManagerItem: TCDManagerItem; … … 67 67 procedure SetHideType(const AValue: TCDHideType); 68 68 public 69 Control: T Control;69 Control: TWinControl; 70 70 Manager: TCDManager; 71 71 procedure DockPanelMouseDown(Sender: TObject; Button: TMouseButton; … … 139 139 end; 140 140 141 function HeaderPosToTabPos(HeaderPos: THeaderPos): TTabPosition;142 143 141 144 142 implementation … … 148 146 UCDResource; 149 147 150 function HeaderPosToTabPos(HeaderPos: THeaderPos): TTabPosition; 151 begin 152 case HeaderPos of 153 hpBottom: Result := tpBottom; 154 hpLeft: Result := tpLeft; 155 hpTop: Result := tpTop; 156 hpRight: Result := tpRight; 157 hpAuto: Result := tpTop; 158 end; 148 function CreateRotatedFont(F: TFont; Angle: Integer): Integer; 149 var 150 LF: TLogFont; 151 begin 152 FillChar(LF, SizeOf(LF), #0); 153 with LF do begin 154 lfHeight := F.Height; 155 lfWidth := 0; 156 lfEscapement := Angle * 10; 157 lfOrientation := 0; 158 if fsBold in F.Style then 159 lfWeight := FW_BOLD 160 else 161 lfWeight := FW_NORMAL; 162 lfItalic := Byte(fsItalic in F.Style); 163 lfUnderline := Byte(fsUnderline in F.Style); 164 lfStrikeOut := Byte(fsStrikeOut in F.Style); 165 lfCharSet := DEFAULT_CHARSET; 166 StrPCopy(lfFaceName, F.Name); 167 lfQuality := DEFAULT_QUALITY; 168 {everything else as default} 169 lfOutPrecision := OUT_DEFAULT_PRECIS; 170 lfClipPrecision := CLIP_DEFAULT_PRECIS; 171 case F.Pitch of 172 fpVariable: lfPitchAndFamily := VARIABLE_PITCH; 173 fpFixed: lfPitchAndFamily := FIXED_PITCH; 174 else 175 lfPitchAndFamily := DEFAULT_PITCH; 176 end; 177 end; 178 Result := CreateFontIndirect(LF); 159 179 end; 160 180 … … 179 199 if FHeaderPos=AValue then exit; 180 200 FHeaderPos:=AValue; 201 181 202 //Paint(Self); 182 203 end; … … 580 601 inherited Create(TheOwner); 581 602 OnPaint := PaintExecute; 582 583 Title := TLabel.Create(Self); 584 with Title do begin 585 Parent := Self; 586 Visible := True; 587 Top := 4; 588 Left := 6; 589 BevelInner := bvNone; 590 BevelOuter := bvNone; 591 end; 603 //MyFont := CreateRotatedFont(Canvas.Font, 90); 604 592 605 Buttons := TObjectList.Create; 593 606 … … 642 655 var 643 656 Points: array of TPoint; 644 begin 657 TitleLeft: Integer; 658 TitleWidth: Integer; 659 TitleMaxWidth: Integer; 660 I: Integer; 661 Title: string; 662 R: TRect; 663 begin 664 with TCDManager(TWinControl(ManagerItem.Control).DockManager) do 665 case HeaderPos of 666 hpLeft: begin 667 Align := alLeft; 668 Width := GrabberSize; 669 end; 670 hpTop, hpAuto: begin 671 Align := alTop; 672 Height := GrabberSize; 673 end; 674 hpRight: begin 675 Align := alRight; 676 Width := GrabberSize; 677 end; 678 hpBottom: begin 679 Align := alBottom; 680 Height := GrabberSize; 681 end; 682 end; 683 645 684 if (ManagerItem.Control as TWinControl).Focused then 646 Title.Font.Style := Font.Style + [fsBold] 647 else Title.Font.Style := Font.Style - [fsBold]; 648 649 if Icon.Picture.Width > 0 then Title.Left := 8 + Icon.Picture.Width 650 else Title.Left := 6; 651 Title.Caption := ManagerItem.Control.Caption; 685 Canvas.Font.Style := Canvas.Font.Style + [fsBold] 686 else Canvas.Font.Style := Canvas.Font.Style - [fsBold]; 687 652 688 RearrangeButtons; 653 689 … … 689 725 Pen.Color := BorderColor; 690 726 Polyline(Points); 727 728 Canvas.Brush.Style := bsClear; 729 TitleMaxWidth := Self.Width - 6; 730 for I := 0 to Buttons.Count - 1 do 731 if TCDHeaderButton(Buttons[I]).Visible then 732 Dec(TitleMaxWidth, TCDHeaderButton(Buttons[I]).Icon.Width + 2); 733 if Icon.Picture.Width > 0 then begin 734 TitleLeft := 8 + Icon.Picture.Width; 735 Dec(TitleMaxWidth, Icon.Picture.Width + 2) 736 end else TitleLeft := 6; 737 738 //SelectObject(Canvas.Handle, MyFont); 739 Title := ManagerItem.Control.Caption; 740 if (TextWidth(Title) > TitleMaxWidth) then begin 741 while (Length(Title) > 0) and (TextWidth(Title + '...') > TitleMaxWidth) do begin 742 Delete(Title, Length(Title), 1); 743 end; 744 Title := Title + '...'; 745 end; 746 747 R := Rect(TitleLeft, 4, TitleLeft + TitleMaxWidth, 4 + TextHeight(Title)); 748 TextRect(R, TitleLeft, 4, Title); 691 749 end; 692 750 end; -
Docking/CoolDocking/UCDPopupMenu.pas
r207 r217 230 230 if InputQuery(SRenameWindow, SEnterNewWindowName, False, Value) then begin 231 231 ManagerItem.Control.Caption := Value; 232 Title.Caption := Value;232 Invalidate; 233 233 end; 234 234 end; … … 243 243 if PopupComponent is TCDHeader then 244 244 with TCDHeader(PopupComponent) do begin 245 TCDManager(Manager).HeaderPos := hpAuto; 245 TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpTop; 246 Invalidate; 246 247 end; 247 248 end; … … 255 256 if PopupComponent is TCDHeader then 256 257 with TCDHeader(PopupComponent) do begin 257 TCDManager(Manager).HeaderPos := hpLeft; 258 TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpLeft; 259 Invalidate; 258 260 end; 259 261 end; … … 267 269 if PopupComponent is TCDHeader then 268 270 with TCDHeader(PopupComponent) do begin 269 TCDManager(Manager).HeaderPos := hpRight; 271 TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpRight; 272 Invalidate; 270 273 end; 271 274 end; … … 279 282 if PopupComponent is TCDHeader then 280 283 with TCDHeader(PopupComponent) do begin 281 TCDManager(Manager).HeaderPos := hpTop; 284 TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpTop; 285 Invalidate; 282 286 end; 283 287 end; … … 291 295 if PopupComponent is TCDHeader then 292 296 with TCDHeader(PopupComponent) do begin 293 TCDManager(Manager).HeaderPos := hpBottom; 297 TCDManager(TWinControl(ManagerItem.Control).DockManager).HeaderPos := hpBottom; 298 Invalidate; 294 299 end; 295 300 end;
Note:
See TracChangeset
for help on using the changeset viewer.