Ignore:
Timestamp:
Mar 9, 2011, 2:11:40 PM (14 years ago)
Author:
george
Message:
  • Added: Default layout initialization in Demo IDE.
  • Fixed: Tab position switching through popup menu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDockPopupMenu.pas

    r181 r182  
    1515  TCoolDockPopupMenu = class(TPopupMenu)
    1616  public
    17     Manager: TObject; // TCoolDockManager
    18     constructor Create(AManager: TObject);
     17    Manager: TCoolDockManagerBase;
     18    constructor Create(AManager: TCoolDockManagerBase);
    1919    procedure PopupMenuListClick(Sender: TObject);
    2020    procedure PopupMenuTabsClick(Sender: TObject);
     
    5959{ TCoolDockPopupMenu }
    6060
    61 constructor TCoolDockPopupMenu.Create(AManager: TObject);
     61constructor TCoolDockPopupMenu.Create(AManager: TCoolDockManagerBase);
    6262var
    6363  NewMenuItem: TMenuItem;
     
    198198procedure TCoolDockPopupMenu.PopupMenuPositionAutoClick(Sender: TObject);
    199199begin
    200   TCoolDockManager(Manager).HeaderPos := hpAuto;
     200  if PopupComponent is TPageControl then
     201  with TPageControl(PopupComponent) do begin
     202    TCoolDockStyleTabs(TCoolDockManager(Manager).DockStyleHandler).TabsPos := hpAuto;
     203  end else
     204  if PopupComponent is TCoolDockHeader then
     205  with TCoolDockHeader(PopupComponent) do begin
     206    TCoolDockManager(Manager).HeaderPos := hpAuto;
     207  end;
    201208end;
    202209
    203210procedure TCoolDockPopupMenu.PopupMenuPositionLeftClick(Sender: TObject);
    204 var
    205   Control: TControl;
    206 begin
    207   Control := FindLCLControl(Mouse.CursorPos);
    208   TCoolDockManager(Manager).HeaderPos := hpLeft;
     211begin
     212  if PopupComponent is TPageControl then
     213  with TPageControl(PopupComponent) do begin
     214    TCoolDockStyleTabs(TCoolDockManager(Manager).DockStyleHandler).TabsPos := hpLeft;
     215  end else
     216  if PopupComponent is TCoolDockHeader then
     217  with TCoolDockHeader(PopupComponent) do begin
     218    TCoolDockManager(Manager).HeaderPos := hpLeft;
     219  end;
    209220end;
    210221
    211222procedure TCoolDockPopupMenu.PopupMenuPositionRightClick(Sender: TObject);
    212223begin
    213   TCoolDockManager(Manager).HeaderPos := hpRight;
     224  if PopupComponent is TPageControl then
     225  with TPageControl(PopupComponent) do begin
     226    TCoolDockStyleTabs(TCoolDockManager(Manager).DockStyleHandler).TabsPos := hpRight;
     227  end else
     228  if PopupComponent is TCoolDockHeader then
     229  with TCoolDockHeader(PopupComponent) do begin
     230    TCoolDockManager(Manager).HeaderPos := hpRight;
     231  end;
    214232end;
    215233
    216234procedure TCoolDockPopupMenu.PopupMenuPositionTopClick(Sender: TObject);
    217235begin
    218   TCoolDockManager(Manager).HeaderPos := hpTop;
     236  if PopupComponent is TPageControl then
     237  with TPageControl(PopupComponent) do begin
     238    TCoolDockStyleTabs(TCoolDockManager(Manager).DockStyleHandler).TabsPos := hpTop;
     239  end else
     240  if PopupComponent is TCoolDockHeader then
     241  with TCoolDockHeader(PopupComponent) do begin
     242    TCoolDockManager(Manager).HeaderPos := hpTop;
     243  end;
    219244end;
    220245
    221246procedure TCoolDockPopupMenu.PopupMenuPositionBottomClick(Sender: TObject);
    222247begin
    223   TCoolDockManager(Manager).HeaderPos := hpBottom;
     248  if PopupComponent is TPageControl then
     249  with TPageControl(PopupComponent) do begin
     250    TCoolDockStyleTabs(TCoolDockManager(Manager).DockStyleHandler).TabsPos := hpBottom;
     251  end else
     252  if PopupComponent is TCoolDockHeader then
     253  with TCoolDockHeader(PopupComponent) do begin
     254    TCoolDockManager(Manager).HeaderPos := hpBottom;
     255  end;
    224256end;
    225257
Note: See TracChangeset for help on using the changeset viewer.