mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 16:09:41 +02:00
EditorOptions, Mouse config: Fixed Export, use names for IDE commands
git-svn-id: trunk@21225 -
This commit is contained in:
parent
3c373c5dfa
commit
c015e291e8
@ -515,6 +515,19 @@ type
|
|||||||
Info: PEditorOptionsFoldInfoList;
|
Info: PEditorOptionsFoldInfoList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TSynEditMouseActionKeyCmdHelper }
|
||||||
|
|
||||||
|
TSynEditMouseActionKeyCmdHelper = class(TSynEditMouseAction)
|
||||||
|
private
|
||||||
|
function GetOptionKeyCmd: TSynEditorCommand;
|
||||||
|
procedure SetOptionKeyCmd(const AValue: TSynEditorCommand);
|
||||||
|
published
|
||||||
|
property Option: TSynEditorCommand read GetOptionKeyCmd write SetOptionKeyCmd;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
||||||
EditorOptionsFoldInfoPas: Array [0..19] of TEditorOptionsFoldInfo
|
EditorOptionsFoldInfoPas: Array [0..19] of TEditorOptionsFoldInfo
|
||||||
@ -991,18 +1004,6 @@ const
|
|||||||
lshJScript
|
lshJScript
|
||||||
);
|
);
|
||||||
|
|
||||||
type
|
|
||||||
|
|
||||||
{ TSynEditMouseActionKeyCmdHelper }
|
|
||||||
|
|
||||||
TSynEditMouseActionKeyCmdHelper = class(TSynEditMouseAction)
|
|
||||||
private
|
|
||||||
function GetOptionKeyCmd: TSynEditorCommand;
|
|
||||||
procedure SetOptionKeyCmd(const AValue: TSynEditorCommand);
|
|
||||||
published
|
|
||||||
property Option: TSynEditorCommand read GetOptionKeyCmd write SetOptionKeyCmd;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TSynEditMouseActionKeyCmdHelper }
|
{ TSynEditMouseActionKeyCmdHelper }
|
||||||
|
|
||||||
function TSynEditMouseActionKeyCmdHelper.GetOptionKeyCmd: TSynEditorCommand;
|
function TSynEditMouseActionKeyCmdHelper.GetOptionKeyCmd: TSynEditorCommand;
|
||||||
|
@ -532,18 +532,25 @@ end;
|
|||||||
procedure TEditorMouseOptionsFrame.BtnExportClick(Sender: TObject);
|
procedure TEditorMouseOptionsFrame.BtnExportClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
xml: TRttiXMLConfig;
|
xml: TRttiXMLConfig;
|
||||||
|
MAct: TSynEditMouseActionKeyCmdHelper;
|
||||||
|
|
||||||
Procedure SaveMouseAct(Path: String; MActions: TSynEditMouseActions);
|
Procedure SaveMouseAct(Path: String; MActions: TSynEditMouseActions);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
for i := 0 to MActions.Count - 1 do
|
for i := 0 to MActions.Count - 1 do
|
||||||
|
if MActions[i].Command = emcSynEditCommand then begin
|
||||||
|
MAct.Assign(MActions[i]);
|
||||||
|
xml.WriteObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
||||||
|
end
|
||||||
|
else
|
||||||
xml.WriteObject(Path + 'M' + IntToStr(i) + '/', MActions[i]);
|
xml.WriteObject(Path + 'M' + IntToStr(i) + '/', MActions[i]);
|
||||||
xml.SetValue(Path + 'Count', MActions.Count);
|
xml.SetValue(Path + 'Count', MActions.Count);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if SaveDialog1.Execute then begin
|
if SaveDialog1.Execute then begin
|
||||||
|
MAct := TSynEditMouseActionKeyCmdHelper.Create(nil);
|
||||||
xml := TRttiXMLConfig.CreateClean(SaveDialog1.FileName);
|
xml := TRttiXMLConfig.CreateClean(SaveDialog1.FileName);
|
||||||
SaveMouseAct('Mouse/Main/', FMainActions);
|
SaveMouseAct('Mouse/Main/', FMainActions);
|
||||||
SaveMouseAct('Mouse/MainSel/', FSelActions);
|
SaveMouseAct('Mouse/MainSel/', FSelActions);
|
||||||
@ -554,6 +561,7 @@ begin
|
|||||||
SaveMouseAct('Mouse/GutterLineNum/', FGutterActionsLines);
|
SaveMouseAct('Mouse/GutterLineNum/', FGutterActionsLines);
|
||||||
xml.Flush;
|
xml.Flush;
|
||||||
xml.Free;
|
xml.Free;
|
||||||
|
MAct.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -564,16 +572,17 @@ var
|
|||||||
Procedure LoadMouseAct(Path: String; MActions: TSynEditMouseActions);
|
Procedure LoadMouseAct(Path: String; MActions: TSynEditMouseActions);
|
||||||
var
|
var
|
||||||
i, c: Integer;
|
i, c: Integer;
|
||||||
MAct: TSynEditMouseAction;
|
MAct: TSynEditMouseActionKeyCmdHelper;
|
||||||
begin
|
begin
|
||||||
MActions.Clear;
|
MActions.Clear;
|
||||||
|
MAct := TSynEditMouseActionKeyCmdHelper.Create(nil);
|
||||||
c := xml.GetValue(Path + 'Count', 0);
|
c := xml.GetValue(Path + 'Count', 0);
|
||||||
for i := 0 to c - 1 do begin
|
for i := 0 to c - 1 do begin
|
||||||
try
|
try
|
||||||
MActions.IncAssertLock;
|
MActions.IncAssertLock;
|
||||||
try
|
try
|
||||||
MAct := MActions.Add;
|
|
||||||
xml.ReadObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
xml.ReadObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
||||||
|
MActions.Add.Assign(MAct);
|
||||||
finally
|
finally
|
||||||
MActions.DecAssertLock;
|
MActions.DecAssertLock;
|
||||||
end;
|
end;
|
||||||
@ -585,6 +594,7 @@ var
|
|||||||
mtError, [mbOk], 0);
|
mtError, [mbOk], 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Mact.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user