From b615c640883d95280b52a40fce746b9a7cf6d289 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 24 Apr 2006 19:38:34 +0000 Subject: [PATCH] Help for FPC messages: removing latex tags git-svn-id: trunk@9176 - --- ide/helpfpcmessages.pas | 45 ++++++++++++++++++++++++++++++++----- ide/lazarusidestrconsts.pas | 2 ++ 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ide/helpfpcmessages.pas b/ide/helpfpcmessages.pas index bebb955e9d..4e5a50c43c 100644 --- a/ide/helpfpcmessages.pas +++ b/ide/helpfpcmessages.pas @@ -38,7 +38,7 @@ interface uses Classes, SysUtils, LCLProc, Dialogs, FileUtil, TextTools, MacroIntf, - ConfigStorage, HelpIntf, HelpHTML; + LazarusIDEStrConsts, ConfigStorage, HelpIntf, HelpHTML; const lihcFPCMessages = 'FreePascal Compiler messages'; @@ -83,7 +83,8 @@ procedure CreateFPCMessagesHelpDB; function AddFPCMessageHelpItem(const Title, URL, RegularExpression: string ): THelpDBIRegExprMessage; -function FindFPCMessageComment(const CommentFile, Msg: string): string; +function FindFPCMessageComment(const CommentFile, Msg: string; + ExtractText: boolean): string; procedure ParseFPCMessagesFile(Lines: TStrings; const SearchMessage: string; var FoundComment: string); @@ -119,15 +120,48 @@ begin FPCMessagesHelpDB.RegisterItem(Result); end; -function FindFPCMessageComment(const CommentFile, Msg: string): string; +function FindFPCMessageComment(const CommentFile, Msg: string; + ExtractText: boolean): string; var sl: TStringList; + p: Integer; + TagStart: LongInt; + Level: Integer; begin Result:=''; sl:=TStringList.Create; try sl.LoadFromFile(CommentFile); ParseFPCMessagesFile(sl,Msg,Result); + if ExtractText and (Result<>'') then begin + p:=1; + while (p'' then begin Result:=shrSuccess; CreateNodeQueryListAndAdd(DefaultNode,nil,ListOfNodes,true); @@ -339,7 +373,8 @@ begin if NewNode=DefaultNode then begin if FoundComment<>'' then begin Result:=shrSuccess; - MessageDlg('Help',FoundComment,mtInformation,[mbOk],0); + MessageDlg(lisHFMHelpForFreePascalCompilerMessage, FoundComment, + mtInformation,[mbOk],0); end else begin Result:=shrHelpNotFound; end; diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index f26c17bd8f..036e1f93f9 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -3023,6 +3023,8 @@ resourcestring lisDebugOptionsFrmHandledByDebugger = 'Handled by Debugger'; lisDebugOptionsFrmResumeHandled = 'Resume Handled'; lisDebugOptionsFrmResumeUnhandled = 'Resume Unhandled'; + lisHFMHelpForFreePascalCompilerMessage = 'Help for FreePascal Compiler ' + +'message'; implementation end.