mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +02:00
SrcEdit / Tab-Menu: via ctrl-right
git-svn-id: trunk@36265 -
This commit is contained in:
parent
ddeeb78f1a
commit
33afd9a994
@ -708,6 +708,7 @@ type
|
||||
mbaZoomReset,
|
||||
mbaContextMenu,
|
||||
mbaContextMenuDebug,
|
||||
mbaContextMenuTab,
|
||||
|
||||
// Old values, needed to load old config
|
||||
moTCLNone, moTMIgnore,
|
||||
@ -716,7 +717,7 @@ type
|
||||
moTCLJumpOrBlock
|
||||
);
|
||||
|
||||
TMouseOptButtonAction = mbaNone..mbaContextMenuDebug;
|
||||
TMouseOptButtonAction = mbaNone..mbaContextMenuTab;
|
||||
|
||||
const
|
||||
MouseOptButtonActionOld: Array [moTCLNone..moTCLJumpOrBlock] of TMouseOptButtonActionOld = (
|
||||
@ -917,7 +918,7 @@ type
|
||||
property TextAltRightClick: TMouseOptButtonAction read FTextAltRightClick write FTextAltRightClick
|
||||
default mbaNone;
|
||||
property TextCtrlRightClick: TMouseOptButtonAction read FTextCtrlRightClick write FTextCtrlRightClick
|
||||
default mbaNone;
|
||||
default mbaContextMenuTab;
|
||||
property TextShiftAltRightClick: TMouseOptButtonAction read FTextShiftAltRightClick write FTextShiftAltRightClick
|
||||
default mbaNone;
|
||||
property TextShiftCtrlRightClick: TMouseOptButtonAction read FTextShiftCtrlRightClick write FTextShiftCtrlRightClick
|
||||
@ -2613,7 +2614,7 @@ begin
|
||||
FTextRightClick := mbaContextMenu;
|
||||
FTextAltCtrlRightClick := mbaNone;
|
||||
FTextAltRightClick := mbaNone;
|
||||
FTextCtrlRightClick := mbaNone;
|
||||
FTextCtrlRightClick := mbaContextMenuTab;
|
||||
FTextShiftAltCtrlRightClick := mbaNone;
|
||||
FTextShiftAltRightClick := mbaNone;
|
||||
FTextShiftCtrlRightClick := mbaNone;
|
||||
@ -2752,6 +2753,8 @@ procedure TEditorMouseOptions.ResetTextToDefault;
|
||||
AddCommand(emcContextMenu, AMoveCaret, AButton, AClickCount, ADir, AShift, AShiftMask, emcoSelectionCaretMoveNever);
|
||||
mbaContextMenuDebug:
|
||||
AddCommand(emcContextMenu, True, AButton, AClickCount, ADir, AShift, AShiftMask, emcoSelectionCaretMoveOutside, 0, 1);
|
||||
mbaContextMenuTab:
|
||||
AddCommand(emcContextMenu, True, AButton, AClickCount, ADir, AShift, AShiftMask, emcoSelectionCaretMoveOutside, 0, 2);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -3005,7 +3008,7 @@ begin
|
||||
FTextCtrlDoubleLeftClick := Src.TextCtrlDoubleLeftClick;
|
||||
// left + modifier click
|
||||
FTextAltLeftClick := Src.TextAltLeftClick;
|
||||
FTextCtrlLeftClick := Src.TextCtrlLeftClick;
|
||||
FTextCtrlLeftClick := Src.TextCtrlLeftClick;
|
||||
FTextAltCtrlLeftClick := Src.TextAltCtrlLeftClick;
|
||||
FTextShiftLeftClick := Src.TextShiftLeftClick;
|
||||
FTextShiftAltLeftClick := Src.TextShiftAltLeftClick;
|
||||
|
@ -573,6 +573,7 @@ procedure TEditorMouseOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
||||
ACombo.Items.Add(dlfMouseSimpleButtonZoomReset); // mbaZoomReset
|
||||
ACombo.Items.Add(dlfMouseSimpleButtonContextMenu); // mbaContextMenu
|
||||
ACombo.Items.Add(dlfMouseSimpleButtonContextMenuDbg); // mbaContextMenuDebug;
|
||||
ACombo.Items.Add(dlfMouseSimpleButtonContextMenuTab); // mbaContextMenuTab;
|
||||
end;
|
||||
|
||||
procedure SetupWheelCombo(ACombo: TComboBox);
|
||||
|
@ -1415,6 +1415,7 @@ resourcestring
|
||||
dlfMouseSimpleButtonZoomReset = 'Reset zoom';
|
||||
dlfMouseSimpleButtonContextMenu = 'Context Menu';
|
||||
dlfMouseSimpleButtonContextMenuDbg = 'Context Menu (debug)';
|
||||
dlfMouseSimpleButtonContextMenuTab = 'Context Menu (tab)';
|
||||
|
||||
dlfMouseSimpleWheelNothing = 'Nothing/Default';
|
||||
dlfMouseSimpleWheelSrollDef = 'Scroll (System speed)';
|
||||
|
@ -4556,6 +4556,7 @@ begin
|
||||
|
||||
case AnAction.Option2 of
|
||||
1: FMouseActionPopUpMenu := SourceNotebook.DbgPopUpMenu;
|
||||
2: FMouseActionPopUpMenu := SourceNotebook.TabPopUpMenu;
|
||||
else
|
||||
FMouseActionPopUpMenu := PopupMenu;
|
||||
end;
|
||||
@ -5424,13 +5425,14 @@ begin
|
||||
SourceTabMenuRoot.BeginUpdate;
|
||||
try
|
||||
// Get the tab that was clicked
|
||||
Assert(PopM.PopupComponent is TPageControl, 'PopupComponent is not TPageControl');
|
||||
PageCtrl:=TPageControl(PopM.PopupComponent);
|
||||
PageI:=PageCtrl.TabIndexAtClientPos(PageCtrl.ScreenToClient(PopM.PopupPoint));
|
||||
if (PageI>=0) and (PageI<PageCtrl.PageCount) then
|
||||
PageIndex:=PageI
|
||||
else
|
||||
DebugLn(['TSourceNotebook.TabPopUpMenuPopup: Popup PageIndex=', PageI]);
|
||||
if PopM.PopupComponent is TPageControl then begin
|
||||
PageCtrl:=TPageControl(PopM.PopupComponent);
|
||||
PageI:=PageCtrl.TabIndexAtClientPos(PageCtrl.ScreenToClient(PopM.PopupPoint));
|
||||
if (PageI>=0) and (PageI<PageCtrl.PageCount) then
|
||||
PageIndex:=PageI // Todo: This should be in MouseDown / or both, whichever is first
|
||||
else
|
||||
DebugLn(['TSourceNotebook.TabPopUpMenuPopup: Popup PageIndex=', PageI]);
|
||||
end;
|
||||
ASrcEdit:=Editors[PageIndex];
|
||||
|
||||
{$IFnDEF SingleSrcWindow}
|
||||
|
Loading…
Reference in New Issue
Block a user