单击装订线左侧时,如何 select SynEdit 中的一行?
How to select a line in SynEdit when clicked on the left in the gutter?
我想 select 单击左边的行,类似于 Delphi 代码编辑器(单击行号,已安装 CNPack)。我想答案在于 selStart、selEnd、smLine selection 模式,但无法制定任何可行的解决方案。
procedure TForm1.SynEdit1GutterClick(Sender: TObject; Button: TMouseButton; X,
Y, Line: Integer; Mark: TSynEditMark);
begin
SynEdit1.SelectionMode := smLine;
SynEdit1.SelStart := 0;
SynEdit1.SelEnd := SynEdit1.Lines[Line].Length;
SynEdit1.SelectionMode := smNormal; //restore
//Code not working
//I don't remember the code which made it select a line with smLine
end;
您可以使用ecSelLineEnd
命令:
SynEdit1.ExecuteCommand(ecSelLineEnd, #0, nil)
在装订线单击事件中。
您需要包括单位SynEditKeyCmds
我想 select 单击左边的行,类似于 Delphi 代码编辑器(单击行号,已安装 CNPack)。我想答案在于 selStart、selEnd、smLine selection 模式,但无法制定任何可行的解决方案。
procedure TForm1.SynEdit1GutterClick(Sender: TObject; Button: TMouseButton; X,
Y, Line: Integer; Mark: TSynEditMark);
begin
SynEdit1.SelectionMode := smLine;
SynEdit1.SelStart := 0;
SynEdit1.SelEnd := SynEdit1.Lines[Line].Length;
SynEdit1.SelectionMode := smNormal; //restore
//Code not working
//I don't remember the code which made it select a line with smLine
end;
您可以使用ecSelLineEnd
命令:
SynEdit1.ExecuteCommand(ecSelLineEnd, #0, nil)
在装订线单击事件中。
您需要包括单位SynEditKeyCmds