mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 14:59:08 +02:00
IDE/LCL: clean up
git-svn-id: trunk@30706 -
This commit is contained in:
parent
f7b1c18634
commit
e365096d77
@ -57,7 +57,6 @@ type
|
||||
private
|
||||
FKeywordPrefixNode: THelpNode;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
function GetNodesForKeyword(const HelpKeyword: string;
|
||||
var ListOfNodes: THelpNodeQueryList; var ErrMsg: string
|
||||
): TShowHelpResult; override;
|
||||
@ -270,25 +269,18 @@ end;
|
||||
|
||||
{ TSimpleFPCKeywordHelpDatabase }
|
||||
|
||||
constructor TSimpleFPCKeywordHelpDatabase.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
KeywordPrefix:='FPCKeyword_';
|
||||
end;
|
||||
|
||||
function TSimpleFPCKeywordHelpDatabase.GetNodesForKeyword(
|
||||
const HelpKeyword: string; var ListOfNodes: THelpNodeQueryList;
|
||||
var ErrMsg: string): TShowHelpResult;
|
||||
var
|
||||
Path: String;
|
||||
KeyWord: String;
|
||||
begin
|
||||
Result:=shrHelpNotFound;
|
||||
if (csDesigning in ComponentState) then exit;
|
||||
if (KeywordPrefix<>'')
|
||||
and (LeftStr(HelpKeyword,length(KeywordPrefix))=KeywordPrefix) then begin
|
||||
if (FPCKeyWordHelpPrefix<>'')
|
||||
and (LeftStr(HelpKeyword,length(FPCKeyWordHelpPrefix))=FPCKeyWordHelpPrefix) then begin
|
||||
// HelpKeyword starts with KeywordPrefix
|
||||
KeyWord:=copy(HelpKeyword,length(KeywordPrefix)+1,length(HelpKeyword));
|
||||
KeyWord:=copy(HelpKeyword,length(FPCKeyWordHelpPrefix)+1,length(HelpKeyword));
|
||||
// test: testfcpkeyword
|
||||
if KeyWord='testfcpkeyword' then begin
|
||||
// this help database knows this keyword
|
||||
@ -296,9 +288,7 @@ begin
|
||||
// show the user a dialog to choose
|
||||
if FKeywordPrefixNode=nil then
|
||||
FKeywordPrefixNode:=THelpNode.CreateURL(Self,'','');
|
||||
Path:=copy(HelpKeyword,length(KeywordPrefix)+1,length(HelpKeyword));
|
||||
FKeywordPrefixNode.Title:='Pascal keyword '+Path;
|
||||
FKeywordPrefixNode.URL:='file://'+Path;
|
||||
FKeywordPrefixNode.Title:='Pascal keyword '+KeyWord;
|
||||
CreateNodeQueryListAndAdd(FKeywordPrefixNode,nil,ListOfNodes,true);
|
||||
Result:=shrSuccess;
|
||||
end;
|
||||
@ -315,7 +305,7 @@ begin
|
||||
Result:=shrHelpNotFound;
|
||||
if not (Query is THelpQueryKeyword) then exit;
|
||||
KeywordQuery:=THelpQueryKeyword(Query);
|
||||
KeyWord:=copy(KeywordQuery.Keyword,length(KeywordPrefix)+1,length(KeywordQuery.Keyword));
|
||||
KeyWord:=copy(KeywordQuery.Keyword,length(FPCKeyWordHelpPrefix)+1,length(KeywordQuery.Keyword));
|
||||
debugln(['TSimpleFPCKeywordHelpDatabase.ShowHelp Keyword=',Keyword]);
|
||||
end;
|
||||
|
||||
|
@ -126,6 +126,8 @@ var
|
||||
// and can be overidden by a package like turbopoweriprodsgn.lpk
|
||||
CreateIDEHTMLProvider: TCreateIDEHTMLProviderEvent = nil;// will be set by the IDE
|
||||
|
||||
var
|
||||
FPCKeyWordHelpPrefix: string = 'FPCKeyword_';
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -998,7 +998,7 @@ begin
|
||||
if (ListOfPascalHelpContextList=nil)
|
||||
or (ListOfPascalHelpContextList.Count=0) then exit;
|
||||
// add the registered nodes
|
||||
debugln('THelpDatabase.GetNodesForPascalContexts A ID="',ID,'" ListOfPascalHelpContextList.Count=',dbgs(ListOfPascalHelpContextList.Count));
|
||||
//debugln('THelpDatabase.GetNodesForPascalContexts A ID="',ID,'" ListOfPascalHelpContextList.Count=',dbgs(ListOfPascalHelpContextList.Count));
|
||||
if FSearchItems<>nil then begin
|
||||
// check every pascal context
|
||||
for j:=0 to ListOfPascalHelpContextList.Count-1 do begin
|
||||
|
Loading…
Reference in New Issue
Block a user