added sort selection

git-svn-id: trunk@3032 -
This commit is contained in:
mattias 2002-08-18 08:57:10 +00:00
parent f845ed1836
commit c05c3ff643

View File

@ -49,7 +49,7 @@ uses
Extctrls, Menus, FindInFilesDlg, LMessages, IDEProcs, IDEOptionDefs, Extctrls, Menus, FindInFilesDlg, LMessages, IDEProcs, IDEOptionDefs,
InputHistory, LazarusIDEStrConsts, BaseDebugManager, Debugger, FileCtrl, InputHistory, LazarusIDEStrConsts, BaseDebugManager, Debugger, FileCtrl,
LCLType, LCLLinux, TypInfo, LResources, LazConf, EnvironmentOpts, LCLType, LCLLinux, TypInfo, LResources, LazConf, EnvironmentOpts,
SourceEditProcs; SourceEditProcs, SortSelectionDlg;
type type
TSourceNoteBook = class; TSourceNoteBook = class;
@ -234,6 +234,7 @@ type
procedure TabsToSpacesInSelection; procedure TabsToSpacesInSelection;
procedure CommentSelection; procedure CommentSelection;
procedure UncommentSelection; procedure UncommentSelection;
procedure SortSelection;
procedure SelectToBrace; procedure SelectToBrace;
procedure SelectCodeBlock; procedure SelectCodeBlock;
procedure SelectLine; procedure SelectLine;
@ -1014,6 +1015,9 @@ Begin
ecSelectionUnComment: ecSelectionUnComment:
UncommentSelection; UncommentSelection;
ecSelectionSort:
SortSelection;
ecSelectToBrace: ecSelectToBrace:
SelectToBrace; SelectToBrace;
@ -1248,6 +1252,19 @@ begin
FEditor.EndUpdate; FEditor.EndUpdate;
end; end;
procedure TSourceEditor.SortSelection;
var
SortSelectionDialog: TSortSelectionDialog;
begin
SortSelectionDialog:=TSortSelectionDialog.Create(Application);
SortSelectionDialog.PreviewSynEdit.Highlighter:=EditorComponent.Highlighter;
EditorOpts.GetSynEditSelectedColor(SortSelectionDialog.PreviewSynEdit);
SortSelectionDialog.TheText:=EditorComponent.SelText;
if SortSelectionDialog.ShowModal=mrOk then
EditorComponent.SelText:=SortSelectionDialog.SortedText;
SortSelectionDialog.Free;
end;
procedure TSourceEditor.SelectToBrace; procedure TSourceEditor.SelectToBrace;
begin begin
EditorComponent.SelectToBrace; EditorComponent.SelectToBrace;