mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 09:59:23 +02:00
EditorOptions, Mouse config, added safety check to loading
git-svn-id: trunk@21226 -
This commit is contained in:
parent
c015e291e8
commit
bf5bb6aec3
@ -134,6 +134,7 @@ type
|
|||||||
function GetDisplayName: string; override;
|
function GetDisplayName: string; override;
|
||||||
public
|
public
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
|
procedure Clear;
|
||||||
function IsMatchingShiftState(AShift: TShiftState): Boolean;
|
function IsMatchingShiftState(AShift: TShiftState): Boolean;
|
||||||
function IsMatchingClick(ABtn: TMouseButton; ACCount: TSynMAClickCount;
|
function IsMatchingClick(ABtn: TMouseButton; ACCount: TSynMAClickCount;
|
||||||
ACDir: TSynMAClickDir): Boolean;
|
ACDir: TSynMAClickDir): Boolean;
|
||||||
@ -383,6 +384,19 @@ begin
|
|||||||
TSynEditMouseActions(Collection).AssertNoConflict(self);
|
TSynEditMouseActions(Collection).AssertNoConflict(self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSynEditMouseAction.Clear;
|
||||||
|
begin
|
||||||
|
FCommand := 0;
|
||||||
|
FClickCount := ccSingle;
|
||||||
|
FClickDir := cdUp;
|
||||||
|
FButton := mbLeft;
|
||||||
|
FShift := [];
|
||||||
|
FShiftMask := [];
|
||||||
|
FMoveCaret := False;
|
||||||
|
FOption := 0;
|
||||||
|
FPriority := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
function TSynEditMouseAction.IsMatchingShiftState(AShift: TShiftState): Boolean;
|
function TSynEditMouseAction.IsMatchingShiftState(AShift: TShiftState): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := AShift * FShiftMask = FShift;
|
Result := AShift * FShiftMask = FShift;
|
||||||
|
@ -2183,6 +2183,7 @@ var
|
|||||||
MAct := TSynEditMouseActionKeyCmdHelper.Create(nil);
|
MAct := TSynEditMouseActionKeyCmdHelper.Create(nil);
|
||||||
c := XMLConfig.GetValue(Path + 'CountDel', 0);
|
c := XMLConfig.GetValue(Path + 'CountDel', 0);
|
||||||
for i := 0 to c - 1 do begin
|
for i := 0 to c - 1 do begin
|
||||||
|
Mact.Clear;
|
||||||
XMLConfig.ReadObject(Path + 'Del' + IntToStr(i) + '/', MAct);
|
XMLConfig.ReadObject(Path + 'Del' + IntToStr(i) + '/', MAct);
|
||||||
j := MActions.IndexOf(MAct, True);
|
j := MActions.IndexOf(MAct, True);
|
||||||
if j >= 0 then MActions.Delete(j);
|
if j >= 0 then MActions.Delete(j);
|
||||||
@ -2193,6 +2194,8 @@ var
|
|||||||
try
|
try
|
||||||
MActions.IncAssertLock;
|
MActions.IncAssertLock;
|
||||||
try
|
try
|
||||||
|
// If the object would ever be extended, old configs will not have all properties.
|
||||||
|
Mact.Clear;
|
||||||
XMLConfig.ReadObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
XMLConfig.ReadObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
||||||
j := MActions.IndexOf(MAct, True);
|
j := MActions.IndexOf(MAct, True);
|
||||||
if j >= 0 then
|
if j >= 0 then
|
||||||
|
@ -581,6 +581,7 @@ var
|
|||||||
try
|
try
|
||||||
MActions.IncAssertLock;
|
MActions.IncAssertLock;
|
||||||
try
|
try
|
||||||
|
Mact.Clear;
|
||||||
xml.ReadObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
xml.ReadObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
||||||
MActions.Add.Assign(MAct);
|
MActions.Add.Assign(MAct);
|
||||||
finally
|
finally
|
||||||
|
Loading…
Reference in New Issue
Block a user