mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 12:30:36 +02:00
anchordocking: popup menu for pages: move left, right, leftmost, rightmost
git-svn-id: trunk@26055 -
This commit is contained in:
parent
273c00afd1
commit
2e6532e101
@ -178,6 +178,10 @@ type
|
|||||||
procedure PopupMenuPopup(Sender: TObject); virtual;
|
procedure PopupMenuPopup(Sender: TObject); virtual;
|
||||||
procedure CloseButtonClick(Sender: TObject); virtual;
|
procedure CloseButtonClick(Sender: TObject); virtual;
|
||||||
procedure ChangeLockButtonClick(Sender: TObject); virtual;
|
procedure ChangeLockButtonClick(Sender: TObject); virtual;
|
||||||
|
procedure MoveLeftButtonClick(Sender: TObject); virtual;
|
||||||
|
procedure MoveLeftMostButtonClick(Sender: TObject); virtual;
|
||||||
|
procedure MoveRightButtonClick(Sender: TObject); virtual;
|
||||||
|
procedure MoveRightMostButtonClick(Sender: TObject); virtual;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
procedure UpdateDockCaption(Exclude: TControl = nil); override;
|
procedure UpdateDockCaption(Exclude: TControl = nil); override;
|
||||||
@ -3864,6 +3868,21 @@ begin
|
|||||||
ChangeLockItem.Checked:=not DockMaster.AllowDragging;
|
ChangeLockItem.Checked:=not DockMaster.AllowDragging;
|
||||||
ChangeLockItem.ShowAlwaysCheckable:=true;
|
ChangeLockItem.ShowAlwaysCheckable:=true;
|
||||||
|
|
||||||
|
if PageIndex>0 then
|
||||||
|
DockMaster.AddPopupMenuItem('MoveLeftMenuItem', adrsMovePageLeft,
|
||||||
|
@MoveLeftButtonClick);
|
||||||
|
if PageIndex>1 then
|
||||||
|
DockMaster.AddPopupMenuItem('MoveLeftMostMenuItem', adrsMovePageLeftmost,
|
||||||
|
@MoveLeftMostButtonClick);
|
||||||
|
|
||||||
|
if PageIndex<PageCount-1 then
|
||||||
|
DockMaster.AddPopupMenuItem('MoveRightMenuItem', adrsMovePageRight,
|
||||||
|
@MoveRightButtonClick);
|
||||||
|
if PageIndex<PageCount-2 then
|
||||||
|
DockMaster.AddPopupMenuItem('MoveRightMostMenuItem', adrsMovePageRightmost,
|
||||||
|
@MoveRightMostButtonClick);
|
||||||
|
|
||||||
|
|
||||||
// close
|
// close
|
||||||
ContainsMainForm:=IsParentOf(Application.MainForm);
|
ContainsMainForm:=IsParentOf(Application.MainForm);
|
||||||
if ContainsMainForm then
|
if ContainsMainForm then
|
||||||
@ -3888,6 +3907,30 @@ begin
|
|||||||
DockMaster.AllowDragging:=not DockMaster.AllowDragging;
|
DockMaster.AllowDragging:=not DockMaster.AllowDragging;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TAnchorDockPageControl.MoveLeftButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if PageIndex>0 then
|
||||||
|
Page[PageIndex].PageIndex:=Page[PageIndex].PageIndex-1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TAnchorDockPageControl.MoveLeftMostButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if PageIndex>0 then
|
||||||
|
Page[PageIndex].PageIndex:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TAnchorDockPageControl.MoveRightButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if PageIndex<PageCount-1 then
|
||||||
|
Page[PageIndex].PageIndex:=Page[PageIndex].PageIndex+1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TAnchorDockPageControl.MoveRightMostButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if PageIndex<PageCount-1 then
|
||||||
|
Page[PageIndex].PageIndex:=PageCount-1;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TAnchorDockPageControl.UpdateDockCaption(Exclude: TControl);
|
procedure TAnchorDockPageControl.UpdateDockCaption(Exclude: TControl);
|
||||||
begin
|
begin
|
||||||
if Exclude=nil then ;
|
if Exclude=nil then ;
|
||||||
|
@ -36,6 +36,8 @@ interface
|
|||||||
resourcestring
|
resourcestring
|
||||||
adrsClose = 'Close';
|
adrsClose = 'Close';
|
||||||
adrsQuit = 'Quit %s';
|
adrsQuit = 'Quit %s';
|
||||||
|
adrsMovePageRight = 'Move page right';
|
||||||
|
adrsMovePageRightmost = 'Move page rightmost';
|
||||||
adrsUndock = 'Undock';
|
adrsUndock = 'Undock';
|
||||||
adrsHeaderPosition = 'Header position';
|
adrsHeaderPosition = 'Header position';
|
||||||
adrsEnlargeSide = 'Enlarge %s side';
|
adrsEnlargeSide = 'Enlarge %s side';
|
||||||
@ -47,6 +49,8 @@ resourcestring
|
|||||||
adrsRight = 'right';
|
adrsRight = 'right';
|
||||||
adrsBottom = 'bottom';
|
adrsBottom = 'bottom';
|
||||||
adrsLocked = 'Locked';
|
adrsLocked = 'Locked';
|
||||||
|
adrsMovePageLeft = 'Move page left';
|
||||||
|
adrsMovePageLeftmost = 'Move page leftmost';
|
||||||
adrsRequestedButCreated = '%s requested, but %s created';
|
adrsRequestedButCreated = '%s requested, but %s created';
|
||||||
adrsDragAndDockC = 'Drag and dock %c';
|
adrsDragAndDockC = 'Drag and dock %c';
|
||||||
adrsMissingControlName = 'missing control name';
|
adrsMissingControlName = 'missing control name';
|
||||||
|
Loading…
Reference in New Issue
Block a user