Ignore:
Timestamp:
Apr 26, 2012, 9:12:02 AM (12 years ago)
Author:
chronos
Message:
  • Added: CoolDocking text logging support.
  • Added: CoolDocking update locking on TCDManager descendants update. This fixes tab disappear if tab with regions style conjoinform was switched to another tab.
  • Modified: CoolDocking regions style item layout changed to support aligned forms. Only one region is aligned as alClient. Rest contained regions are aligned to borders.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/Managers/UCDManagerTabs.pas

    r253 r354  
    4444    TabImageList: TImageList;
    4545    PageControl: TPageControl;
    46     procedure UpdateClientSize; override;
     46    procedure Update; override;
    4747    procedure SetHeaderPos(const AValue: THeaderPos); override;
    4848    procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); virtual;
     
    8282  Temp2: TControl;
    8383begin
     84  DebugLog('TCDManagerTabsItem.VisibleChange');
    8485  with TCDManagerTabs(Manager) do begin
    8586    if TControl(Sender).Visible then begin
    86       UpdateClientSize;
     87      Update;
    8788      Switch(DockItems.IndexOf(FindControlInPanels(TControl(Sender))));
    8889      TCDManagerTabsItem(DockItems[DockItems.IndexOf(
    8990        FindControlInPanels(TControl(Sender)))]).HideType := dhtPermanent;
    90     end else UpdateClientSize;
     91    end else Update;
    9192  end;
    9293
     
    143144procedure TCDManagerTabs.TabControlChange(Sender: TObject);
    144145begin
    145   UpdateClientSize;
     146  DebugLog('TCDManagerTabs.TabControlChange ' + IntToStr(PageControl.TabIndex));
     147  Update;
    146148  MouseDownSkip := True;
    147149end;
     
    189191    OnChange := TabControlChange;
    190192    MultiLine := True;
     193    AutoSize := True;
    191194    PopupMenu := Self.PopupMenu;
    192195    OnMouseLeave := TabControlMouseLeave;
     
    225228procedure TCDManagerTabs.Switch(Index: Integer);
    226229begin
     230  DebugLog('TCDManagerTabs.Switch ' + IntToStr(Index));
    227231  PageControl.TabIndex := Index;
    228232end;
     
    265269  end; //else raise Exception.Create(Format('Control %s not found in DockItems', [Control.Name]));
    266270
    267   ManagerItem.Control.Visible := False;
     271  //ManagerItem.Control.Visible := False;
    268272  ManagerItem.Control.Parent := nil;
    269273  DockItems.Remove(ManagerItem);
     
    279283      end else TCDManagerItem(DockItems[0]).Control.ManualFloat(Rect(Left, Top, Left + Width, Top + Height));
    280284      ManualFloat(Rect(Left, Top, Left + Width, Top + Height));
    281       //UpdateClientSize;
     285      //Update;
    282286      inherited RemoveControl(Control);
    283287      Free;
     
    286290  end;
    287291  //if ClientCount > 0 then
    288   UpdateClientSize;
     292  Update;
    289293  inherited RemoveControl(Control);
    290294end;
     
    341345  inherited;
    342346  InsertControlNoUpdate(AControl, InsertAt);
    343   UpdateClientSize;
    344 end;
    345 
    346 procedure TCDManagerTabs.UpdateClientSize;
     347  Update;
     348end;
     349
     350procedure TCDManagerTabs.Update;
    347351var
    348352  I: Integer;
     
    350354  DeletedPage: TTabSheet;
    351355begin
     356  if FUpdateCount = 0 then begin
     357  DebugLog('TCDManagerTabs.Update');
    352358  for I := 0 to DockItems.Count - 1 do
    353359  with TCDManagerTabsItem(DockItems[I]) do begin
     
    407413    //TCDClientPanel(FDockPanels[I]).DockPanelPaint(Self);
    408414  end;
    409   inherited UpdateClientSize;
     415  end;
     416  inherited;
    410417end;
    411418
Note: See TracChangeset for help on using the changeset viewer.