mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-08 09:23:48 +02:00
* fix several help problems
This commit is contained in:
parent
38e4bf646f
commit
6515c3c524
@ -54,6 +54,7 @@ procedure DoneHelpSystem;
|
|||||||
|
|
||||||
procedure InitHelpFiles;
|
procedure InitHelpFiles;
|
||||||
procedure DoneHelpFiles;
|
procedure DoneHelpFiles;
|
||||||
|
procedure CheckHelpSystem;
|
||||||
|
|
||||||
procedure PushStatus(S: string);
|
procedure PushStatus(S: string);
|
||||||
procedure SetStatus(S: string);
|
procedure SetStatus(S: string);
|
||||||
@ -504,7 +505,10 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2001-09-10 10:52:59 pierre
|
Revision 1.4 2001-10-01 00:24:09 pierre
|
||||||
|
* fix several help problems
|
||||||
|
|
||||||
|
Revision 1.3 2001/09/10 10:52:59 pierre
|
||||||
* fix web bug 1368
|
* fix web bug 1368
|
||||||
|
|
||||||
Revision 1.2 2001/08/05 02:01:47 peter
|
Revision 1.2 2001/08/05 02:01:47 peter
|
||||||
|
@ -169,7 +169,7 @@ uses
|
|||||||
ColorSel,
|
ColorSel,
|
||||||
{$endif FVISION}
|
{$endif FVISION}
|
||||||
Systems,
|
Systems,
|
||||||
WUtils,WHlpView,WViews,WHTMLHlp,
|
WUtils,WHlpView,WViews,WHTMLHlp,WHelp,
|
||||||
FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompil,FPHelp,
|
FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompil,FPHelp,
|
||||||
FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
|
FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
|
||||||
FPDesk,FPCodCmp,FPCodTmp;
|
FPDesk,FPCodCmp,FPCodTmp;
|
||||||
@ -1164,7 +1164,10 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2001-08-05 12:23:00 peter
|
Revision 1.4 2001-10-01 00:24:09 pierre
|
||||||
|
* fix several help problems
|
||||||
|
|
||||||
|
Revision 1.3 2001/08/05 12:23:00 peter
|
||||||
* Automatically support for fvision or old fv
|
* Automatically support for fvision or old fv
|
||||||
|
|
||||||
Revision 1.2 2001/08/05 02:01:47 peter
|
Revision 1.2 2001/08/05 02:01:47 peter
|
||||||
|
@ -15,8 +15,16 @@
|
|||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
procedure TIDEApp.HelpContents;
|
procedure TIDEApp.HelpContents;
|
||||||
|
var FileID: word;
|
||||||
|
Ctx : THelpCtx;
|
||||||
|
var Found: boolean;
|
||||||
begin
|
begin
|
||||||
HelpTopic('Help_Contents'{0,hcContents,false});
|
CheckHelpSystem;
|
||||||
|
Found:=HelpFacility^.TopicSearch('Help_Contents',FileID,Ctx);
|
||||||
|
if Found then
|
||||||
|
Help(FileID,Ctx,false)
|
||||||
|
else
|
||||||
|
Help(0,hcContents,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIDEApp.HelpHelpIndex;
|
procedure TIDEApp.HelpHelpIndex;
|
||||||
@ -258,7 +266,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2001-08-04 11:30:23 peter
|
Revision 1.2 2001-10-01 00:24:09 pierre
|
||||||
|
* fix several help problems
|
||||||
|
|
||||||
|
Revision 1.1 2001/08/04 11:30:23 peter
|
||||||
* ide works now with both compiler versions
|
* ide works now with both compiler versions
|
||||||
|
|
||||||
Revision 1.1.2.2 2001/03/20 00:20:42 pierre
|
Revision 1.1.2.2 2001/03/20 00:20:42 pierre
|
||||||
|
@ -187,6 +187,7 @@ uses
|
|||||||
{$IFDEF OS2}
|
{$IFDEF OS2}
|
||||||
DosCalls,
|
DosCalls,
|
||||||
{$ENDIF OS2}
|
{$ENDIF OS2}
|
||||||
|
Strings,
|
||||||
WConsts;
|
WConsts;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -537,13 +538,40 @@ var K1: PIndexEntry absolute Key1;
|
|||||||
K2: PIndexEntry absolute Key2;
|
K2: PIndexEntry absolute Key2;
|
||||||
R: Sw_integer;
|
R: Sw_integer;
|
||||||
S1,S2: string;
|
S1,S2: string;
|
||||||
|
T1,T2 : PTopic;
|
||||||
begin
|
begin
|
||||||
S1:=UpcaseStr(K1^.Tag^); S2:=UpcaseStr(K2^.Tag^);
|
S1:=UpcaseStr(K1^.Tag^); S2:=UpcaseStr(K2^.Tag^);
|
||||||
if S1<S2 then R:=-1 else
|
if S1<S2 then
|
||||||
if S1>S2 then R:=1 else
|
begin
|
||||||
if K1^.FileID<K2^.FileID then R:=-1 else
|
Compare:=-1;
|
||||||
if K1^.FileID>K2^.FileID then R:= 1 else
|
exit;
|
||||||
R:=0;
|
end;
|
||||||
|
if S1>S2 then
|
||||||
|
begin
|
||||||
|
Compare:=1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if assigned(HelpFacility) then
|
||||||
|
begin
|
||||||
|
{ Try to read the title of the topic }
|
||||||
|
T1:=HelpFacility^.LoadTopic(K1^.FileID,K1^.HelpCtx);
|
||||||
|
T2:=HelpFacility^.LoadTopic(K2^.FileID,K2^.HelpCtx);
|
||||||
|
r:=strcomp(pchar(T1^.Text),pchar(T2^.Text));
|
||||||
|
if r>0 then
|
||||||
|
begin
|
||||||
|
Compare:=1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if r<0 then
|
||||||
|
begin
|
||||||
|
Compare:=-1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if K1^.FileID<K2^.FileID then R:=-1
|
||||||
|
else if K1^.FileID>K2^.FileID then R:= 1
|
||||||
|
else
|
||||||
|
R:=0;
|
||||||
Compare:=R;
|
Compare:=R;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -794,7 +822,9 @@ begin
|
|||||||
Inc(NLFlag);
|
Inc(NLFlag);
|
||||||
end;
|
end;
|
||||||
var KW: PIndexEntry;
|
var KW: PIndexEntry;
|
||||||
I: sw_integer;
|
I,p : sw_integer;
|
||||||
|
IsMultiple : boolean;
|
||||||
|
St,LastTag : String;
|
||||||
begin
|
begin
|
||||||
New(Keywords, Init(5000,5000));
|
New(Keywords, Init(5000,5000));
|
||||||
HelpFiles^.ForEach(@InsertKeywordsOfFile);
|
HelpFiles^.ForEach(@InsertKeywordsOfFile);
|
||||||
@ -810,11 +840,28 @@ begin
|
|||||||
KWCount:=0; Line:='';
|
KWCount:=0; Line:='';
|
||||||
T^.LinkCount:=Min(Keywords^.Count,MaxBytes div sizeof(T^.Links^[0])-1);
|
T^.LinkCount:=Min(Keywords^.Count,MaxBytes div sizeof(T^.Links^[0])-1);
|
||||||
GetMem(T^.Links,T^.LinkSize);
|
GetMem(T^.Links,T^.LinkSize);
|
||||||
|
LastTag:='';
|
||||||
for I:=0 to T^.LinkCount-1 do
|
for I:=0 to T^.LinkCount-1 do
|
||||||
begin
|
begin
|
||||||
KW:=Keywords^.At(I);
|
KW:=Keywords^.At(I);
|
||||||
AddKeyword(KW^.Tag^);
|
IsMultiple:=(LastTag=KW^.Tag^) or
|
||||||
|
((I<T^.LinkCount-1) and (KW^.Tag^=Keywords^.At(I+1)^.Tag^));
|
||||||
|
if IsMultiple then
|
||||||
|
Begin
|
||||||
|
St:=Trim(strpas(pchar(HelpFacility^.LoadTopic(KW^.FileID,KW^.HelpCtx)^.Text)));
|
||||||
|
{ Remove all special chars }
|
||||||
|
for p:=1 to Length(st) do
|
||||||
|
if ord(st[p])<=16 then
|
||||||
|
st[p]:=' ';
|
||||||
|
p:=pos(KW^.Tag^,St);
|
||||||
|
if (p=1) then
|
||||||
|
AddKeyword(St)
|
||||||
|
else
|
||||||
|
AddKeyword(KW^.Tag^+' '+St);
|
||||||
|
End
|
||||||
|
else
|
||||||
|
AddKeyword(KW^.Tag^);
|
||||||
|
LastTag:=KW^.Tag^;
|
||||||
T^.Links^[I].Context:=longint(KW^.HelpCtx);
|
T^.Links^[I].Context:=longint(KW^.HelpCtx);
|
||||||
T^.Links^[I].FileID:=KW^.FileID;
|
T^.Links^[I].FileID:=KW^.FileID;
|
||||||
end;
|
end;
|
||||||
@ -853,7 +900,10 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2001-09-18 11:33:53 pierre
|
Revision 1.3 2001-10-01 00:24:09 pierre
|
||||||
|
* fix several help problems
|
||||||
|
|
||||||
|
Revision 1.2 2001/09/18 11:33:53 pierre
|
||||||
* fix Previous Help Topic
|
* fix Previous Help Topic
|
||||||
|
|
||||||
Revision 1.1 2001/08/04 11:30:25 peter
|
Revision 1.1 2001/08/04 11:30:25 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user