IDE: replaced some MessageDlg with IDEMessageDialog

git-svn-id: trunk@41497 -
This commit is contained in:
mattias 2013-06-02 17:27:09 +00:00
parent 688a2e73fe
commit efec9f2a26
11 changed files with 50 additions and 49 deletions

View File

@ -30,9 +30,9 @@ unit CleanDirDlg;
interface interface
uses uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons, Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons, StdCtrls,
StdCtrls, FileUtil, Laz2_XMLCfg, LCLProc, SynRegExpr, ButtonPanel, FileUtil, Laz2_XMLCfg, LCLProc, SynRegExpr, ButtonPanel, IDEWindowIntf,
IDEWindowIntf, IDEHelpIntf, LazarusIDEStrConsts, LazConf, IDEProcs, IDEHelpIntf, IDEDialogs, LazarusIDEStrConsts, LazConf, IDEProcs,
TransferMacros, InputHistory, ShowDeletingFilesDlg; TransferMacros, InputHistory, ShowDeletingFilesDlg;
type type
@ -359,7 +359,7 @@ var
s:=Format(lisTheFileMaskIsInvalid, [FilterAsText]) s:=Format(lisTheFileMaskIsInvalid, [FilterAsText])
else else
s:=Format(lisTheFileMaskIsNotAValidRegularExpression, [FilterAsText]); s:=Format(lisTheFileMaskIsNotAValidRegularExpression, [FilterAsText]);
MessageDlg(lisInvalidMask, s, mtError, [mbCancel], 0); IDEMessageDialog(lisInvalidMask, s, mtError, [mbCancel]);
end; end;
end; end;
end; end;

View File

@ -46,7 +46,7 @@ uses
CodeCache, CodeTree, KeywordFuncLists, FindDeclarationTool, DirectivesTree, CodeCache, CodeTree, KeywordFuncLists, FindDeclarationTool, DirectivesTree,
PascalParserTool, PascalParserTool,
// IDE Intf // IDE Intf
LazIDEIntf, IDECommands, MenuIntf, SrcEditorIntf, LazIDEIntf, IDECommands, MenuIntf, SrcEditorIntf, IDEDialogs,
// IDE // IDE
KeyMapping, LazarusIDEStrConsts, EnvironmentOpts, IDEOptionDefs, InputHistory, KeyMapping, LazarusIDEStrConsts, EnvironmentOpts, IDEOptionDefs, InputHistory,
IDEProcs, CodeExplOpts; IDEProcs, CodeExplOpts;
@ -670,7 +670,7 @@ end;
procedure TCodeExplorerView.RenameMenuItemClick(Sender: TObject); procedure TCodeExplorerView.RenameMenuItemClick(Sender: TObject);
begin begin
if not JumpToSelection then begin if not JumpToSelection then begin
MessageDlg(lisCCOErrorCaption, lisTreeNeedsRefresh, mtError, [mbOk], 0); IDEMessageDialog(lisCCOErrorCaption, lisTreeNeedsRefresh, mtError, [mbOk]);
Refresh(true); Refresh(true);
exit; exit;
end; end;

View File

@ -1218,9 +1218,9 @@ begin
FPDocPackageName:='rtl'; FPDocPackageName:='rtl';
end else begin end else begin
// no package/project found // no package/project found
MessageDlg(lisProjAddPackageNotFound, IDEMessageDialog(lisProjAddPackageNotFound,
Format(lisLDTheUnitIsNotOwnedBeAnyPackageOrProjectPleaseAddThe, [ Format(lisLDTheUnitIsNotOwnedBeAnyPackageOrProjectPleaseAddThe, [
SrcFilename, #13, #13]), mtError, [mbCancel], 0); SrcFilename, #13, #13]), mtError, [mbCancel]);
exit; exit;
end; end;
end else begin end else begin
@ -1261,15 +1261,15 @@ begin
// no valid directory found // no valid directory found
DebugLn(['TCodeHelpManager.DoCreateFPDocFileForSource FPDocPackageName="',FPDocPackageName,'" FPDocPaths="',FPDocPaths,'" ']); DebugLn(['TCodeHelpManager.DoCreateFPDocFileForSource FPDocPackageName="',FPDocPackageName,'" FPDocPaths="',FPDocPaths,'" ']);
if IsInFPCSrc then if IsInFPCSrc then
MessageDlg(lisLDNoValidFPDocPath, IDEMessageDialog(lisLDNoValidFPDocPath,
Format(lisTheUnitIsPartOfTheFPCSourcesButTheCorrespondingFpd, [ Format(lisTheUnitIsPartOfTheFPCSourcesButTheCorrespondingFpd, [
SrcFilename, #13, #13, FPCDocsRepositoryURL, #13, #13]) SrcFilename, #13, #13, FPCDocsRepositoryURL, #13, #13])
, mtError, [mbCancel], 0) , mtError, [mbCancel])
else else
MessageDlg(lisLDNoValidFPDocPath, IDEMessageDialog(lisLDNoValidFPDocPath,
Format(lisLDDoesNotHaveAnyValidFPDocPathUnableToCreateTheFpdo, Format(lisLDDoesNotHaveAnyValidFPDocPathUnableToCreateTheFpdo,
[FPDocPackageName, LineEnding, SrcFilename]), [FPDocPackageName, LineEnding, SrcFilename]),
mtError, [mbCancel], 0); mtError, [mbCancel]);
exit; exit;
end; end;
// fpdoc directory found // fpdoc directory found
@ -1309,8 +1309,8 @@ begin
end; end;
Result:=CodeToolBoss.CreateFile(ExpandedFilename); Result:=CodeToolBoss.CreateFile(ExpandedFilename);
if Result=nil then begin if Result=nil then begin
MessageDlg('Unable to create file', IDEMessageDialog(lisUnableToCreateFile,
'Unable to create file '+ExpandedFilename,mtError,[mbCancel],0); Format(lisUnableToCreateFile4, [ExpandedFilename]), mtError, [mbCancel]);
exit; exit;
end; end;
@ -1459,9 +1459,9 @@ begin
ADocFile.DocErrorMsg:='Error reading xml file "'+CurFilename+'" '+E.Message; ADocFile.DocErrorMsg:='Error reading xml file "'+CurFilename+'" '+E.Message;
DebugLn(['TCodeHelpManager.LoadFPDocFile '+ADocFile.DocErrorMsg]); DebugLn(['TCodeHelpManager.LoadFPDocFile '+ADocFile.DocErrorMsg]);
if not (chofQuiet in Flags) then begin if not (chofQuiet in Flags) then begin
MessageDlg(lisErrorReadingXML, IDEMessageDialog(lisErrorReadingXML,
Format(lisErrorReadingXmlFile, ['"', CurFilename, '"', LineEnding, E.Message]), Format(lisErrorReadingXmlFile, ['"', CurFilename, '"', LineEnding, E.Message]),
mtError, [mbCancel], 0); mtError, [mbCancel]);
end; end;
end; end;
end; end;

View File

@ -48,7 +48,7 @@ uses
ComCtrls, LCLType, ExtCtrls, Menus, LCLProc, Graphics, Dialogs, ComCtrls, LCLType, ExtCtrls, Menus, LCLProc, Graphics, Dialogs,
SynEdit, SynEdit,
CodeToolManager, DefineTemplates, CodeToolManager, DefineTemplates,
IDEWindowIntf, IDEImagesIntf, IDEWindowIntf, IDEImagesIntf, IDEDialogs,
LazarusIDEStrConsts, CodeToolsOptions, CodeToolsDefPreview, TransferMacros, LazarusIDEStrConsts, CodeToolsOptions, CodeToolsDefPreview, TransferMacros,
EditorOptions, InputFileDialog, IDEOptionDefs, LazConf, IDEProcs, EditorOptions, InputFileDialog, IDEOptionDefs, LazConf, IDEProcs,
EditDefineTree; EditDefineTree;
@ -441,9 +441,9 @@ begin
if (SelTreeNode=nil) or (SelTreeNode.Parent=nil) then exit; if (SelTreeNode=nil) or (SelTreeNode.Parent=nil) then exit;
SelDefNode:=TDefineTemplate(SelTreeNode.Data); SelDefNode:=TDefineTemplate(SelTreeNode.Data);
if SelDefNode.IsAutoGenerated then begin if SelDefNode.IsAutoGenerated then begin
MessageDlg(lisCodeToolsDefsNodeIsReadonly, IDEMessageDialog(lisCodeToolsDefsNodeIsReadonly,
lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited, lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited,
mtInformation,[mbCancel],0); mtInformation,[mbCancel]);
exit; exit;
end; end;
// move node one lvl up in TreeView // move node one lvl up in TreeView
@ -470,15 +470,15 @@ begin
SelDefNode:=TDefineTemplate(SelTreeNode.Data); SelDefNode:=TDefineTemplate(SelTreeNode.Data);
PrevDefNode:=SelDefNode.Prior; PrevDefNode:=SelDefNode.Prior;
if (SelDefNode.IsAutoGenerated) or (PrevDefNode.IsAutoGenerated) then begin if (SelDefNode.IsAutoGenerated) or (PrevDefNode.IsAutoGenerated) then begin
MessageDlg(lisCodeToolsDefsNodeIsReadonly, IDEMessageDialog(lisCodeToolsDefsNodeIsReadonly,
lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited, lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited,
mtInformation,[mbCancel],0); mtInformation,[mbCancel]);
exit; exit;
end; end;
if (not (PrevDefNode.Action in DefineActionBlocks)) then begin if (not (PrevDefNode.Action in DefineActionBlocks)) then begin
MessageDlg(lisCodeToolsDefsInvalidPreviousNode, IDEMessageDialog(lisCodeToolsDefsInvalidPreviousNode,
lisCodeToolsDefsPreviousNodeCanNotContainChildNodes, lisCodeToolsDefsPreviousNodeCanNotContainChildNodes,
mtInformation,[mbCancel],0); mtInformation,[mbCancel]);
exit; exit;
end; end;
// move node one lvl down in TreeView // move node one lvl down in TreeView
@ -500,9 +500,9 @@ begin
if (SelTreeNode=nil) then exit; if (SelTreeNode=nil) then exit;
SelDefNode:=TDefineTemplate(SelTreeNode.Data); SelDefNode:=TDefineTemplate(SelTreeNode.Data);
if (SelDefNode.IsAutoGenerated) then begin if (SelDefNode.IsAutoGenerated) then begin
MessageDlg(lisCodeToolsDefsNodeIsReadonly, IDEMessageDialog(lisCodeToolsDefsNodeIsReadonly,
lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited, lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited,
mtInformation,[mbCancel],0); mtInformation,[mbCancel]);
exit; exit;
end; end;
if FLastSelectedNode=SelTreeNode then FLastSelectedNode:=nil; if FLastSelectedNode=SelTreeNode then FLastSelectedNode:=nil;
@ -524,9 +524,9 @@ begin
if SelTreeNode=nil then exit; if SelTreeNode=nil then exit;
SelDefNode:=TDefineTemplate(SelTreeNode.Data); SelDefNode:=TDefineTemplate(SelTreeNode.Data);
if (SelDefNode.IsAutoGenerated) then begin if (SelDefNode.IsAutoGenerated) then begin
MessageDlg(lisCodeToolsDefsNodeIsReadonly, IDEMessageDialog(lisCodeToolsDefsNodeIsReadonly,
lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited, lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited,
mtInformation,[mbCancel],0); mtInformation,[mbCancel]);
exit; exit;
end; end;
if Sender=ConvertActionToDefineMenuItem then NewAction:=da_Define if Sender=ConvertActionToDefineMenuItem then NewAction:=da_Define
@ -1219,17 +1219,17 @@ begin
end; end;
if (ParentNode<>nil) and (TDefineTemplate(ParentNode.Data).IsAutoGenerated) if (ParentNode<>nil) and (TDefineTemplate(ParentNode.Data).IsAutoGenerated)
then begin then begin
MessageDlg(lisCodeToolsDefsInvalidParent, IDEMessageDialog(lisCodeToolsDefsInvalidParent,
Format(lisCodeToolsDefsAutoCreatedNodesReadOnly, [LineEnding]), Format(lisCodeToolsDefsAutoCreatedNodesReadOnly, [LineEnding]),
mtInformation, [mbCancel],0); mtInformation, [mbCancel]);
exit; exit;
end; end;
if (ParentNode<>nil) if (ParentNode<>nil)
and (not (TDefineTemplate(ParentNode.Data).Action in DefineActionBlocks)) then and (not (TDefineTemplate(ParentNode.Data).Action in DefineActionBlocks)) then
begin begin
MessageDlg(lisCodeToolsDefsInvalidParentNode, IDEMessageDialog(lisCodeToolsDefsInvalidParentNode,
lisCodeToolsDefsParentNodeCanNotContainCh, lisCodeToolsDefsParentNodeCanNotContainCh,
mtInformation,[mbCancel],0); mtInformation,[mbCancel]);
exit; exit;
end; end;
NewName:=FindUniqueName; NewName:=FindUniqueName;

View File

@ -663,10 +663,10 @@ begin
and AskUserIfNotFound and AskUserIfNotFound
then begin then begin
if MessageDlg(lisFileNotFound, if IDEMessageDialog(lisFileNotFound,
Format(lisTheFileWasNotFoundDoYouWantToLocateItYourself, Format(lisTheFileWasNotFoundDoYouWantToLocateItYourself,
['"', SrcFile, '"', LineEnding, LineEnding, LineEnding]) ['"', SrcFile, '"', LineEnding, LineEnding, LineEnding])
,mtConfirmation, [mbYes, mbNo], 0) <> mrYes ,mtConfirmation, [mbYes, mbNo]) <> mrYes
then Exit; then Exit;
repeat repeat
@ -967,7 +967,7 @@ begin
end; end;
end end
else begin else begin
MessageDlg(lisCCOErrorCaption, msg, mtError, [mbOk], 0) IDEMessageDialog(lisCCOErrorCaption, msg, mtError, [mbOk]);
end; end;
end; end;

View File

@ -3831,7 +3831,7 @@ procedure TEditorMouseOptions.LoadFromXml(aXMLConfig: TRttiXMLConfig;
except except
MActions.Delete(MActions.Count-1); MActions.Delete(MActions.Count-1);
//if not ErrShown then //if not ErrShown then
// MessageDlg(dlgMouseOptErrorDup, dlgMouseOptErrorDupText, mtError, [mbOk], 0); // IDEMessageDialog(dlgMouseOptErrorDup, dlgMouseOptErrorDupText, mtError, [mbOk]);
//ErrShown := True; //ErrShown := True;
end; end;
end; end;

View File

@ -36,7 +36,7 @@ uses
Dialogs, ExtCtrls, StdCtrls, ButtonPanel, SynEdit, SynHighlighterPas, Dialogs, ExtCtrls, StdCtrls, ButtonPanel, SynEdit, SynHighlighterPas,
CodeToolsStructs, CodeAtom, CodeCache, CodeToolManager, PascalParserTool, CodeToolsStructs, CodeAtom, CodeCache, CodeToolManager, PascalParserTool,
CodeTree, CodeTree,
SrcEditorIntf, LazIDEIntf, PropEdits, CustomFormEditor, JitForms, SrcEditorIntf, LazIDEIntf, PropEdits, IDEDialogs, CustomFormEditor, JitForms,
Project, LazarusIDEStrConsts, EditorOptions; Project, LazarusIDEStrConsts, EditorOptions;
type type
@ -120,10 +120,10 @@ begin
ErrMsg:=''; ErrMsg:='';
LazarusIDE.DoJumpToCodeToolBossError; LazarusIDE.DoJumpToCodeToolBossError;
end else begin end else begin
MessageDlg(lisEMDNoClass, IDEMessageDialog(lisEMDNoClass,
Format(lisEMDNoClassAt, [Code.Filename, IntToStr(Caret.Y), IntToStr( Format(lisEMDNoClassAt, [Code.Filename, IntToStr(Caret.Y), IntToStr(
Caret.X)]), Caret.X)]),
mtError,[mbCancel],0); mtError,[mbCancel]);
end; end;
exit; exit;
end; end;
@ -141,9 +141,9 @@ begin
finally finally
CodeToolBoss.FreeListOfPCodeXYPosition(ListOfPCodeXYPosition); CodeToolBoss.FreeListOfPCodeXYPosition(ListOfPCodeXYPosition);
if ErrMsg<>'' then begin if ErrMsg<>'' then begin
MessageDlg(lisCCOErrorCaption, IDEMessageDialog(lisCCOErrorCaption,
Format(lisEMDUnableToShowEmptyMethodsOfTheCurrentClassBecause, Format(lisEMDUnableToShowEmptyMethodsOfTheCurrentClassBecause,
[LineEnding, ErrMsg]), mtError, [mbCancel], 0); [LineEnding, ErrMsg]), mtError, [mbCancel]);
end; end;
end; end;
end; end;

View File

@ -601,10 +601,10 @@ procedure TExternalToolDialog.AddButtonClick(Sender: TObject);
var NewTool: TExternalToolOptions; var NewTool: TExternalToolOptions;
begin begin
if fExtToolList.Count>=MaxExtTools then begin if fExtToolList.Count>=MaxExtTools then begin
MessageDlg(lisExtToolMaximumToolsReached, IDEMessageDialog(lisExtToolMaximumToolsReached,
Format(lisExtToolThereIsAMaximumOfTools, [IntToStr(MaxExtTools Format(lisExtToolThereIsAMaximumOfTools, [IntToStr(MaxExtTools
)]), )]),
mtInformation,[mbCancel],0); mtInformation,[mbCancel]);
exit; exit;
end; end;
NewTool:=TExternalToolOptions.Create; NewTool:=TExternalToolOptions.Create;

View File

@ -3542,6 +3542,7 @@ resourcestring
// file checks // file checks
lisUnableToCreateFile = 'Unable to create file'; lisUnableToCreateFile = 'Unable to create file';
lisUnableToCreateFile4 = 'Unable to create file %s';
lisCanNotCreateFile = 'Can not create file %s%s%s'; lisCanNotCreateFile = 'Can not create file %s%s%s';
lisExtendUnitPath = 'Extend unit path?'; lisExtendUnitPath = 'Extend unit path?';
lisTheDirectoryIsNotYetInTheUnitPathAddIt = 'The directory %s%s%s is not ' lisTheDirectoryIsNotYetInTheUnitPathAddIt = 'The directory %s%s%s is not '

View File

@ -37,7 +37,7 @@ uses
// synedit, codetools // synedit, codetools
SynRegExpr, SourceLog, KeywordFuncLists, BasicCodeTools, SynRegExpr, SourceLog, KeywordFuncLists, BasicCodeTools,
// IDEIntf // IDEIntf
IDEWindowIntf, LazIDEIntf, SrcEditorIntf, MainIntf, IDEWindowIntf, LazIDEIntf, SrcEditorIntf, IDEDialogs, MainIntf,
// ide // ide
LazarusIDEStrConsts, InputHistory, SearchResultView, Project; LazarusIDEStrConsts, InputHistory, SearchResultView, Project;
@ -957,8 +957,8 @@ begin
Cnt:= DoSearch; Cnt:= DoSearch;
except except
on E: ERegExpr do on E: ERegExpr do
MessageDlg(lisUEErrorInRegularExpression, E.Message,mtError, IDEMessageDialog(lisUEErrorInRegularExpression, E.Message,mtError,
[mbCancel],0); [mbCancel]);
end; end;
finally finally
ListPage.Caption:= Format('%s (%d)',[ListPage.Caption,Cnt]); ListPage.Caption:= Format('%s (%d)',[ListPage.Caption,Cnt]);

View File

@ -3051,7 +3051,7 @@ begin
Result:=EditorComponent.SearchReplace(aFindText, aReplaceText, anOptions); Result:=EditorComponent.SearchReplace(aFindText, aReplaceText, anOptions);
except except
on E: ERegExpr do begin on E: ERegExpr do begin
MessageDlg(lisUEErrorInRegularExpression, E.Message,mtError,[mbCancel],0); IDEMessageDialog(lisUEErrorInRegularExpression, E.Message,mtError,[mbCancel]);
exit; exit;
end; end;
end; end;
@ -3068,7 +3068,7 @@ begin
end end
else begin else begin
Again := False; Again := False;
MessageDlg(ACaption, AText, mtInformation, [mbOK], 0); IDEMessageDialog(ACaption, AText, mtInformation, [mbOK]);
end; end;
if not Again then if not Again then
Manager.DeleteLastJumpPointClicked(Self); Manager.DeleteLastJumpPointClicked(Self);
@ -10395,9 +10395,9 @@ begin
if ActEdit.ReadOnly and (ActEdit.CodeBuffer<>nil) if ActEdit.ReadOnly and (ActEdit.CodeBuffer<>nil)
and (not ActEdit.CodeBuffer.IsVirtual) and (not ActEdit.CodeBuffer.IsVirtual)
and (not FileIsWritable(ActEdit.CodeBuffer.Filename)) then begin and (not FileIsWritable(ActEdit.CodeBuffer.Filename)) then begin
MessageDlg(ueFileROCap, IDEMessageDialog(ueFileROCap,
ueFileROText1+ActEdit.CodeBuffer.Filename+ueFileROText2, ueFileROText1+ActEdit.CodeBuffer.Filename+ueFileROText2,
mtError,[mbCancel],0); mtError,[mbCancel]);
exit; exit;
end; end;
ActEdit.EditorComponent.ReadOnly := not(ActEdit.EditorComponent.ReadOnly); ActEdit.EditorComponent.ReadOnly := not(ActEdit.EditorComponent.ReadOnly);