Recent

Author Topic: Problem adding chm help to an application  (Read 20168 times)

msimeon

  • New Member
  • *
  • Posts: 22
Re: Problem adding chm help to an application
« Reply #30 on: October 07, 2017, 03:56:20 pm »
@wp

The images embedded in the chmdemo which I posted above are displayed by the lhelp version which comes with Lazarus. lhelp (or to be more precise: the TIpHtmlPanel), however, has lots of trouble positioning them correctly, and it also ignores a lot of the css instructions.

Does the Windows chm viewer display the images? Did you add the png files to the help project?

Yes, I compiled the chm file with Microsoft Help Workshop, and displayed using the Windows chm viewer, thanks to your detailed guidance.  The png files are included in the help project.

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Problem adding chm help to an application
« Reply #31 on: October 07, 2017, 07:32:36 pm »
- the links to chapters are ok but the links to sections do not work
- the png images included in the html files do not show up
Returning to your original question: Could you post the complete Microsoft HelpWorkshop project, i.e. hhp file plus all files needed to build the chm? Pack everything into a common zip which you can upload here. All my tests show that lhelp is able to display embedded images.

msimeon

  • New Member
  • *
  • Posts: 22
Re: Problem adding chm help to an application
« Reply #32 on: October 08, 2017, 12:23:23 pm »
@wp

Returning to your original question: Could you post the complete Microsoft HelpWorkshop project, i.e. hhp file plus all files needed to build the chm? Pack everything into a common zip which you can upload here. All my tests show that lhelp is able to display embedded images.

Here it is

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Problem adding chm help to an application
« Reply #33 on: October 08, 2017, 01:37:34 pm »
Running (almost) perfectly here - see screenshot. What is your Lazarus version? (I tested trunk, 1.8RC4 and 1.6.4 - they work correctly, 1.4.4 hangs (but I am not 100% sure if this is still the original version), 1.2 displays your help file with the images but does not update the content tree).

There are a couple of issues though:

/1/
a UTF8 issue on the index page (dettes_index.html): This is because your source files contain this meta tag:
Code: [Select]
    <meta content="text/html; charset=windows-1252" http-equiv="content-type">You are mixing up html and css syntax here. Not sure if this is generally allowed, but IpHtmlPanel does not seem to like it. The correct line would be:
Code: [Select]
    <meta content="text/html" charset="windows-1252" http-equiv="content-type">BTW: better to use UTF8 encoding.

/2/
a missing space if you have a linebreak after an </a> tag (see screenshot, where the popup hint is shown). As a workaround, until this is fixed, pull the space into the <a> tag, or move a word from the following line behind the </a>, like this:
Code: [Select]
    <p>Les données nécessaires au <a href="description.html#calculs">calcul</a> sont: </p>
« Last Edit: October 08, 2017, 01:42:03 pm by wp »

msimeon

  • New Member
  • *
  • Posts: 22
Re: Problem adding chm help to an application
« Reply #34 on: October 08, 2017, 02:02:08 pm »
@wp

I am using Lazarus 1.64; as I am new at this game (I am an amateur programmer, and more familiar with Eclipse, Java and XText) it is quite possible that lhelp did not work properly when I tried it out because my chm was not correct.  I'll go back to it, after adjusting my html files as per your comments.

Thanks again for your support

msimeon

  • New Member
  • *
  • Posts: 22
Re: Problem adding chm help to an application
« Reply #35 on: October 08, 2017, 06:25:33 pm »
@wp

Attached is a very simplistic test of displaying my chm file using lhelp.exe ; it asssumes lhelp.exe is found in the same directory as the application (but it is too big to be included in the attachmeny), together with the chm file.
It does display the images (unlike my earlier attempt)
It ignores some of the css instructions
Links within html files are not working

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Problem adding chm help to an application
« Reply #36 on: October 08, 2017, 06:52:36 pm »
Links within html files are not working
You mean something like this: If I click on the link "options" in the second paragraph on the page which opens when the node "Specifications" > "Descriptions" in the left Contents tree is clicked, the correct page is opened but the page does not scroll down to show the linked paragraph "Options"?

I could imagine that this is a bug in the IpHTMLPanel.

Unfortunately, I don't have the time at the moment to look at this issue in detail. Please write a report to the bugtracker that it is not forgotten. Attach this demo project to the report, as well as the source files creating the chm files.

msimeon

  • New Member
  • *
  • Posts: 22
Re: Problem adding chm help to an application
« Reply #37 on: October 09, 2017, 10:22:13 am »
@wp

Links within html files are not working
You mean something like this: If I click on the link "options" in the second paragraph on the page which opens when the node "Specifications" > "Descriptions" in the left Contents tree is clicked, the correct page is opened but the page does not scroll down to show the linked paragraph "Options"?

I could imagine that this is a bug in the IpHTMLPanel.

Unfortunately, I don't have the time at the moment to look at this issue in detail. Please write a report to the bugtracker that it is not forgotten. Attach this demo project to the report, as well as the source files creating the chm files.

Done ! Report number is 0032526.  I also created report 0032525 missing the attached file. It should be deleted

serbod

  • Full Member
  • ***
  • Posts: 142
Re: Problem adding chm help to an application
« Reply #38 on: October 17, 2017, 02:42:54 pm »
Who is author of chmmaker?

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Problem adding chm help to an application
« Reply #39 on: October 17, 2017, 03:02:15 pm »
Who is author of chmmaker?
Take a pick out of one of the many contributors ?

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Problem adding chm help to an application
« Reply #40 on: October 17, 2017, 03:28:37 pm »
The first commit (dated Oct 30 2008) was by Andrew Haines.

serbod

  • Full Member
  • ***
  • Posts: 142
Re: Problem adding chm help to an application
« Reply #41 on: October 17, 2017, 04:47:21 pm »
Thanks, i did another bunch of fixes and improvements to CHM-related packages.

Also, i want try to use HtmlViewer (https://github.com/BerndGabriel/HtmlViewer) as HTML view component. Is their licence is acceptable for Lasarus? It looks like GPL, but i don't sure, in DitherUnit.PAS is something about non-commercial use.

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Problem adding chm help to an application
« Reply #42 on: October 17, 2017, 05:38:02 pm »
As already mentioned above, you must provide a proper patch (relative to the current trunk version) and write a report to bugtracker. The maintainer must be able to evaluate what you changed; without a patch this is not possible. And please provide a detailed description of your modifications ("Fixes and improvements of CHM-related packages" would be ok for the headline, but certainly not for the description).

Sorry to be so nitpicking, but since Andrew seems to have retired from this activity somebody else must take care of it, and the more you help this person to understand and evaluate the fixes the more likely it is that your code is accepted.

I cannot comment on you intention to replace IpHtmlPanel with HTMLviewer. IpHtmlPanel is still rather buggy, but it is established in the help popup hints of Lazarus, therefore I think there will be some resistance. Please post this question to the mailing list because many developers do not read the forum.

serbod

  • Full Member
  • ***
  • Posts: 142
Re: Problem adding chm help to an application
« Reply #43 on: October 18, 2017, 02:09:46 pm »
Currently, i can't provide patch for trunk, because made too many changes, and that patch will contain almost whole source lines. There is lot minor changes, related to code formatting, naming and commenting. When i did that, i found some memory leaks and range violations. For example, s[1] when s='' and calling freed, but not nil-ed objects. Maybe, that solve some runtime problems. In some places lacks of documentation or comments caused wrong parameters (full path where need relative, upper/mixed case). Additional checks and sanitize added, changed access for some methods (from public to protected), some properties and parameters made read-only.

IpHtmlPanel is very strange choise for pop-up hints. It contain at least 30K lines of code and provide interactive HTML DOM model. It good for HTML pages with complex markup, but too much for simple pop-up hint.

Maybe better use RichView, that contain 3K lines of code, and provide only auto-alligned list of text blocks and drawable objects (lines, pictures, any LCL visual components). That list can be imported from HTML/RTF/PDF/TEX/BBCode/Markdown by simple one-way parsers.

 

TinyPortal © 2005-2018