IDE: In TDiskDiffsDlg fix tab order, disable WantTabs in SynEdit, use OnSelectionChange instead of OnMouseUp (works with keyboard). Issue #28224, patch from Ondrej Pokorny

git-svn-id: trunk@49239 -
This commit is contained in:
juha 2015-06-01 22:30:48 +00:00
parent a837dfe757
commit 0e34a7e352
2 changed files with 71 additions and 163 deletions

View File

@ -11,7 +11,7 @@ object DiskDiffsDlg: TDiskDiffsDlg
OnClose = FormClose
OnKeyDown = DiskDiffsDlgKeyDown
Position = poScreenCenter
LCLVersion = '0.9.29'
LCLVersion = '1.5'
object FilesListBox: TListBox
Left = 6
Height = 86
@ -21,14 +21,13 @@ object DiskDiffsDlg: TDiskDiffsDlg
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 0
OnMouseUp = FilesListBoxMouseUp
OnSelectionChange = FilesListBoxSelectionChange
TabOrder = 0
TopIndex = -1
end
inline DiffSynEdit: TSynEdit
AnchorSideBottom.Control = CheckDiskChangesWithLoadingCheckBox
Left = 6
Height = 182
Height = 193
Top = 97
Width = 588
Align = alTop
@ -44,53 +43,27 @@ object DiskDiffsDlg: TDiskDiffsDlg
TabOrder = 1
BookMarkOptions.Xoffset = -18
Gutter.Visible = False
Gutter.Width = 57
Gutter.Width = 59
Gutter.MouseActions = <
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccAny
ClickDir = cdDown
Command = 13
MoveCaret = False
Option = 0
Priority = 0
Command = emcOnMainGutterClick
end
item
Shift = []
ShiftMask = []
Button = mbRight
ClickCount = ccSingle
ClickDir = cdUp
Command = 12
MoveCaret = False
Option = 0
Priority = 0
Command = emcContextMenu
end>
RightGutter.Width = 0
RightGutter.MouseActions = <
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccAny
ClickDir = cdDown
Command = 13
MoveCaret = False
Option = 0
Priority = 0
Command = emcOnMainGutterClick
end
item
Shift = []
ShiftMask = []
Button = mbRight
ClickCount = ccSingle
ClickDir = cdUp
Command = 12
MoveCaret = False
Option = 0
Priority = 0
Command = emcContextMenu
end>
Highlighter = SynDiffSyn1
Keystrokes = <
@ -416,138 +389,104 @@ object DiskDiffsDlg: TDiskDiffsDlg
end>
MouseActions = <
item
Shift = []
ShiftMask = [ssShift, ssAlt]
Button = mbLeft
ClickCount = ccSingle
ClickDir = cdDown
Command = 1
Command = emcStartSelections
MoveCaret = True
Option = 0
Priority = 0
end
item
Shift = [ssShift]
ShiftMask = [ssShift, ssAlt]
Button = mbLeft
ClickCount = ccSingle
ClickDir = cdDown
Command = 1
Command = emcStartSelections
MoveCaret = True
Option = 1
Priority = 0
end
item
Shift = [ssAlt]
ShiftMask = [ssShift, ssAlt]
Button = mbLeft
ClickCount = ccSingle
ClickDir = cdDown
Command = 3
Command = emcStartColumnSelections
MoveCaret = True
Option = 0
Priority = 0
end
item
Shift = [ssShift, ssAlt]
ShiftMask = [ssShift, ssAlt]
Button = mbLeft
ClickCount = ccSingle
ClickDir = cdDown
Command = 3
Command = emcStartColumnSelections
MoveCaret = True
Option = 1
Priority = 0
end
item
Shift = []
ShiftMask = []
Button = mbRight
ClickCount = ccSingle
ClickDir = cdUp
Command = 12
MoveCaret = False
Option = 0
Priority = 0
Command = emcContextMenu
end
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccDouble
ClickDir = cdDown
Command = 6
Command = emcSelectWord
MoveCaret = True
Option = 0
Priority = 0
end
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccTriple
ClickDir = cdDown
Command = 7
Command = emcSelectLine
MoveCaret = True
Option = 0
Priority = 0
end
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccQuad
ClickDir = cdDown
Command = 8
Command = emcSelectPara
MoveCaret = True
Option = 0
Priority = 0
end
item
Shift = []
ShiftMask = []
Button = mbMiddle
ClickCount = ccSingle
ClickDir = cdDown
Command = 10
Command = emcPasteSelection
MoveCaret = True
Option = 0
Priority = 0
end
item
Shift = [ssCtrl]
ShiftMask = [ssShift, ssAlt, ssCtrl]
Button = mbLeft
ClickCount = ccSingle
ClickDir = cdUp
Command = 11
MoveCaret = False
Option = 0
Priority = 0
Command = emcMouseLink
end>
MouseTextActions = <>
MouseSelActions = <
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccSingle
ClickDir = cdDown
Command = 9
MoveCaret = False
Option = 0
Priority = 0
Command = emcStartDragMove
end>
Lines.Strings = (
'DiffSynEdit'
)
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
SelectedColor.StrikeOutPriority = 50
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
BracketMatchColor.Style = [fsBold]
FoldedCodeColor.Background = clNone
FoldedCodeColor.Foreground = clGray
FoldedCodeColor.FrameColor = clGray
MouseLinkColor.Background = clNone
MouseLinkColor.Foreground = clBlue
LineHighlightColor.Background = clNone
LineHighlightColor.Foreground = clNone
WantTabs = False
inline SynGutterPartList1: TSynGutterPartList
object SynGutterMarks1: TSynGutterMarks
Width = 24
MouseActions = <>
end
object SynGutterLineNumber1: TSynGutterLineNumber
Width = 17
Width = 19
MouseActions = <>
MarkupInfo.Background = clBtnFace
MarkupInfo.Foreground = clNone
@ -558,35 +497,28 @@ object DiskDiffsDlg: TDiskDiffsDlg
end
object SynGutterChanges1: TSynGutterChanges
Width = 4
MouseActions = <>
ModifiedColor = 59900
SavedColor = clGreen
end
object SynGutterSeparator1: TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
MouseActions = <
item
Shift = []
ShiftMask = []
Button = mbRight
ClickCount = ccSingle
ClickDir = cdUp
Command = 16
MoveCaret = False
Option = 0
Priority = 0
Command = emcCodeFoldContextMenu
end
item
Shift = []
ShiftMask = [ssShift]
Button = mbMiddle
ClickCount = ccAny
ClickDir = cdDown
Command = 14
MoveCaret = False
Option = 0
Priority = 0
Command = emcCodeFoldCollaps
end
item
Shift = [ssShift]
@ -594,63 +526,39 @@ object DiskDiffsDlg: TDiskDiffsDlg
Button = mbMiddle
ClickCount = ccAny
ClickDir = cdDown
Command = 14
MoveCaret = False
Command = emcCodeFoldCollaps
Option = 1
Priority = 0
end
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccAny
ClickDir = cdDown
Command = 0
MoveCaret = False
Option = 0
Priority = 0
Command = emcNone
end>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
MouseActionsExpanded = <
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccAny
ClickDir = cdDown
Command = 14
MoveCaret = False
Option = 0
Priority = 0
Command = emcCodeFoldCollaps
end>
MouseActionsCollapsed = <
item
Shift = [ssCtrl]
ShiftMask = [ssCtrl]
Button = mbLeft
ClickCount = ccAny
ClickDir = cdDown
Command = 15
MoveCaret = False
Option = 0
Priority = 0
Command = emcCodeFoldExpand
end
item
Shift = []
ShiftMask = [ssCtrl]
Button = mbLeft
ClickCount = ccAny
ClickDir = cdDown
Command = 15
MoveCaret = False
Command = emcCodeFoldExpand
Option = 1
Priority = 0
end>
end
end
inline SynRightGutterPartList1: TSynRightGutterPartList
end
end
object Splitter: TSplitter
Cursor = crVSplit
@ -665,9 +573,9 @@ object DiskDiffsDlg: TDiskDiffsDlg
AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = BtnPanel
Left = 6
Height = 22
Top = 285
Width = 302
Height = 17
Top = 296
Width = 216
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
Caption = 'CheckDiskChangesWithLoadingCheckBox'
@ -675,39 +583,39 @@ object DiskDiffsDlg: TDiskDiffsDlg
end
object BtnPanel: TPanel
Left = 0
Height = 41
Top = 313
Height = 35
Top = 319
Width = 600
Align = alBottom
AutoSize = True
BevelOuter = bvNone
ClientHeight = 41
ClientHeight = 35
ClientWidth = 600
TabOrder = 4
object RevertAllButton: TButton
Left = 472
Height = 29
Left = 492
Height = 23
Top = 6
Width = 122
Width = 102
Align = alRight
AutoSize = True
BorderSpacing.Around = 6
Caption = 'RevertAllButton'
Default = True
ModalResult = 10
TabOrder = 0
TabOrder = 1
end
object IgnoreDiskChangesButton: TButton
Left = 278
Height = 29
Left = 335
Height = 23
Top = 6
Width = 188
Width = 151
Align = alRight
AutoSize = True
BorderSpacing.Around = 6
Caption = 'IgnoreDiskChangesButton'
ModalResult = 5
TabOrder = 1
TabOrder = 0
end
end
object SynDiffSyn1: TSynDiffSyn

View File

@ -62,8 +62,7 @@ type
SynDiffSyn1: TSynDiffSyn;
procedure DiskDiffsDlgKeyDown(Sender: TObject; var Key: Word;
{%H-}Shift: TShiftState);
procedure FilesListBoxMouseUp(Sender: TOBject; {%H-}Button: TMouseButton;
{%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer);
procedure FilesListBoxSelectionChange(Sender: TObject; User: boolean);
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
private
FPackageList: TStringList;
@ -208,10 +207,11 @@ begin
ModalResult := mrYesToAll;
end;
procedure TDiskDiffsDlg.FilesListBoxMouseUp(Sender: TOBject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure TDiskDiffsDlg.FilesListBoxSelectionChange(Sender: TObject;
User: boolean);
begin
ShowDiff;
if User then
ShowDiff;
end;
procedure TDiskDiffsDlg.FormClose(Sender: TObject; var CloseAction: TCloseAction);