mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 01:39:27 +02:00
* Two demoes for htmlhelp header.
git-svn-id: trunk@13656 -
This commit is contained in:
parent
1503890756
commit
f60a4e31a2
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -5056,6 +5056,8 @@ packages/winunits-base/src/wininet.pp svneol=native#text/plain
|
||||
packages/winunits-base/src/winver.pp svneol=native#text/plain
|
||||
packages/winunits-base/tests/OOHelper.pp svneol=native#text/plain
|
||||
packages/winunits-base/tests/OOTest.pp svneol=native#text/plain
|
||||
packages/winunits-base/tests/hhex.pp svneol=native#text/pascal
|
||||
packages/winunits-base/tests/hhex2.pp svneol=native#text/pascal
|
||||
packages/winunits-base/tests/testcom1.pp svneol=native#text/plain
|
||||
packages/winunits-base/tests/testcom2.pp svneol=native#text/plain
|
||||
packages/winunits-base/tests/testver.pp svneol=native#text/plain
|
||||
|
43
packages/winunits-base/tests/hhex.pp
Normal file
43
packages/winunits-base/tests/hhex.pp
Normal file
@ -0,0 +1,43 @@
|
||||
Program Hhex;
|
||||
{
|
||||
Small example/test of the html help OCX.
|
||||
Marco van de Voort (C) 2009
|
||||
|
||||
Copy ref.chm from the CHM distribution to this dir.
|
||||
}
|
||||
{$mode objfpc}{$H+}
|
||||
uses htmlhelp;
|
||||
|
||||
|
||||
var
|
||||
HelpfileName : AnsiString;
|
||||
htmltopic : AnsiString;
|
||||
res : Integer;
|
||||
|
||||
Begin
|
||||
Helpfilename:='ref.chm';
|
||||
htmltopic := 'ref/refli3.html';
|
||||
|
||||
Writeln('Html example 1');
|
||||
Writeln('note: Copy ref.chm from the CHM distribution to this dir');
|
||||
|
||||
// HH_DISPLAY_INDEX or HH_DISPLAY_SEARCH work too.
|
||||
Writeln('calling TOC');
|
||||
Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_DISPLAY_TOC,0);
|
||||
Writeln('program now blocked on readln, press enter (in console window) to continue');
|
||||
|
||||
readln;
|
||||
writeln('Showing a topic that is probably about dialog.');
|
||||
// probably because due to automatic generation filenames and exact contact can drift.
|
||||
Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_DISPLAY_TOPIC,ptruint(pchar(htmltopic)));
|
||||
Writeln('program now blocked on readln, press enter (in console window) to continue');
|
||||
readln;
|
||||
Writeln('ready. Note that the windows die automatically on exit of the program');
|
||||
|
||||
{
|
||||
Not demoed yet : HH_HELPCONTEXT. Load on ID, because we have no files that do that yet
|
||||
}
|
||||
|
||||
|
||||
end.
|
||||
|
46
packages/winunits-base/tests/hhex2.pp
Normal file
46
packages/winunits-base/tests/hhex2.pp
Normal file
@ -0,0 +1,46 @@
|
||||
Program hhex2;
|
||||
{
|
||||
Small example/test of the html help OCX.
|
||||
Marco van de Voort (C) 2009
|
||||
|
||||
Copy rtl.chm from the CHM distribution to this dir. Test keyword/alink search.
|
||||
}
|
||||
|
||||
Uses HTMLHelp;
|
||||
|
||||
var
|
||||
keyword : ansistring;
|
||||
HelpfileName : AnsiString;
|
||||
htmltopic : AnsiString;
|
||||
res : Integer;
|
||||
ah : PHH_AKLINK ;
|
||||
|
||||
Begin
|
||||
Helpfilename:='rtl.chm';
|
||||
keyword:='Sysutils' ;
|
||||
|
||||
New(ah);
|
||||
fillchar(ah^,sizeof(ah^),#0);
|
||||
ah.cbstruct:=sizeof(tagHH_AKLINK);
|
||||
ah.fReserved := FALSE ;
|
||||
ah.pszKeywords :=pansichar(keyword);
|
||||
ah.pszUrl := NIL ;
|
||||
ah.pszMsgText :='Text succes' ;
|
||||
ah.pszMsgTitle :='Text fail';
|
||||
ah.pszWindow := NIL ;
|
||||
ah.fIndexOnFail:= false;
|
||||
|
||||
|
||||
Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_DISPLAY_INDEX,PTRUINT(PAnsiChar(Keyword)));
|
||||
|
||||
// keyword search seems to have same effect.
|
||||
Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_ALINK_LOOKUP,PTRUINT(AH));
|
||||
writeln(ah.pszkeywords);
|
||||
writeln(ah.pszurl);
|
||||
writeln(ah.pszmsgtext);
|
||||
writeln(ah.pszmsgtitle);
|
||||
writeln(ah.pszwindow);
|
||||
writeln(res);
|
||||
|
||||
readln;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user