Ignore:
Timestamp:
Dec 9, 2010, 2:15:54 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Rozdělení zobrazovaných stylů do více jednotek.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDockStyleRegions.pas

    r89 r97  
    1 unit UCoolDockStyleRegions; 
     1unit UCoolDockStyleRegions;
    22
    3 {$mode objfpc}{$H+}
     3{$mode Delphi}{$H+}
    44
    55interface
    66
    77uses
    8   Classes, SysUtils;
     8  Classes, SysUtils, Controls, ExtCtrls, StdCtrls, UCoolDockStyle,
     9  Graphics, Contnrs, Buttons, UCoolDockClientPanel;
     10
     11type
     12  TCoolDockStyleRegionsPanel = class(TPanel)
     13
     14  end;
     15
     16  { TCoolDockStyleRegions }
     17
     18  TCoolDockStyleRegions = class(TCoolDockStyle)
     19    Header: TCoolDockHeader;
     20    Panels: TObjectList; // TObjectList<TCoolDockStyleRegionsPanel>
     21    constructor Create(AManager: TObject);
     22    destructor Destroy; override;
     23    procedure UpdateClientSize; override;
     24  end;
    925
    1026implementation
    1127
     28uses
     29  UCoolDocking;
     30
     31
     32{ TCoolDockStyleRegions }
     33
     34constructor TCoolDockStyleRegions.Create(AManager: TObject);
     35var
     36  I: Integer;
     37begin
     38  inherited;
     39  Panels := TObjectList.Create;
     40
     41  with TCoolDockManager(AManager) do
     42  for I := 0 to DockPanels.Count - 1 do begin
     43    if Assigned(TCoolDockClientPanel(DockPanels[I]).Splitter) then
     44    TCoolDockClientPanel(DockPanels[I]).Splitter.Visible := True;
     45    TCoolDockClientPanel(DockPanels[I]).Visible := True;
     46    TCoolDockClientPanel(DockPanels[I]).ClientAreaPanel.Parent := TCoolDockClientPanel(DockPanels[I]);
     47    TCoolDockClientPanel(DockPanels[I]).ClientAreaPanel.Visible := True;
     48    TCoolDockClientPanel(DockPanels[I]).Control.Visible := True;
     49  end;
     50end;
     51
     52destructor TCoolDockStyleRegions.Destroy;
     53begin
     54  Panels.Free;
     55  inherited Destroy;
     56end;
     57
     58procedure TCoolDockStyleRegions.UpdateClientSize;
     59var
     60  I: Integer;
     61begin
     62  inherited UpdateClientSize;
     63  with TCoolDockManager(Manager) do
     64  for I := 0 to DockPanels.Count - 1 do begin
     65    TCoolDockClientPanel(DockPanels[I]).Height := DockSite.Height div
     66      DockSite.DockClientCount;
     67    TCoolDockClientPanel(DockPanels[I]).Width := DockSite.Width div
     68      DockSite.DockClientCount;
     69    //TCoolDockClientPanel(FDockPanels[I]).DockPanelPaint(Self);
     70    TCoolDockClientPanel(DockPanels[I]).DockPanelPaint(Self);
     71  end;
     72end;
     73
     74
     75
    1276end.
    1377
Note: See TracChangeset for help on using the changeset viewer.