Changeset 207 for Docking


Ignore:
Timestamp:
Mar 18, 2011, 11:05:39 AM (14 years ago)
Author:
george
Message:
  • Fixed: PopupForm auto resize on parent resize.
  • Added: Option in popup menu for change visibility of dock panel header.
Location:
Docking/CoolDocking
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/Demo/IDE/IDE.lpi

    r205 r207  
    6363        <ResourceBaseClass Value="Form"/>
    6464        <UnitName Value="UMainForm"/>
    65         <EditorIndex Value="4"/>
    66         <WindowIndex Value="0"/>
    67         <TopLine Value="92"/>
    68         <CursorPos X="73" Y="89"/>
     65        <EditorIndex Value="1"/>
     66        <WindowIndex Value="0"/>
     67        <TopLine Value="96"/>
     68        <CursorPos X="26" Y="95"/>
    6969        <UsageCount Value="314"/>
    7070        <Loaded Value="True"/>
     
    108108        <EditorIndex Value="3"/>
    109109        <WindowIndex Value="0"/>
    110         <TopLine Value="3938"/>
    111         <CursorPos X="1" Y="3951"/>
     110        <TopLine Value="3705"/>
     111        <CursorPos X="1" Y="3726"/>
    112112        <UsageCount Value="77"/>
    113113        <Loaded Value="True"/>
     
    203203        <ResourceBaseClass Value="Form"/>
    204204        <UnitName Value="USourceEditorForm"/>
    205         <EditorIndex Value="5"/>
    206205        <WindowIndex Value="0"/>
    207206        <TopLine Value="9"/>
    208207        <CursorPos X="28" Y="22"/>
    209208        <UsageCount Value="312"/>
    210         <Loaded Value="True"/>
    211209      </Unit14>
    212210      <Unit15>
     
    259257        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\controls.pp"/>
    260258        <UnitName Value="Controls"/>
    261         <EditorIndex Value="2"/>
    262         <WindowIndex Value="0"/>
    263         <TopLine Value="1222"/>
    264         <CursorPos X="37" Y="1235"/>
    265         <UsageCount Value="57"/>
    266         <Loaded Value="True"/>
     259        <WindowIndex Value="0"/>
     260        <TopLine Value="1385"/>
     261        <CursorPos X="14" Y="1398"/>
     262        <UsageCount Value="58"/>
    267263      </Unit21>
    268264      <Unit22>
    269265        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\wincontrol.inc"/>
    270         <WindowIndex Value="0"/>
    271         <TopLine Value="7785"/>
    272         <CursorPos X="1" Y="7810"/>
     266        <EditorIndex Value="8"/>
     267        <WindowIndex Value="0"/>
     268        <TopLine Value="6712"/>
     269        <CursorPos X="18" Y="6726"/>
    273270        <UsageCount Value="111"/>
     271        <Loaded Value="True"/>
    274272      </Unit22>
    275273      <Unit23>
     
    295293        <Filename Value="..\..\UCDPopupMenu.pas"/>
    296294        <UnitName Value="UCDPopupMenu"/>
    297         <EditorIndex Value="9"/>
    298         <WindowIndex Value="0"/>
    299         <TopLine Value="159"/>
    300         <CursorPos X="25" Y="173"/>
     295        <EditorIndex Value="7"/>
     296        <WindowIndex Value="0"/>
     297        <TopLine Value="319"/>
     298        <CursorPos X="1" Y="337"/>
    301299        <UsageCount Value="141"/>
    302300        <Loaded Value="True"/>
     
    329327        <Filename Value="..\..\Managers\UCDManagerTabs.pas"/>
    330328        <UnitName Value="UCDManagerTabs"/>
    331         <EditorIndex Value="8"/>
    332         <WindowIndex Value="0"/>
    333         <TopLine Value="172"/>
    334         <CursorPos X="12" Y="183"/>
     329        <EditorIndex Value="6"/>
     330        <WindowIndex Value="0"/>
     331        <TopLine Value="11"/>
     332        <CursorPos X="33" Y="24"/>
    335333        <UsageCount Value="130"/>
    336334        <Loaded Value="True"/>
     
    339337        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
    340338        <UnitName Value="UCDManagerRegions"/>
    341         <EditorIndex Value="7"/>
    342         <WindowIndex Value="0"/>
    343         <TopLine Value="61"/>
    344         <CursorPos X="27" Y="84"/>
     339        <EditorIndex Value="5"/>
     340        <WindowIndex Value="0"/>
     341        <TopLine Value="56"/>
     342        <CursorPos X="15" Y="69"/>
    345343        <UsageCount Value="129"/>
    346344        <Loaded Value="True"/>
     
    349347        <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    350348        <UnitName Value="UCDManagerTabsPopup"/>
    351         <IsVisibleTab Value="True"/>
    352349        <EditorIndex Value="0"/>
    353350        <WindowIndex Value="0"/>
    354         <TopLine Value="414"/>
    355         <CursorPos X="1" Y="439"/>
     351        <TopLine Value="45"/>
     352        <CursorPos X="35" Y="53"/>
    356353        <UsageCount Value="120"/>
    357354        <Loaded Value="True"/>
     
    380377        <Filename Value="..\..\UCDManager.pas"/>
    381378        <UnitName Value="UCDManager"/>
    382         <EditorIndex Value="6"/>
    383         <WindowIndex Value="0"/>
    384         <TopLine Value="40"/>
    385         <CursorPos X="18" Y="53"/>
     379        <IsVisibleTab Value="True"/>
     380        <EditorIndex Value="2"/>
     381        <WindowIndex Value="0"/>
     382        <TopLine Value="202"/>
     383        <CursorPos X="1" Y="223"/>
    386384        <UsageCount Value="105"/>
    387385        <Loaded Value="True"/>
     
    390388        <Filename Value="..\..\UCDConjoinForm.pas"/>
    391389        <UnitName Value="UCDConjoinForm"/>
    392         <WindowIndex Value="0"/>
    393         <TopLine Value="44"/>
    394         <CursorPos X="3" Y="47"/>
    395         <UsageCount Value="98"/>
     390        <EditorIndex Value="4"/>
     391        <WindowIndex Value="0"/>
     392        <TopLine Value="38"/>
     393        <CursorPos X="17" Y="51"/>
     394        <UsageCount Value="99"/>
     395        <Loaded Value="True"/>
    396396      </Unit35>
    397397      <Unit36>
    398398        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\extctrls.pp"/>
    399399        <UnitName Value="ExtCtrls"/>
    400         <EditorIndex Value="1"/>
    401400        <WindowIndex Value="0"/>
    402401        <TopLine Value="1181"/>
    403402        <CursorPos X="22" Y="1194"/>
    404403        <UsageCount Value="96"/>
    405         <Loaded Value="True"/>
    406404      </Unit36>
    407405      <Unit37>
    408406        <Filename Value="..\..\UCDMaster.pas"/>
    409407        <UnitName Value="UCDMaster"/>
    410         <EditorIndex Value="10"/>
     408        <EditorIndex Value="9"/>
    411409        <WindowIndex Value="0"/>
    412410        <TopLine Value="11"/>
     
    419417        <UnitName Value="ComCtrls"/>
    420418        <WindowIndex Value="0"/>
    421         <TopLine Value="255"/>
    422         <CursorPos X="14" Y="304"/>
     419        <TopLine Value="343"/>
     420        <CursorPos X="14" Y="356"/>
    423421        <UsageCount Value="91"/>
    424422      </Unit38>
     
    553551    <JumpHistory Count="30" HistoryIndex="29">
    554552      <Position1>
    555         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    556         <Caret Line="285" Column="10" TopLine="272"/>
     553        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
     554        <Caret Line="287" Column="1" TopLine="271"/>
    557555      </Position1>
    558556      <Position2>
    559         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    560         <Caret Line="234" Column="41" TopLine="228"/>
     557        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
     558        <Caret Line="288" Column="1" TopLine="271"/>
    561559      </Position2>
    562560      <Position3>
    563         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    564         <Caret Line="9" Column="52" TopLine="1"/>
     561        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
     562        <Caret Line="289" Column="1" TopLine="271"/>
    565563      </Position3>
    566564      <Position4>
    567         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    568         <Caret Line="282" Column="25" TopLine="269"/>
     565        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
     566        <Caret Line="290" Column="1" TopLine="271"/>
    569567      </Position4>
    570568      <Position5>
    571         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    572         <Caret Line="361" Column="13" TopLine="352"/>
     569        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
     570        <Caret Line="291" Column="1" TopLine="271"/>
    573571      </Position5>
    574572      <Position6>
    575         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    576         <Caret Line="291" Column="15" TopLine="274"/>
     573        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     574        <Caret Line="3691" Column="1" TopLine="3678"/>
    577575      </Position6>
    578576      <Position7>
    579         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    580         <Caret Line="56" Column="45" TopLine="53"/>
     577        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     578        <Caret Line="3694" Column="1" TopLine="3678"/>
    581579      </Position7>
    582580      <Position8>
    583         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    584         <Caret Line="356" Column="3" TopLine="354"/>
     581        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     582        <Caret Line="3695" Column="1" TopLine="3678"/>
    585583      </Position8>
    586584      <Position9>
    587         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    588         <Caret Line="56" Column="43" TopLine="43"/>
     585        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     586        <Caret Line="3696" Column="1" TopLine="3678"/>
    589587      </Position9>
    590588      <Position10>
    591         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    592         <Caret Line="354" Column="59" TopLine="341"/>
     589        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     590        <Caret Line="3697" Column="1" TopLine="3678"/>
    593591      </Position10>
    594592      <Position11>
    595         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    596         <Caret Line="356" Column="8" TopLine="341"/>
     593        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     594        <Caret Line="3698" Column="1" TopLine="3678"/>
    597595      </Position11>
    598596      <Position12>
    599         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    600         <Caret Line="62" Column="19" TopLine="49"/>
     597        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     598        <Caret Line="3700" Column="1" TopLine="3679"/>
    601599      </Position12>
    602600      <Position13>
    603         <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\extctrls.pp"/>
    604         <Caret Line="570" Column="26" TopLine="563"/>
     601        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     602        <Caret Line="3702" Column="1" TopLine="3681"/>
    605603      </Position13>
    606604      <Position14>
    607         <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\extctrls.pp"/>
    608         <Caret Line="563" Column="32" TopLine="545"/>
     605        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     606        <Caret Line="3703" Column="1" TopLine="3682"/>
    609607      </Position14>
    610608      <Position15>
    611         <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\extctrls.pp"/>
    612         <Caret Line="564" Column="33" TopLine="545"/>
     609        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     610        <Caret Line="3706" Column="1" TopLine="3685"/>
    613611      </Position15>
    614612      <Position16>
    615         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    616         <Caret Line="292" Column="19" TopLine="275"/>
     613        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     614        <Caret Line="3707" Column="1" TopLine="3686"/>
    617615      </Position16>
    618616      <Position17>
    619         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    620         <Caret Line="58" Column="30" TopLine="47"/>
     617        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     618        <Caret Line="3708" Column="1" TopLine="3687"/>
    621619      </Position17>
    622620      <Position18>
    623         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    624         <Caret Line="56" Column="33" TopLine="43"/>
     621        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     622        <Caret Line="3709" Column="1" TopLine="3688"/>
    625623      </Position18>
    626624      <Position19>
    627         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    628         <Caret Line="58" Column="31" TopLine="43"/>
     625        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     626        <Caret Line="3710" Column="1" TopLine="3689"/>
    629627      </Position19>
    630628      <Position20>
    631         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    632         <Caret Line="358" Column="1" TopLine="345"/>
     629        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     630        <Caret Line="3714" Column="1" TopLine="3693"/>
    633631      </Position20>
    634632      <Position21>
    635         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    636         <Caret Line="56" Column="15" TopLine="43"/>
     633        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     634        <Caret Line="3715" Column="1" TopLine="3694"/>
    637635      </Position21>
    638636      <Position22>
    639         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    640         <Caret Line="369" Column="13" TopLine="366"/>
     637        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     638        <Caret Line="3718" Column="1" TopLine="3697"/>
    641639      </Position22>
    642640      <Position23>
    643         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    644         <Caret Line="380" Column="23" TopLine="360"/>
     641        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     642        <Caret Line="3721" Column="1" TopLine="3700"/>
    645643      </Position23>
    646644      <Position24>
    647         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    648         <Caret Line="298" Column="32" TopLine="285"/>
     645        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     646        <Caret Line="3724" Column="1" TopLine="3703"/>
    649647      </Position24>
    650648      <Position25>
    651         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    652         <Caret Line="61" Column="45" TopLine="47"/>
     649        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\1\Lazarus\lcl\include\control.inc"/>
     650        <Caret Line="3726" Column="1" TopLine="3705"/>
    653651      </Position25>
    654652      <Position26>
    655         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    656         <Caret Line="369" Column="74" TopLine="369"/>
     653        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
     654        <Caret Line="292" Column="1" TopLine="271"/>
    657655      </Position26>
    658656      <Position27>
    659         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    660         <Caret Line="298" Column="44" TopLine="285"/>
     657        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
     658        <Caret Line="293" Column="1" TopLine="272"/>
    661659      </Position27>
    662660      <Position28>
    663         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    664         <Caret Line="369" Column="49" TopLine="356"/>
     661        <Filename Value="..\..\Managers\UCDManagerRegions.pas"/>
     662        <Caret Line="69" Column="29" TopLine="50"/>
    665663      </Position28>
    666664      <Position29>
    667         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    668         <Caret Line="62" Column="30" TopLine="47"/>
     665        <Filename Value="..\..\UCDManager.pas"/>
     666        <Caret Line="50" Column="1" TopLine="44"/>
    669667      </Position29>
    670668      <Position30>
    671         <Filename Value="..\..\Managers\UCDManagerTabsPopup.pas"/>
    672         <Caret Line="303" Column="16" TopLine="282"/>
     669        <Filename Value="..\..\UCDManager.pas"/>
     670        <Caret Line="223" Column="16" TopLine="201"/>
    673671      </Position30>
    674672    </JumpHistory>
     
    711709  </CompilerOptions>
    712710  <Debugging>
     711    <BreakPoints Count="1">
     712      <Item1>
     713        <Source Value="..\..\UCDPopupMenu.pas"/>
     714        <Line Value="334"/>
     715      </Item1>
     716    </BreakPoints>
    713717    <Watches Count="1">
    714718      <Item1>
  • Docking/CoolDocking/Managers/UCDManagerRegions.pas

    r198 r207  
    6767    //R := Control.ClientRect;
    6868    //Canvas.FillRect(R);
    69     Header.Visible := ShowHeader;
    70     if ShowHeader then begin
     69    if Visible then begin
    7170      if ControlPanel.DockClientCount = 0 then
    7271        Header.DrawGrabber(Canvas, Control) else
     
    162161
    163162  NewItem.PanelHeader.Parent := DockSite;
    164   NewItem.PanelHeader.Header.Title.Caption := TForm(Control).Caption;
    165163
    166164  NewItem.Control := Control;
     
    290288    PanelHeader.Width := Self.DockSite.Width div
    291289      Self.DockSite.DockClientCount;
     290    PanelHeader.Header.Visible := TCDManager(TWinControl(Control).DockManager).HeaderVisible;
     291    PanelHeader.Header.Title.Caption := TForm(Control).Caption;
    292292    Paint(Self);
    293293    if I < (DockItems.Count - 1) then PanelHeader.Align := BaseAlign
  • Docking/CoolDocking/Managers/UCDManagerTabsPopup.pas

    r205 r207  
    5555    SplitterMouseDrag: Boolean;
    5656    SplitterMousePos: TPoint;
     57    procedure PageControlResize(Sender: TObject);
    5758    procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); override;
    5859    procedure SplitterMouseDown(Sender: TObject; Button: TMouseButton;
     
    6263    procedure SplitterMouseUp(Sender: TObject; Button: TMouseButton;
    6364      Shift: TShiftState; X, Y: Integer);
     65    procedure UpdatePopupFormBounds;
     66    procedure TabControlChange(Sender: TObject); override;
    6467  public
    6568    AutoHideEnabled: Boolean;
     
    7174    procedure PinShowButtonClick(Sender: TObject);
    7275    procedure PinHideButtonClick(Sender: TObject);
    73     procedure TabControlChange(Sender: TObject); override;
    7476    constructor Create(ADockSite: TWinControl); override;
    7577    destructor Destroy; override;
     
    243245    C.Parent := HeaderPanel.ControlPanel;
    244246    HeaderPanel.Header.Title.Caption := C.Caption;
    245     Pos := Point(PageControl.Left, PageControl.Top);
    246 
    247     TopParent := DockSite;
    248     while Assigned(TopParent.Parent) do begin
    249       Pos.X := Pos.X + TopParent.Left;;
    250       Pos.Y := Pos.Y + TopParent.Top;
    251       TopParent := TopParent.Parent;
    252     end;
    253     PopupForm.Parent := TopParent;
    254247    //AutoHide.Control.Align := alCustom;
    255248    //Pos := DockSite.ClientToScreen(Pos);
    256     C.TBDockHeight := 100;
    257     C.LRDockWidth := 100;
    258     with AutoHide.Control do
    259     case AutoHide.TabPosition of
    260       tpTop: begin
    261         SetBounds(Pos.X, Pos.Y + PageControl.Height,
    262           PageControl.Width, C.TBDockHeight);
    263       end;
    264       tpLeft: begin
    265         SetBounds(Pos.X + PageControl.Width, Pos.Y,
    266           C.LRDockWidth, PageControl.Height);
    267       end;
    268       tpBottom: begin
    269         SetBounds(Pos.X, Pos.Y - C.TBDockHeight,
    270           PageControl.Width, C.TBDockHeight);
    271       end;
    272       tpRight: begin
    273         SetBounds(Pos.X - C.LRDockWidth, Pos.Y,
    274           C.LRDockWidth, PageControl.Height);
    275       end;
    276     end;
    277249    //AutoHide.Control.SetBounds(0, 0, 100, 100);
     250    UpdatePopupFormBounds;
    278251    AutoHide.Show;
    279252  end;
     
    302275  AutoHide := TCDAutoHide.Create;
    303276  AutoHide.Control := PopupForm;
     277  PageControl.OnResize := PageControlResize;
    304278
    305279  for I := 0 to DockItems.Count - 1 do begin
     
    316290  HeaderPanel.Free;
    317291  inherited Destroy;
     292end;
     293
     294procedure TCDManagerTabsPopup.PageControlResize(Sender: TObject);
     295begin
     296  UpdatePopupFormBounds;
    318297end;
    319298
     
    376355    case Splitter.Align of
    377356      alLeft: begin
    378         PopupForm.SetBounds(PopupForm.Left - (X - SplitterMousePos.X),
     357        PopupForm.SetBounds(PopupForm.Left + (X - SplitterMousePos.X),
    379358          PopupForm.Top, PopupForm.Width - (X - SplitterMousePos.X),
    380359          PopupForm.Height);
     
    385364      end;
    386365      alTop: begin
    387         PopupForm.SetBounds(PopupForm.Left,PopupForm.Top + (Y - SplitterMousePos.Y),
    388           PopupForm.Width, PopupForm.Height + (Y - SplitterMousePos.Y));
     366        PopupForm.SetBounds(PopupForm.Left, PopupForm.Top + (Y - SplitterMousePos.Y),
     367          PopupForm.Width, PopupForm.Height - (Y - SplitterMousePos.Y));
    389368      end;
    390369      alBottom: begin
     
    400379begin
    401380  SplitterMouseDrag := False;
     381end;
     382
     383procedure TCDManagerTabsPopup.UpdatePopupFormBounds;
     384var
     385  Pos: TPoint;
     386  C: TControl;
     387  TopParent: TWinControl;
     388begin
     389  if PageControl.TabIndex <> - 1 then begin
     390    Pos := Point(PageControl.Left, PageControl.Top);
     391    TopParent := DockSite;
     392    while Assigned(TopParent.Parent) do begin
     393      Pos.X := Pos.X + TopParent.Left;;
     394      Pos.Y := Pos.Y + TopParent.Top;
     395      TopParent := TopParent.Parent;
     396    end;
     397    PopupForm.Parent := TopParent;
     398
     399    C := TCDManagerTabsPopupItem(DockItems[PageControl.TabIndex]).Control;
     400    C.TBDockHeight := 100;
     401    C.LRDockWidth := 100;
     402    with AutoHide.Control do
     403    case AutoHide.TabPosition of
     404      tpTop: begin
     405        SetBounds(Pos.X, Pos.Y + PageControl.Height,
     406          PageControl.Width, C.TBDockHeight);
     407      end;
     408      tpLeft: begin
     409        SetBounds(Pos.X + PageControl.Width, Pos.Y,
     410          C.LRDockWidth, PageControl.Height);
     411      end;
     412      tpBottom: begin
     413        SetBounds(Pos.X, Pos.Y - C.TBDockHeight,
     414          PageControl.Width, C.TBDockHeight);
     415      end;
     416      tpRight: begin
     417        SetBounds(Pos.X - C.LRDockWidth, Pos.Y,
     418          C.LRDockWidth, PageControl.Height);
     419      end;
     420    end;
     421  end;
    402422end;
    403423
     
    411431  case AValue of
    412432    hpTop, hpAuto: begin
    413       Align := alTop;
    414       Height := 24;
     433      //Align := alTop;
     434      //Height := 24;
    415435      Splitter.Align := alBottom;
    416436      Splitter.Height := SplitterSize;
     
    418438    end;
    419439    hpBottom: begin
    420       Align := alBottom;
    421       Height := 24;
     440      //Align := alBottom;
     441      //Height := 24;
    422442      Splitter.Align := alTop;
    423443      Splitter.Height := SplitterSize;
     
    425445    end;
    426446    hpLeft: begin
    427       Align := alLeft;
    428       Width := 24;
     447      //Align := alLeft;
     448      //Width := 24;
    429449      Splitter.Align := alRight;
    430450      Splitter.Width := SplitterSize;
     
    432452    end;
    433453    hpRight: begin
    434       Align := alRight;
    435       Width := 24;
     454      //Align := alRight;
     455      //Width := 24;
    436456      Splitter.Align := alLeft;
    437457      Splitter.Width := SplitterSize;
  • Docking/CoolDocking/UCDManager.pas

    r199 r207  
    4848  private
    4949    FHeaderPos: THeaderPos;
    50     FShowHeader: Boolean;
     50    function GetHeaderVisible: Boolean;
    5151    procedure SetHeaderPos(const AValue: THeaderPos);
     52    procedure SetHeaderVisible(const AValue: Boolean);
    5253  public
    5354    Header: TCDHeader;
    5455    ControlPanel: TPanel;
    55     property ShowHeader: Boolean read FShowHeader write FShowHeader;
    5656    property HeaderPos: THeaderPos read FHeaderPos write SetHeaderPos;
     57    property HeaderVisible: Boolean read GetHeaderVisible write SetHeaderVisible;
    5758    constructor Create(TheOwner: TComponent);
    5859    destructor Destroy; override;
     
    8182    FDockSite: TWinControl;
    8283    FHeaderPos: THeaderPos;
     84    FHeaderVisible: Boolean;
    8385    function GetDockSite: TWinControl;
    8486    function GetMoveDuration: Integer;
    8587    procedure SetDockStyle(const AValue: TCDStyleType);
     88    procedure SetHeaderVisible(const AValue: Boolean);
    8689    procedure SetMoveDuration(const AValue: Integer);
    8790    procedure SetVisible(const AValue: Boolean);
     
    129132    property DockSite: TWinControl read GetDockSite;
    130133    property HeaderPos: THeaderPos read GetHeaderPos write SetHeaderPos;
     134    property HeaderVisible: Boolean read FHeaderVisible write SetHeaderVisible;
    131135    property Visible: Boolean write SetVisible;
    132136  end;
     
    173177  FHeaderPos:=AValue;
    174178  //Paint(Self);
     179end;
     180
     181function TCDPanelHeader.GetHeaderVisible: Boolean;
     182begin
     183  Result := Header.Visible;
     184end;
     185
     186procedure TCDPanelHeader.SetHeaderVisible(const AValue: Boolean);
     187begin
     188  Header.Visible := AValue;
    175189end;
    176190
     
    185199  Align := alClient;
    186200
    187   ShowHeader := True;
    188201  ControlPanel := TPanel.Create(Self);
    189202  with ControlPanel do begin
     
    200213  with Header do begin
    201214    Parent := Self;
    202     Visible := ShowHeader;
     215    Visible := True;
    203216    Align := alTop;
    204217    Height := GrabberSize;
     
    208221  //BevelInner := bvNone;
    209222  //BevelOuter := bvNone;
     223  HeaderVisible := True;
    210224end;
    211225
     
    330344
    331345  FDockStyle := dsList; // dsNone
     346  FHeaderVisible := True;
    332347  PopupMenu := TCDPopupMenu.Create(Self);
    333348  PopupMenu.Parent := ADockSite;
     
    536551    NewManager.UpdateClientSize;
    537552  end;
     553end;
     554
     555procedure TCDManager.SetHeaderVisible(const AValue: Boolean);
     556begin
     557  if FHeaderVisible = AValue then Exit;
     558  FHeaderVisible := AValue;
     559  if Assigned(DockSite.HostDockSite) then
     560    TCDManager(DockSite.HostDockSite.DockManager).UpdateClientSize;
    538561end;
    539562
  • Docking/CoolDocking/UCDPopupMenu.pas

    r198 r207  
    1616  private
    1717    procedure PopupExecute(Sender: TObject);
     18    procedure PopupMenuHeaderVisibleClick(Sender: TObject);
    1819  public
    1920    Manager: TCDManagerBase;
     
    2122    StyleMenu: TMenuItem;
    2223    LockedMenu: TMenuItem;
     24    HeaderVisibleMenu: TMenuItem;
    2325    constructor Create(AManager: TCDManagerBase);
    2426    procedure UncheckMenuGroup(Item: TMenuItem);
     
    6365  SRenameWindow = 'Rename window';
    6466  SLocked = 'Locked';
    65 
     67  SHeaderVisible = 'Header visible';
    6668
    6769{ TCDPopupMenu }
     
    8284  PositionMenu.Items[Integer(TCDManager(Manager).HeaderPos)].Checked := True;;
    8385  LockedMenu.Checked := TCDManager(Manager).Locked;
     86  HeaderVisibleMenu.Checked := TCDManager(Manager).HeaderVisible;
    8487end;
    8588
     
    173176  LockedMenu.OnClick := PopupMenuLockedClick;
    174177  Items.Add(LockedMenu);
     178
     179  HeaderVisibleMenu := TMenuItem.Create(Self);
     180  HeaderVisibleMenu.Caption := SHeaderVisible;
     181  HeaderVisibleMenu.OnClick := PopupMenuHeaderVisibleClick;
     182  Items.Add(HeaderVisibleMenu);
    175183end;
    176184
     
    323331end;
    324332
     333procedure TCDPopupMenu.PopupMenuHeaderVisibleClick(Sender: TObject);
     334begin
     335  if PopupComponent is TPageControl then
     336  with TPageControl(PopupComponent) do begin
     337    TCDManagerTabs(Manager).HeaderVisible := not TCDManagerTabs(Manager).HeaderVisible;
     338  end else
     339  if PopupComponent is TCDHeader then
     340  with TCDHeader(PopupComponent) do begin
     341    TCDManagerTabs(Manager).HeaderVisible := not TCDManagerTabs(Manager).HeaderVisible;
     342  end;
     343end;
     344
    325345procedure TCDPopupMenu.PopupMenuListClick(Sender: TObject);
    326346begin
  • Docking/CoolDocking/languages/UCDPopupMenu.po

    r198 r207  
    3232#: ucdpopupmenu.senternewwindowname
    3333msgid "Enter new window name"
     34msgstr ""
     35
     36#: ucdpopupmenu.sheadervisible
     37msgid "Header visible"
    3438msgstr ""
    3539
Note: See TracChangeset for help on using the changeset viewer.