Browse Source

--- Merging r13656 into '.':
A packages/winunits-base/tests/hhex.pp
A packages/winunits-base/tests/hhex2.pp
--- Merging r13694 into '.':
U packages/winunits-jedi/src/jwawintype.pas

git-svn-id: branches/fixes_2_4@13776 -

marco 16 years ago
parent
commit
36eaf43a7e

+ 2 - 0
.gitattributes

@@ -5072,6 +5072,8 @@ packages/winunits-base/src/wininet.pp svneol=native#text/plain
 packages/winunits-base/src/winver.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/OOHelper.pp svneol=native#text/plain
 packages/winunits-base/tests/OOTest.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/testcom1.pp svneol=native#text/plain
 packages/winunits-base/tests/testcom2.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
 packages/winunits-base/tests/testver.pp svneol=native#text/plain

+ 43 - 0
packages/winunits-base/tests/hhex.pp

@@ -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 - 0
packages/winunits-base/tests/hhex2.pp

@@ -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.

+ 3 - 3
packages/winunits-jedi/src/jwawintype.pas

@@ -1131,15 +1131,15 @@ type
 //
 //
 
 
 type
 type
-  INT_PTR = Integer;
+  INT_PTR = PtrInt;
   {$EXTERNALSYM INT_PTR}
   {$EXTERNALSYM INT_PTR}
   PINT_PTR = ^INT_PTR;
   PINT_PTR = ^INT_PTR;
   {$EXTERNALSYM PINT_PTR}
   {$EXTERNALSYM PINT_PTR}
-  UINT_PTR = Longword;
+  UINT_PTR = PtrUint;
   {$EXTERNALSYM UINT_PTR}
   {$EXTERNALSYM UINT_PTR}
   PUINT_PTR = ^UINT_PTR;
   PUINT_PTR = ^UINT_PTR;
   {$EXTERNALSYM PUINT_PTR}
   {$EXTERNALSYM PUINT_PTR}
-  LONG_PTR = Longint;
+  LONG_PTR = PtrInt;
   {$EXTERNALSYM LONG_PTR}
   {$EXTERNALSYM LONG_PTR}
   PLONG_PTR = ^LONG_PTR;
   PLONG_PTR = ^LONG_PTR;
   {$EXTERNALSYM PLONG_PTR}
   {$EXTERNALSYM PLONG_PTR}