mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 05:39:14 +02:00
IDE: added insert todo dialog from wile64 and added compilation test for special chars in search paths
git-svn-id: trunk@12393 -
This commit is contained in:
parent
da1f0df41a
commit
b1c8d7a530
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -1917,6 +1917,9 @@ ide/startlazarus.rc svneol=native#text/plain
|
|||||||
ide/sysvaruseroverridedlg.lfm svneol=native#text/plain
|
ide/sysvaruseroverridedlg.lfm svneol=native#text/plain
|
||||||
ide/sysvaruseroverridedlg.lrs svneol=native#text/plain
|
ide/sysvaruseroverridedlg.lrs svneol=native#text/plain
|
||||||
ide/sysvaruseroverridedlg.pas svneol=native#text/pascal
|
ide/sysvaruseroverridedlg.pas svneol=native#text/pascal
|
||||||
|
ide/tododlg.lfm svneol=native#text/plain
|
||||||
|
ide/tododlg.lrs svneol=native#text/plain
|
||||||
|
ide/tododlg.pas svneol=native#text/plain
|
||||||
ide/todolist.lfm svneol=native#text/plain
|
ide/todolist.lfm svneol=native#text/plain
|
||||||
ide/todolist.lrs svneol=native#text/plain
|
ide/todolist.lrs svneol=native#text/plain
|
||||||
ide/todolist.pp svneol=native#text/pascal
|
ide/todolist.pp svneol=native#text/pascal
|
||||||
|
@ -73,6 +73,7 @@ type
|
|||||||
procedure SetMacroList(const AValue: TTransferMacroList);
|
procedure SetMacroList(const AValue: TTransferMacroList);
|
||||||
procedure SetOptions(const AValue: TCompilerOptions);
|
procedure SetOptions(const AValue: TCompilerOptions);
|
||||||
procedure SetMsgDirectory(Index: integer; const CurDir: string);
|
procedure SetMsgDirectory(Index: integer; const CurDir: string);
|
||||||
|
function CheckSpecialCharsInPath(const Title, Path: string): TModalResult;
|
||||||
function CheckCompilerExecutable(const CompilerFilename: string): TModalResult;
|
function CheckCompilerExecutable(const CompilerFilename: string): TModalResult;
|
||||||
function CheckAmbiguousFPCCfg(const CompilerFilename: string): TModalResult;
|
function CheckAmbiguousFPCCfg(const CompilerFilename: string): TModalResult;
|
||||||
function CheckCompilerConfig(const CompilerFilename: string;
|
function CheckCompilerConfig(const CompilerFilename: string;
|
||||||
@ -142,6 +143,67 @@ begin
|
|||||||
FDirectories[Index]:=CurDir;
|
FDirectories[Index]:=CurDir;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCheckCompilerOptsDlg.CheckSpecialCharsInPath(const Title, Path: string
|
||||||
|
): TModalResult;
|
||||||
|
|
||||||
|
procedure AddStr(var s: string; const Addition: string);
|
||||||
|
begin
|
||||||
|
if s='' then
|
||||||
|
s:='contains: '
|
||||||
|
else
|
||||||
|
s:=s+', ';
|
||||||
|
s:=s+Addition;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
HasSpaces: Boolean;
|
||||||
|
HasSpecialChars: Boolean;
|
||||||
|
HasNonASCII: Boolean;
|
||||||
|
HasWrongPathDelim: Boolean;
|
||||||
|
HasUnusualChars: Boolean;
|
||||||
|
HasNewLine: Boolean;
|
||||||
|
Warning: String;
|
||||||
|
ErrorMsg: String;
|
||||||
|
begin
|
||||||
|
HasSpaces:=false;
|
||||||
|
HasSpecialChars:=false;
|
||||||
|
HasNonASCII:=false;
|
||||||
|
HasWrongPathDelim:=false;
|
||||||
|
HasUnusualChars:=false;
|
||||||
|
HasNewLine:=false;
|
||||||
|
for i:=1 to length(Path) do begin
|
||||||
|
case Path[i] of
|
||||||
|
#10,#13: HasNewLine:=true;
|
||||||
|
#0..#8,#11,#12,#14..#31: HasSpecialChars:=true;
|
||||||
|
#9,' ': HasSpaces:=true;
|
||||||
|
'/','\': if Path[i]<>PathDelim then HasWrongPathDelim:=true;
|
||||||
|
'@','#','$','&','*','(',')','[',']','+','~','<','>','?','|': HasUnusualChars:=true;
|
||||||
|
#128..#255: HasNonASCII:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Warning:='';
|
||||||
|
ErrorMsg:='';
|
||||||
|
if HasSpaces then AddStr(Warning,'spaces');
|
||||||
|
if HasSpecialChars then AddStr(ErrorMsg,'special characters');
|
||||||
|
if HasNonASCII then AddStr(Warning,'non ASCII');
|
||||||
|
if HasWrongPathDelim then AddStr(Warning,'wrong path delimiter');
|
||||||
|
if HasUnusualChars then AddStr(Warning,'unusual characters');
|
||||||
|
if HasNewLine then AddStr(ErrorMsg,'unusual characters');
|
||||||
|
|
||||||
|
if Warning<>'' then
|
||||||
|
AddWarning(Title+' '+Warning);
|
||||||
|
if ErrorMsg<>'' then begin
|
||||||
|
Result:=QuestionDlg('Invalid search path',Title+' '+ErrorMsg,mtError,
|
||||||
|
[mrIgnore,'Skip',mrAbort],0);
|
||||||
|
end else begin
|
||||||
|
if Warning='' then
|
||||||
|
Result:=mrOk
|
||||||
|
else
|
||||||
|
Result:=mrIgnore;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCheckCompilerOptsDlg.CheckCompilerExecutable(
|
function TCheckCompilerOptsDlg.CheckCompilerExecutable(
|
||||||
const CompilerFilename: string): TModalResult;
|
const CompilerFilename: string): TModalResult;
|
||||||
var
|
var
|
||||||
@ -156,7 +218,7 @@ begin
|
|||||||
Result:=QuestionDlg('Invalid compiler',
|
Result:=QuestionDlg('Invalid compiler',
|
||||||
'The compiler "'+CompilerFilename+'" is not an executable file.'#13
|
'The compiler "'+CompilerFilename+'" is not an executable file.'#13
|
||||||
+'Details: '+E.Message,
|
+'Details: '+E.Message,
|
||||||
mtError,[mrCancel,'Skip',mrAbort],0);
|
mtError,[mrIgnore,'Skip',mrAbort],0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -171,7 +233,7 @@ begin
|
|||||||
'There are several FreePascal Compilers in your path.'#13#13
|
'There are several FreePascal Compilers in your path.'#13#13
|
||||||
+CompilerFiles.Text+#13
|
+CompilerFiles.Text+#13
|
||||||
+'Maybe you forgot to delete an old compiler?',
|
+'Maybe you forgot to delete an old compiler?',
|
||||||
mtWarning,[mbCancel,mbIgnore],0);
|
mtWarning,[mbAbort,mbIgnore],0);
|
||||||
if Result<>mrIgnore then exit;
|
if Result<>mrIgnore then exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -715,6 +777,7 @@ var
|
|||||||
FPC_PPUs: TStrings;
|
FPC_PPUs: TStrings;
|
||||||
TargetUnitPath: String;
|
TargetUnitPath: String;
|
||||||
Target_PPUs: TStrings;
|
Target_PPUs: TStrings;
|
||||||
|
cp: TParsedCompilerOptString;
|
||||||
begin
|
begin
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
if Test<>cotNone then exit;
|
if Test<>cotNone then exit;
|
||||||
@ -724,6 +787,17 @@ begin
|
|||||||
FPC_PPUs:=nil;
|
FPC_PPUs:=nil;
|
||||||
Target_PPUs:=nil;
|
Target_PPUs:=nil;
|
||||||
try
|
try
|
||||||
|
// check for special characters in search paths
|
||||||
|
for cp:=Low(TParsedCompilerOptString) to High(TParsedCompilerOptString) do
|
||||||
|
begin
|
||||||
|
if cp in ParsedCompilerSearchPaths then begin
|
||||||
|
Result:=CheckSpecialCharsInPath(
|
||||||
|
copy(ParsedCompilerOptStringNames[cp],5,100),
|
||||||
|
Options.ParsedOpts.GetParsedValue(cp));
|
||||||
|
if not (Result in [mrOk,mrIgnore]) then exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
CompilerFilename:=Options.ParsedOpts.GetParsedValue(pcosCompilerPath);
|
CompilerFilename:=Options.ParsedOpts.GetParsedValue(pcosCompilerPath);
|
||||||
|
|
||||||
// check compiler filename
|
// check compiler filename
|
||||||
@ -748,7 +822,7 @@ begin
|
|||||||
Result:=CheckForAmbiguousPPUs(FPC_PPUs);
|
Result:=CheckForAmbiguousPPUs(FPC_PPUs);
|
||||||
if not (Result in [mrOk,mrIgnore]) then exit;
|
if not (Result in [mrOk,mrIgnore]) then exit;
|
||||||
|
|
||||||
// check if unit paths do not contain sources
|
// check if FPC unit paths do not contain sources
|
||||||
Result:=CheckFPCUnitPathsContainSources(FPCCfgUnitPath);
|
Result:=CheckFPCUnitPathsContainSources(FPCCfgUnitPath);
|
||||||
if not (Result in [mrOk,mrIgnore]) then exit;
|
if not (Result in [mrOk,mrIgnore]) then exit;
|
||||||
|
|
||||||
@ -768,6 +842,10 @@ begin
|
|||||||
Result:=CheckCompileBogusFile(CompilerFilename);
|
Result:=CheckCompileBogusFile(CompilerFilename);
|
||||||
if not (Result in [mrOk,mrIgnore]) then exit;
|
if not (Result in [mrOk,mrIgnore]) then exit;
|
||||||
|
|
||||||
|
// ToDo: check if search paths of packages/projects intersects
|
||||||
|
|
||||||
|
// ToDo: check ppu checksums and versions
|
||||||
|
|
||||||
if OutputListbox.Items.Count=0 then
|
if OutputListbox.Items.Count=0 then
|
||||||
AddMsg('All tests succeeded.','',-1);
|
AddMsg('All tests succeeded.','',-1);
|
||||||
|
|
||||||
|
@ -1474,6 +1474,7 @@ resourcestring
|
|||||||
+'system seems to use it.%sThat means non ASCII characters will probably '
|
+'system seems to use it.%sThat means non ASCII characters will probably '
|
||||||
+'be shown incorrect.%sYou can select another font in the editor options.';
|
+'be shown incorrect.%sYou can select another font in the editor options.';
|
||||||
lisUEDoNotSho = 'Do not show this message again.';
|
lisUEDoNotSho = 'Do not show this message again.';
|
||||||
|
uemInsertTodo = 'Insert Todo';
|
||||||
|
|
||||||
// Form designer
|
// Form designer
|
||||||
lisInvalidMultiselection = 'Invalid multiselection';
|
lisInvalidMultiselection = 'Invalid multiselection';
|
||||||
|
@ -206,6 +206,7 @@ type
|
|||||||
procedure mnuEditInsertUsernameClick(Sender: TObject);
|
procedure mnuEditInsertUsernameClick(Sender: TObject);
|
||||||
procedure mnuEditInsertDateTimeClick(Sender: TObject);
|
procedure mnuEditInsertDateTimeClick(Sender: TObject);
|
||||||
procedure mnuEditInsertChangeLogEntryClick(Sender: TObject);
|
procedure mnuEditInsertChangeLogEntryClick(Sender: TObject);
|
||||||
|
procedure mnuInsertTodo(Sender: TObject);
|
||||||
|
|
||||||
// search menu
|
// search menu
|
||||||
procedure mnuSearchFindInFiles(Sender: TObject);
|
procedure mnuSearchFindInFiles(Sender: TObject);
|
||||||
@ -1590,6 +1591,7 @@ begin
|
|||||||
SourceNotebook.OnEditorPropertiesClicked := @mnuEnvEditorOptionsClicked;
|
SourceNotebook.OnEditorPropertiesClicked := @mnuEnvEditorOptionsClicked;
|
||||||
SourceNotebook.OnFindDeclarationClicked := @OnSrcNotebookFindDeclaration;
|
SourceNotebook.OnFindDeclarationClicked := @OnSrcNotebookFindDeclaration;
|
||||||
SourceNotebook.OnInitIdentCompletion :=@OnSrcNotebookInitIdentCompletion;
|
SourceNotebook.OnInitIdentCompletion :=@OnSrcNotebookInitIdentCompletion;
|
||||||
|
SourceNotebook.OnInsertTodoClicked := @mnuInsertTodo;
|
||||||
SourceNotebook.OnShowCodeContext :=@OnSrcNotebookShowCodeContext;
|
SourceNotebook.OnShowCodeContext :=@OnSrcNotebookShowCodeContext;
|
||||||
SourceNotebook.OnJumpToHistoryPoint := @OnSrcNotebookJumpToHistoryPoint;
|
SourceNotebook.OnJumpToHistoryPoint := @OnSrcNotebookJumpToHistoryPoint;
|
||||||
SourceNotebook.OnMovingPage := @OnSrcNotebookMovingPage;
|
SourceNotebook.OnMovingPage := @OnSrcNotebookMovingPage;
|
||||||
@ -13143,6 +13145,11 @@ begin
|
|||||||
DoSourceEditorCommand(ecInsertChangeLogEntry);
|
DoSourceEditorCommand(ecInsertChangeLogEntry);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainIDE.mnuInsertTodo(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DoSourceEditorCommand(ecInsertTodo);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.mnuSearchFindInFiles(Sender: TObject);
|
procedure TMainIDE.mnuSearchFindInFiles(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DoFindInFiles;
|
DoFindInFiles;
|
||||||
|
49
ide/tododlg.lfm
Normal file
49
ide/tododlg.lfm
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
object TodoDialog: TTodoDialog
|
||||||
|
Left = 363
|
||||||
|
Height = 257
|
||||||
|
Top = 216
|
||||||
|
Width = 400
|
||||||
|
HorzScrollBar.Page = 399
|
||||||
|
VertScrollBar.Page = 256
|
||||||
|
ActiveControl = OkButton
|
||||||
|
Caption = 'Insert Todo'
|
||||||
|
ClientHeight = 257
|
||||||
|
ClientWidth = 400
|
||||||
|
object TodoLabel: TLabel
|
||||||
|
Left = 16
|
||||||
|
Height = 14
|
||||||
|
Top = 8
|
||||||
|
Width = 27
|
||||||
|
Caption = 'Text:'
|
||||||
|
FocusControl = TodoMemo
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object OkButton: TButton
|
||||||
|
Left = 112
|
||||||
|
Height = 25
|
||||||
|
Top = 208
|
||||||
|
Width = 75
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Ok'
|
||||||
|
ModalResult = 1
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object CancelButton: TButton
|
||||||
|
Left = 208
|
||||||
|
Height = 25
|
||||||
|
Top = 208
|
||||||
|
Width = 75
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Cancel'
|
||||||
|
ModalResult = 2
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object TodoMemo: TMemo
|
||||||
|
Left = 16
|
||||||
|
Height = 168
|
||||||
|
Top = 24
|
||||||
|
Width = 368
|
||||||
|
ScrollBars = ssAutoBoth
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
end
|
16
ide/tododlg.lrs
Normal file
16
ide/tododlg.lrs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
|
LazarusResources.Add('TTodoDialog','FORMDATA',[
|
||||||
|
'TPF0'#11'TTodoDialog'#10'TodoDialog'#4'Left'#3'k'#1#6'Height'#3#1#1#3'Top'#3
|
||||||
|
+#216#0#5'Width'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'
|
||||||
|
+#3#0#1#13'ActiveControl'#7#8'OkButton'#7'Caption'#6#11'Insert Todo'#12'Clien'
|
||||||
|
+'tHeight'#3#1#1#11'ClientWidth'#3#144#1#0#6'TLabel'#9'TodoLabel'#4'Left'#2#16
|
||||||
|
+#6'Height'#2#14#3'Top'#2#8#5'Width'#2#27#7'Caption'#6#5'Text:'#12'FocusContr'
|
||||||
|
+'ol'#7#8'TodoMemo'#11'ParentColor'#8#0#0#7'TButton'#8'OkButton'#4'Left'#2'p'
|
||||||
|
+#6'Height'#2#25#3'Top'#3#208#0#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2
|
||||||
|
+#4#7'Caption'#6#2'Ok'#11'ModalResult'#2#1#8'TabOrder'#2#1#0#0#7'TButton'#12
|
||||||
|
+'CancelButton'#4'Left'#3#208#0#6'Height'#2#25#3'Top'#3#208#0#5'Width'#2'K'#25
|
||||||
|
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8
|
||||||
|
+'TabOrder'#2#2#0#0#5'TMemo'#8'TodoMemo'#4'Left'#2#16#6'Height'#3#168#0#3'Top'
|
||||||
|
+#2#24#5'Width'#3'p'#1#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#0#0#0
|
||||||
|
]);
|
65
ide/tododlg.pas
Normal file
65
ide/tododlg.pas
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
***************************************************************************
|
||||||
|
* *
|
||||||
|
* This source is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This code is distributed in the hope that it will be useful, but *
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||||
|
* General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* A copy of the GNU General Public License is available on the World *
|
||||||
|
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||||
|
* obtain it by writing to the Free Software Foundation, *
|
||||||
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
* *
|
||||||
|
***************************************************************************
|
||||||
|
}
|
||||||
|
unit ToDoDlg;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TTodoDialog }
|
||||||
|
|
||||||
|
TTodoDialog = class(TForm)
|
||||||
|
OkButton: TButton;
|
||||||
|
CancelButton: TButton;
|
||||||
|
TodoLabel: TLabel;
|
||||||
|
TodoMemo: TMemo;
|
||||||
|
private
|
||||||
|
{ private declarations }
|
||||||
|
public
|
||||||
|
{ public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ShowTodoDialog(TodoMessage: TStrings): Boolean;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TTodoDialog }
|
||||||
|
|
||||||
|
function ShowTodoDialog(TodoMessage: TStrings): Boolean;
|
||||||
|
var
|
||||||
|
TodoDialog: TTodoDialog;
|
||||||
|
begin
|
||||||
|
TodoDialog:=TTodoDialog.Create(nil);
|
||||||
|
Result:=TodoDialog.ShowModal = mrOk;
|
||||||
|
If Result and (TodoMessage <> nil) Then TodoMessage.Assign(TodoDialog.TodoMemo.Lines);
|
||||||
|
TodoDialog.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I tododlg.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -60,7 +60,7 @@ uses
|
|||||||
CodeTemplatesDlg,
|
CodeTemplatesDlg,
|
||||||
SortSelectionDlg, EncloseSelectionDlg, DiffDialog, ConDef, InvertAssignTool,
|
SortSelectionDlg, EncloseSelectionDlg, DiffDialog, ConDef, InvertAssignTool,
|
||||||
SourceEditProcs, SourceMarks, CharacterMapDlg, frmSearch, LazDocFrm,
|
SourceEditProcs, SourceMarks, CharacterMapDlg, frmSearch, LazDocFrm,
|
||||||
BaseDebugManager, Debugger, MainIntf;
|
BaseDebugManager, Debugger, MainIntf, TodoDlg;
|
||||||
|
|
||||||
type
|
type
|
||||||
TSourceNotebook = class;
|
TSourceNotebook = class;
|
||||||
@ -265,6 +265,7 @@ type
|
|||||||
procedure InsertLGPLNotice(CommentType: TCommentType);
|
procedure InsertLGPLNotice(CommentType: TCommentType);
|
||||||
procedure InsertModifiedLGPLNotice(CommentType: TCommentType);
|
procedure InsertModifiedLGPLNotice(CommentType: TCommentType);
|
||||||
procedure InsertUsername;
|
procedure InsertUsername;
|
||||||
|
procedure InsertTodo;
|
||||||
procedure InsertDateTime;
|
procedure InsertDateTime;
|
||||||
procedure InsertChangeLogEntry;
|
procedure InsertChangeLogEntry;
|
||||||
procedure InsertCVSKeyword(const AKeyWord: string);
|
procedure InsertCVSKeyword(const AKeyWord: string);
|
||||||
@ -435,6 +436,7 @@ type
|
|||||||
procedure FindNextWordOccurrenceClicked(Sender: TObject);
|
procedure FindNextWordOccurrenceClicked(Sender: TObject);
|
||||||
procedure FindPrevWordOccurrenceClicked(Sender: TObject);
|
procedure FindPrevWordOccurrenceClicked(Sender: TObject);
|
||||||
procedure FindInFilesClicked(Sender: TObject);
|
procedure FindInFilesClicked(Sender: TObject);
|
||||||
|
procedure InsertTodoClicked(Sender: TObject);
|
||||||
procedure MoveEditorLeftClicked(Sender: TObject);
|
procedure MoveEditorLeftClicked(Sender: TObject);
|
||||||
procedure MoveEditorRightClicked(Sender: TObject);
|
procedure MoveEditorRightClicked(Sender: TObject);
|
||||||
procedure NotebookPageChanged(Sender: TObject);
|
procedure NotebookPageChanged(Sender: TObject);
|
||||||
@ -472,6 +474,7 @@ type
|
|||||||
FOnEditorVisibleChanged: TNotifyEvent;
|
FOnEditorVisibleChanged: TNotifyEvent;
|
||||||
FOnFindDeclarationClicked: TNotifyEvent;
|
FOnFindDeclarationClicked: TNotifyEvent;
|
||||||
FOnInitIdentCompletion: TOnInitIdentCompletion;
|
FOnInitIdentCompletion: TOnInitIdentCompletion;
|
||||||
|
FOnInsertTodoClicked: TNotifyEvent;
|
||||||
FOnShowCodeContext: TOnShowCodeContext;
|
FOnShowCodeContext: TOnShowCodeContext;
|
||||||
FOnJumpToHistoryPoint: TOnJumpToHistoryPoint;
|
FOnJumpToHistoryPoint: TOnJumpToHistoryPoint;
|
||||||
FOnMovingPage: TOnMovingPage;
|
FOnMovingPage: TOnMovingPage;
|
||||||
@ -740,6 +743,8 @@ type
|
|||||||
read FOnFindDeclarationClicked write FOnFindDeclarationClicked;
|
read FOnFindDeclarationClicked write FOnFindDeclarationClicked;
|
||||||
property OnInitIdentCompletion: TOnInitIdentCompletion
|
property OnInitIdentCompletion: TOnInitIdentCompletion
|
||||||
read FOnInitIdentCompletion write FOnInitIdentCompletion;
|
read FOnInitIdentCompletion write FOnInitIdentCompletion;
|
||||||
|
property OnInsertTodoClicked: TNotifyEvent
|
||||||
|
read FOnInsertTodoClicked write FOnInsertTodoClicked;
|
||||||
property OnShowCodeContext: TOnShowCodeContext
|
property OnShowCodeContext: TOnShowCodeContext
|
||||||
read FOnShowCodeContext write FOnShowCodeContext;
|
read FOnShowCodeContext write FOnShowCodeContext;
|
||||||
property OnJumpToHistoryPoint: TOnJumpToHistoryPoint
|
property OnJumpToHistoryPoint: TOnJumpToHistoryPoint
|
||||||
@ -820,6 +825,7 @@ var
|
|||||||
SrcEditMenuFindIdentifierReferences: TIDEMenuCommand;
|
SrcEditMenuFindIdentifierReferences: TIDEMenuCommand;
|
||||||
SrcEditMenuExtractProc: TIDEMenuCommand;
|
SrcEditMenuExtractProc: TIDEMenuCommand;
|
||||||
SrcEditMenuInvertAssignment: TIDEMenuCommand;
|
SrcEditMenuInvertAssignment: TIDEMenuCommand;
|
||||||
|
SrcEditMenuInsertTodo: TIDEMenuCommand;
|
||||||
SrcEditMenuMoveEditorLeft: TIDEMenuCommand;
|
SrcEditMenuMoveEditorLeft: TIDEMenuCommand;
|
||||||
SrcEditMenuMoveEditorRight: TIDEMenuCommand;
|
SrcEditMenuMoveEditorRight: TIDEMenuCommand;
|
||||||
SrcEditMenuReadOnly: TIDEMenuCommand;
|
SrcEditMenuReadOnly: TIDEMenuCommand;
|
||||||
@ -827,6 +833,7 @@ var
|
|||||||
SrcEditMenuShowUnitInfo: TIDEMenuCommand;
|
SrcEditMenuShowUnitInfo: TIDEMenuCommand;
|
||||||
SrcEditMenuEditorProperties: TIDEMenuCommand;
|
SrcEditMenuEditorProperties: TIDEMenuCommand;
|
||||||
|
|
||||||
|
|
||||||
procedure RegisterStandardSourceEditorMenuItems;
|
procedure RegisterStandardSourceEditorMenuItems;
|
||||||
|
|
||||||
|
|
||||||
@ -965,6 +972,9 @@ begin
|
|||||||
SrcEditMenuInvertAssignment:=RegisterIDEMenuCommand(AParent,
|
SrcEditMenuInvertAssignment:=RegisterIDEMenuCommand(AParent,
|
||||||
'InvertAssignment',uemInvertAssignment);
|
'InvertAssignment',uemInvertAssignment);
|
||||||
|
|
||||||
|
SrcEditMenuInsertTodo:=RegisterIDEMenuCommand(SourceEditorMenuRoot,
|
||||||
|
'InsertTodo',uemInsertTodo);
|
||||||
|
|
||||||
// register the Flags section
|
// register the Flags section
|
||||||
SrcEditMenuSectionFlags:=RegisterIDEMenuSection(SourceEditorMenuRoot,
|
SrcEditMenuSectionFlags:=RegisterIDEMenuSection(SourceEditorMenuRoot,
|
||||||
'Flags section');
|
'Flags section');
|
||||||
@ -979,6 +989,7 @@ begin
|
|||||||
SrcEditMenuSectionHighlighter:=RegisterIDEMenuSection(AParent,'Highlighter');
|
SrcEditMenuSectionHighlighter:=RegisterIDEMenuSection(AParent,'Highlighter');
|
||||||
SrcEditMenuEditorProperties:=RegisterIDEMenuCommand(AParent,
|
SrcEditMenuEditorProperties:=RegisterIDEMenuCommand(AParent,
|
||||||
'EditorProperties',uemEditorProperties);
|
'EditorProperties',uemEditorProperties);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSourceEditor }
|
{ TSourceEditor }
|
||||||
@ -1546,6 +1557,9 @@ Begin
|
|||||||
ecInsertDateTime:
|
ecInsertDateTime:
|
||||||
InsertDateTime;
|
InsertDateTime;
|
||||||
|
|
||||||
|
ecInsertTodo:
|
||||||
|
InsertTodo;
|
||||||
|
|
||||||
ecInsertChangeLogEntry:
|
ecInsertChangeLogEntry:
|
||||||
InsertChangeLogEntry;
|
InsertChangeLogEntry;
|
||||||
|
|
||||||
@ -1885,6 +1899,17 @@ begin
|
|||||||
FEditor.SelText:=GetCurrentUserName;
|
FEditor.SelText:=GetCurrentUserName;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSourceEditor.InsertTodo;
|
||||||
|
Var
|
||||||
|
TodoMsg: TStrings;
|
||||||
|
begin
|
||||||
|
if ReadOnly then Exit;
|
||||||
|
TodoMsg:= TStringList.Create;
|
||||||
|
if ShowTodoDialog(TodoMsg) then
|
||||||
|
FEditor.SelText:=CommentText('TODO: '+TodoMsg.Text, comtPascal);
|
||||||
|
TodoMsg.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSourceEditor.InsertDateTime;
|
procedure TSourceEditor.InsertDateTime;
|
||||||
begin
|
begin
|
||||||
if ReadOnly then Exit;
|
if ReadOnly then Exit;
|
||||||
@ -3937,6 +3962,8 @@ begin
|
|||||||
SrcEditMenuMoveEditorLeft.OnClick:=@MoveEditorLeftClicked;
|
SrcEditMenuMoveEditorLeft.OnClick:=@MoveEditorLeftClicked;
|
||||||
SrcEditMenuMoveEditorRight.OnClick:=@MoveEditorRightClicked;
|
SrcEditMenuMoveEditorRight.OnClick:=@MoveEditorRightClicked;
|
||||||
|
|
||||||
|
SrcEditMenuInsertTodo.OnClick:=@InsertTodoClicked;
|
||||||
|
|
||||||
SrcEditMenuCompleteCode.OnClick:=@CompleteCodeMenuItemClick;
|
SrcEditMenuCompleteCode.OnClick:=@CompleteCodeMenuItemClick;
|
||||||
SrcEditMenuEncloseSelection.OnClick:=@EncloseSelectionMenuItemClick;
|
SrcEditMenuEncloseSelection.OnClick:=@EncloseSelectionMenuItemClick;
|
||||||
SrcEditMenuExtractProc.OnClick:=@ExtractProcMenuItemClick;
|
SrcEditMenuExtractProc.OnClick:=@ExtractProcMenuItemClick;
|
||||||
@ -4854,6 +4881,12 @@ begin
|
|||||||
SrcEdit.DoEditorExecuteCommand(ecFindInFiles);
|
SrcEdit.DoEditorExecuteCommand(ecFindInFiles);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSourceNotebook.InsertTodoClicked(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Assigned(FOnInsertTodoClicked) then
|
||||||
|
FOnInsertTodoClicked(Sender);
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure TSourceNotebook.CutClicked(Sender: TObject);
|
Procedure TSourceNotebook.CutClicked(Sender: TObject);
|
||||||
var ActSE: TSourceEditor;
|
var ActSE: TSourceEditor;
|
||||||
begin
|
begin
|
||||||
|
@ -120,6 +120,7 @@ const
|
|||||||
ecInsertCVSRevision = ecFirstLazarus + 92;
|
ecInsertCVSRevision = ecFirstLazarus + 92;
|
||||||
ecInsertCVSSource = ecFirstLazarus + 93;
|
ecInsertCVSSource = ecFirstLazarus + 93;
|
||||||
ecInsertModifiedLGPLNotice= ecFirstLazarus + 94;
|
ecInsertModifiedLGPLNotice= ecFirstLazarus + 94;
|
||||||
|
ecInsertTodo = ecFirstLazarus + 95;
|
||||||
|
|
||||||
// source tools
|
// source tools
|
||||||
ecWordCompletion = ecFirstLazarus + 100;
|
ecWordCompletion = ecFirstLazarus + 100;
|
||||||
|
Loading…
Reference in New Issue
Block a user