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,
InputHistory, LazarusIDEStrConsts, BaseDebugManager, Debugger, FileCtrl,
LCLType, LCLLinux, TypInfo, LResources, LazConf, EnvironmentOpts,
SourceEditProcs;
SourceEditProcs, SortSelectionDlg;
type
TSourceNoteBook = class;
@ -234,6 +234,7 @@ type
procedure TabsToSpacesInSelection;
procedure CommentSelection;
procedure UncommentSelection;
procedure SortSelection;
procedure SelectToBrace;
procedure SelectCodeBlock;
procedure SelectLine;
@ -1013,7 +1014,10 @@ Begin
ecSelectionUnComment:
UncommentSelection;
ecSelectionSort:
SortSelection;
ecSelectToBrace:
SelectToBrace;
@ -1248,6 +1252,19 @@ begin
FEditor.EndUpdate;
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;
begin
EditorComponent.SelectToBrace;