From efec9f2a268557026cf3d948a05c300e266818cb Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 2 Jun 2013 17:27:09 +0000 Subject: [PATCH] IDE: replaced some MessageDlg with IDEMessageDialog git-svn-id: trunk@41497 - --- ide/cleandirdlg.pas | 8 ++++---- ide/codeexplorer.pas | 4 ++-- ide/codehelp.pas | 20 ++++++++++---------- ide/codetoolsdefines.pas | 30 +++++++++++++++--------------- ide/debugmanager.pas | 6 +++--- ide/editoroptions.pp | 2 +- ide/emptymethodsdlg.pas | 10 +++++----- ide/exttooldialog.pas | 4 ++-- ide/lazarusidestrconsts.pas | 1 + ide/searchfrm.pas | 6 +++--- ide/sourceeditor.pp | 8 ++++---- 11 files changed, 50 insertions(+), 49 deletions(-) diff --git a/ide/cleandirdlg.pas b/ide/cleandirdlg.pas index 7971f8e237..52fe199c1d 100644 --- a/ide/cleandirdlg.pas +++ b/ide/cleandirdlg.pas @@ -30,9 +30,9 @@ unit CleanDirDlg; interface uses - Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons, - StdCtrls, FileUtil, Laz2_XMLCfg, LCLProc, SynRegExpr, ButtonPanel, - IDEWindowIntf, IDEHelpIntf, LazarusIDEStrConsts, LazConf, IDEProcs, + Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons, StdCtrls, + FileUtil, Laz2_XMLCfg, LCLProc, SynRegExpr, ButtonPanel, IDEWindowIntf, + IDEHelpIntf, IDEDialogs, LazarusIDEStrConsts, LazConf, IDEProcs, TransferMacros, InputHistory, ShowDeletingFilesDlg; type @@ -359,7 +359,7 @@ var s:=Format(lisTheFileMaskIsInvalid, [FilterAsText]) else s:=Format(lisTheFileMaskIsNotAValidRegularExpression, [FilterAsText]); - MessageDlg(lisInvalidMask, s, mtError, [mbCancel], 0); + IDEMessageDialog(lisInvalidMask, s, mtError, [mbCancel]); end; end; end; diff --git a/ide/codeexplorer.pas b/ide/codeexplorer.pas index cd500b8578..6ed27b09c4 100644 --- a/ide/codeexplorer.pas +++ b/ide/codeexplorer.pas @@ -46,7 +46,7 @@ uses CodeCache, CodeTree, KeywordFuncLists, FindDeclarationTool, DirectivesTree, PascalParserTool, // IDE Intf - LazIDEIntf, IDECommands, MenuIntf, SrcEditorIntf, + LazIDEIntf, IDECommands, MenuIntf, SrcEditorIntf, IDEDialogs, // IDE KeyMapping, LazarusIDEStrConsts, EnvironmentOpts, IDEOptionDefs, InputHistory, IDEProcs, CodeExplOpts; @@ -670,7 +670,7 @@ end; procedure TCodeExplorerView.RenameMenuItemClick(Sender: TObject); begin if not JumpToSelection then begin - MessageDlg(lisCCOErrorCaption, lisTreeNeedsRefresh, mtError, [mbOk], 0); + IDEMessageDialog(lisCCOErrorCaption, lisTreeNeedsRefresh, mtError, [mbOk]); Refresh(true); exit; end; diff --git a/ide/codehelp.pas b/ide/codehelp.pas index c634c0a6c5..675fbcfd64 100644 --- a/ide/codehelp.pas +++ b/ide/codehelp.pas @@ -1218,9 +1218,9 @@ begin FPDocPackageName:='rtl'; end else begin // no package/project found - MessageDlg(lisProjAddPackageNotFound, + IDEMessageDialog(lisProjAddPackageNotFound, Format(lisLDTheUnitIsNotOwnedBeAnyPackageOrProjectPleaseAddThe, [ - SrcFilename, #13, #13]), mtError, [mbCancel], 0); + SrcFilename, #13, #13]), mtError, [mbCancel]); exit; end; end else begin @@ -1261,15 +1261,15 @@ begin // no valid directory found DebugLn(['TCodeHelpManager.DoCreateFPDocFileForSource FPDocPackageName="',FPDocPackageName,'" FPDocPaths="',FPDocPaths,'" ']); if IsInFPCSrc then - MessageDlg(lisLDNoValidFPDocPath, + IDEMessageDialog(lisLDNoValidFPDocPath, Format(lisTheUnitIsPartOfTheFPCSourcesButTheCorrespondingFpd, [ SrcFilename, #13, #13, FPCDocsRepositoryURL, #13, #13]) - , mtError, [mbCancel], 0) + , mtError, [mbCancel]) else - MessageDlg(lisLDNoValidFPDocPath, + IDEMessageDialog(lisLDNoValidFPDocPath, Format(lisLDDoesNotHaveAnyValidFPDocPathUnableToCreateTheFpdo, [FPDocPackageName, LineEnding, SrcFilename]), - mtError, [mbCancel], 0); + mtError, [mbCancel]); exit; end; // fpdoc directory found @@ -1309,8 +1309,8 @@ begin end; Result:=CodeToolBoss.CreateFile(ExpandedFilename); if Result=nil then begin - MessageDlg('Unable to create file', - 'Unable to create file '+ExpandedFilename,mtError,[mbCancel],0); + IDEMessageDialog(lisUnableToCreateFile, + Format(lisUnableToCreateFile4, [ExpandedFilename]), mtError, [mbCancel]); exit; end; @@ -1459,9 +1459,9 @@ begin ADocFile.DocErrorMsg:='Error reading xml file "'+CurFilename+'" '+E.Message; DebugLn(['TCodeHelpManager.LoadFPDocFile '+ADocFile.DocErrorMsg]); if not (chofQuiet in Flags) then begin - MessageDlg(lisErrorReadingXML, + IDEMessageDialog(lisErrorReadingXML, Format(lisErrorReadingXmlFile, ['"', CurFilename, '"', LineEnding, E.Message]), - mtError, [mbCancel], 0); + mtError, [mbCancel]); end; end; end; diff --git a/ide/codetoolsdefines.pas b/ide/codetoolsdefines.pas index 2a8bcf4bac..6b55954aa2 100644 --- a/ide/codetoolsdefines.pas +++ b/ide/codetoolsdefines.pas @@ -48,7 +48,7 @@ uses ComCtrls, LCLType, ExtCtrls, Menus, LCLProc, Graphics, Dialogs, SynEdit, CodeToolManager, DefineTemplates, - IDEWindowIntf, IDEImagesIntf, + IDEWindowIntf, IDEImagesIntf, IDEDialogs, LazarusIDEStrConsts, CodeToolsOptions, CodeToolsDefPreview, TransferMacros, EditorOptions, InputFileDialog, IDEOptionDefs, LazConf, IDEProcs, EditDefineTree; @@ -441,9 +441,9 @@ begin if (SelTreeNode=nil) or (SelTreeNode.Parent=nil) then exit; SelDefNode:=TDefineTemplate(SelTreeNode.Data); if SelDefNode.IsAutoGenerated then begin - MessageDlg(lisCodeToolsDefsNodeIsReadonly, + IDEMessageDialog(lisCodeToolsDefsNodeIsReadonly, lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited, - mtInformation,[mbCancel],0); + mtInformation,[mbCancel]); exit; end; // move node one lvl up in TreeView @@ -470,15 +470,15 @@ begin SelDefNode:=TDefineTemplate(SelTreeNode.Data); PrevDefNode:=SelDefNode.Prior; if (SelDefNode.IsAutoGenerated) or (PrevDefNode.IsAutoGenerated) then begin - MessageDlg(lisCodeToolsDefsNodeIsReadonly, + IDEMessageDialog(lisCodeToolsDefsNodeIsReadonly, lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited, - mtInformation,[mbCancel],0); + mtInformation,[mbCancel]); exit; end; if (not (PrevDefNode.Action in DefineActionBlocks)) then begin - MessageDlg(lisCodeToolsDefsInvalidPreviousNode, + IDEMessageDialog(lisCodeToolsDefsInvalidPreviousNode, lisCodeToolsDefsPreviousNodeCanNotContainChildNodes, - mtInformation,[mbCancel],0); + mtInformation,[mbCancel]); exit; end; // move node one lvl down in TreeView @@ -500,9 +500,9 @@ begin if (SelTreeNode=nil) then exit; SelDefNode:=TDefineTemplate(SelTreeNode.Data); if (SelDefNode.IsAutoGenerated) then begin - MessageDlg(lisCodeToolsDefsNodeIsReadonly, + IDEMessageDialog(lisCodeToolsDefsNodeIsReadonly, lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited, - mtInformation,[mbCancel],0); + mtInformation,[mbCancel]); exit; end; if FLastSelectedNode=SelTreeNode then FLastSelectedNode:=nil; @@ -524,9 +524,9 @@ begin if SelTreeNode=nil then exit; SelDefNode:=TDefineTemplate(SelTreeNode.Data); if (SelDefNode.IsAutoGenerated) then begin - MessageDlg(lisCodeToolsDefsNodeIsReadonly, + IDEMessageDialog(lisCodeToolsDefsNodeIsReadonly, lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited, - mtInformation,[mbCancel],0); + mtInformation,[mbCancel]); exit; end; if Sender=ConvertActionToDefineMenuItem then NewAction:=da_Define @@ -1219,17 +1219,17 @@ begin end; if (ParentNode<>nil) and (TDefineTemplate(ParentNode.Data).IsAutoGenerated) then begin - MessageDlg(lisCodeToolsDefsInvalidParent, + IDEMessageDialog(lisCodeToolsDefsInvalidParent, Format(lisCodeToolsDefsAutoCreatedNodesReadOnly, [LineEnding]), - mtInformation, [mbCancel],0); + mtInformation, [mbCancel]); exit; end; if (ParentNode<>nil) and (not (TDefineTemplate(ParentNode.Data).Action in DefineActionBlocks)) then begin - MessageDlg(lisCodeToolsDefsInvalidParentNode, + IDEMessageDialog(lisCodeToolsDefsInvalidParentNode, lisCodeToolsDefsParentNodeCanNotContainCh, - mtInformation,[mbCancel],0); + mtInformation,[mbCancel]); exit; end; NewName:=FindUniqueName; diff --git a/ide/debugmanager.pas b/ide/debugmanager.pas index 988c55325b..fea27f154c 100644 --- a/ide/debugmanager.pas +++ b/ide/debugmanager.pas @@ -663,10 +663,10 @@ begin and AskUserIfNotFound then begin - if MessageDlg(lisFileNotFound, + if IDEMessageDialog(lisFileNotFound, Format(lisTheFileWasNotFoundDoYouWantToLocateItYourself, ['"', SrcFile, '"', LineEnding, LineEnding, LineEnding]) - ,mtConfirmation, [mbYes, mbNo], 0) <> mrYes + ,mtConfirmation, [mbYes, mbNo]) <> mrYes then Exit; repeat @@ -967,7 +967,7 @@ begin end; end else begin - MessageDlg(lisCCOErrorCaption, msg, mtError, [mbOk], 0) + IDEMessageDialog(lisCCOErrorCaption, msg, mtError, [mbOk]); end; end; diff --git a/ide/editoroptions.pp b/ide/editoroptions.pp index 2e41ca84fe..b7ed040c24 100644 --- a/ide/editoroptions.pp +++ b/ide/editoroptions.pp @@ -3831,7 +3831,7 @@ procedure TEditorMouseOptions.LoadFromXml(aXMLConfig: TRttiXMLConfig; except MActions.Delete(MActions.Count-1); //if not ErrShown then - // MessageDlg(dlgMouseOptErrorDup, dlgMouseOptErrorDupText, mtError, [mbOk], 0); + // IDEMessageDialog(dlgMouseOptErrorDup, dlgMouseOptErrorDupText, mtError, [mbOk]); //ErrShown := True; end; end; diff --git a/ide/emptymethodsdlg.pas b/ide/emptymethodsdlg.pas index fda8c5057d..83475abaa6 100644 --- a/ide/emptymethodsdlg.pas +++ b/ide/emptymethodsdlg.pas @@ -36,7 +36,7 @@ uses Dialogs, ExtCtrls, StdCtrls, ButtonPanel, SynEdit, SynHighlighterPas, CodeToolsStructs, CodeAtom, CodeCache, CodeToolManager, PascalParserTool, CodeTree, - SrcEditorIntf, LazIDEIntf, PropEdits, CustomFormEditor, JitForms, + SrcEditorIntf, LazIDEIntf, PropEdits, IDEDialogs, CustomFormEditor, JitForms, Project, LazarusIDEStrConsts, EditorOptions; type @@ -120,10 +120,10 @@ begin ErrMsg:=''; LazarusIDE.DoJumpToCodeToolBossError; end else begin - MessageDlg(lisEMDNoClass, + IDEMessageDialog(lisEMDNoClass, Format(lisEMDNoClassAt, [Code.Filename, IntToStr(Caret.Y), IntToStr( Caret.X)]), - mtError,[mbCancel],0); + mtError,[mbCancel]); end; exit; end; @@ -141,9 +141,9 @@ begin finally CodeToolBoss.FreeListOfPCodeXYPosition(ListOfPCodeXYPosition); if ErrMsg<>'' then begin - MessageDlg(lisCCOErrorCaption, + IDEMessageDialog(lisCCOErrorCaption, Format(lisEMDUnableToShowEmptyMethodsOfTheCurrentClassBecause, - [LineEnding, ErrMsg]), mtError, [mbCancel], 0); + [LineEnding, ErrMsg]), mtError, [mbCancel]); end; end; end; diff --git a/ide/exttooldialog.pas b/ide/exttooldialog.pas index 661e6b1d3b..70663359f6 100644 --- a/ide/exttooldialog.pas +++ b/ide/exttooldialog.pas @@ -601,10 +601,10 @@ procedure TExternalToolDialog.AddButtonClick(Sender: TObject); var NewTool: TExternalToolOptions; begin if fExtToolList.Count>=MaxExtTools then begin - MessageDlg(lisExtToolMaximumToolsReached, + IDEMessageDialog(lisExtToolMaximumToolsReached, Format(lisExtToolThereIsAMaximumOfTools, [IntToStr(MaxExtTools )]), - mtInformation,[mbCancel],0); + mtInformation,[mbCancel]); exit; end; NewTool:=TExternalToolOptions.Create; diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 6ac064d760..16d85d9dc4 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -3542,6 +3542,7 @@ resourcestring // file checks lisUnableToCreateFile = 'Unable to create file'; + lisUnableToCreateFile4 = 'Unable to create file %s'; lisCanNotCreateFile = 'Can not create file %s%s%s'; lisExtendUnitPath = 'Extend unit path?'; lisTheDirectoryIsNotYetInTheUnitPathAddIt = 'The directory %s%s%s is not ' diff --git a/ide/searchfrm.pas b/ide/searchfrm.pas index cfcb77a4c6..0ba76ea16a 100644 --- a/ide/searchfrm.pas +++ b/ide/searchfrm.pas @@ -37,7 +37,7 @@ uses // synedit, codetools SynRegExpr, SourceLog, KeywordFuncLists, BasicCodeTools, // IDEIntf - IDEWindowIntf, LazIDEIntf, SrcEditorIntf, MainIntf, + IDEWindowIntf, LazIDEIntf, SrcEditorIntf, IDEDialogs, MainIntf, // ide LazarusIDEStrConsts, InputHistory, SearchResultView, Project; @@ -957,8 +957,8 @@ begin Cnt:= DoSearch; except on E: ERegExpr do - MessageDlg(lisUEErrorInRegularExpression, E.Message,mtError, - [mbCancel],0); + IDEMessageDialog(lisUEErrorInRegularExpression, E.Message,mtError, + [mbCancel]); end; finally ListPage.Caption:= Format('%s (%d)',[ListPage.Caption,Cnt]); diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index c94ea07e1e..61458e9a9b 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -3051,7 +3051,7 @@ begin Result:=EditorComponent.SearchReplace(aFindText, aReplaceText, anOptions); except on E: ERegExpr do begin - MessageDlg(lisUEErrorInRegularExpression, E.Message,mtError,[mbCancel],0); + IDEMessageDialog(lisUEErrorInRegularExpression, E.Message,mtError,[mbCancel]); exit; end; end; @@ -3068,7 +3068,7 @@ begin end else begin Again := False; - MessageDlg(ACaption, AText, mtInformation, [mbOK], 0); + IDEMessageDialog(ACaption, AText, mtInformation, [mbOK]); end; if not Again then Manager.DeleteLastJumpPointClicked(Self); @@ -10395,9 +10395,9 @@ begin if ActEdit.ReadOnly and (ActEdit.CodeBuffer<>nil) and (not ActEdit.CodeBuffer.IsVirtual) and (not FileIsWritable(ActEdit.CodeBuffer.Filename)) then begin - MessageDlg(ueFileROCap, + IDEMessageDialog(ueFileROCap, ueFileROText1+ActEdit.CodeBuffer.Filename+ueFileROText2, - mtError,[mbCancel],0); + mtError,[mbCancel]); exit; end; ActEdit.EditorComponent.ReadOnly := not(ActEdit.EditorComponent.ReadOnly);