Recent

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

msimeon

  • New Member
  • *
  • Posts: 22
Re: Problem adding chm help to an application
« Reply #15 on: October 05, 2017, 04:23:20 pm »
@wp

Here is the full set of files.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Problem adding chm help to an application
« Reply #16 on: October 06, 2017, 12:57:43 am »
1) The project file .lpr is not correct. It is missing the instruction to create the main form.
2) You must assign help context numbers to the controls for which you want to provide context-sensitive help (property HelpContext). These numbers are defined in [MAPS] and [ALIAS] sections of the chm project file (hhp) - this is missing as well.

Find in the attachment a worked-out example containing all files needed for the chm project; the project is created by means of the batch file "compile.bat" (you may have to adapt the path to the Microsoft HTML Help Compiler). There is also a complete Lazarus project from which this help file can be called from three buttons as context-sensitive help (press F1), or from a help menu.

This is an instruction how to create a chm help project for the Microsoft HTML Help Workshop: http://www.libertybasicuniversity.com/lbnews/nl108/chm.htm

And this gives information on how to create the [MAP] and [ALIAS] sections: https://support.microsoft.com/de-de/help/189453/how-to-prepare-html-help-files-for-context-sensitive-help

Creating chm help is much easier if you use a help authoring tool, such as HelpNDoc or HelpScribble - almost like writing a text in Word. The basic version of HelpNDoc is free, sometimes the Pro version is available at a high discount at BitsDuJour - please use Google to find these sites, I don't want to make too much advertisement for them.
« Last Edit: October 06, 2017, 01:10:53 am by wp »

msimeon

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

Many thanks for the very comprehensive reply.  It should be most helpful for me to find my way.
MS

serbod

  • Full Member
  • ***
  • Posts: 142
Re: Problem adding chm help to an application
« Reply #18 on: October 06, 2017, 11:46:58 am »
I did some fixes and improvements to LHelp - https://github.com/serbod/lazhelp

Internal HTML pages representation depends on IPro package and also need some fixing.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Problem adding chm help to an application
« Reply #19 on: October 06, 2017, 11:55:45 am »
Why don't you provide a patch?

serbod

  • Full Member
  • ***
  • Posts: 142
Re: Problem adding chm help to an application
« Reply #20 on: October 06, 2017, 12:10:53 pm »
Why don't you provide a patch?

I contacted to mantainer, Andrew Haines.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Problem adding chm help to an application
« Reply #21 on: October 06, 2017, 02:36:36 pm »
I contacted to mantainer, Andrew Haines.
He has not been active lately. A patch for Lazarus sources would be the right way to go. Use "git format-patch" to create it.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Problem adding chm help to an application
« Reply #22 on: October 06, 2017, 02:46:40 pm »
Please refrain from excessive reformatting. While there is a small benefit visually, it usually complicates sifting through version system history more than it is worth.

serbod

  • Full Member
  • ***
  • Posts: 142
Re: Problem adding chm help to an application
« Reply #23 on: October 06, 2017, 03:45:04 pm »
Please refrain from excessive reformatting. While there is a small benefit visually, it usually complicates sifting through version system history more than it is worth.

That's not so easy, nice formatting and naming greatly helps to detect and avoid many bugs. Also, it helps maintain code, decrease time, needed to read code and get it designation. Difficulties encountered only once, when merging to SVN. And then code will be read by users countless times.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Problem adding chm help to an application
« Reply #24 on: October 06, 2017, 04:07:43 pm »
Please refrain from excessive reformatting. While there is a small benefit visually, it usually complicates sifting through version system history more than it is worth.

That's not so easy, nice formatting and naming greatly helps to detect and avoid many bugs.

True. But most of those are getting to a basic, minimal level, and not driving that to extremes. Worse, then you also get into the realm of personal taste rather than safe programming practices.

Quote
Also, it helps maintain code, decrease time, needed to read code and get it designation. Difficulties encountered only once, when merging to SVN. And then code will be read by users countless times.

And then again by merging to fixes, and then again when tracing the history of a bug. Actually there will be more developers doing that then users studying the code.

serbod

  • Full Member
  • ***
  • Posts: 142
Re: Problem adding chm help to an application
« Reply #25 on: October 06, 2017, 04:21:21 pm »
What "safe programming practices"? I personnaly follows CERT Coding Standards and Embarcadero Object Pascal Style Guide. And there is no rules, that restrict changes in SVN because it difficults changes history studing.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Problem adding chm help to an application
« Reply #26 on: October 06, 2017, 06:14:11 pm »
What "safe programming practices"?

I just meant somewhat decent formatting and sane variablenames. While it is generally a good idea, how far you must push this, and if you should modify existing code is often a matter of taste, and doesn't have too much to do with bug avoidance anymore.

Quote
I personnaly follows CERT Coding Standards and Embarcadero Object Pascal Style Guide. And there is no rules, that restrict changes in SVN because it difficults changes history studing.

Well, they only document new code, not the tradeoffs for changing existing code in a team.


« Last Edit: October 06, 2017, 06:16:11 pm by marcov »

msimeon

  • New Member
  • *
  • Posts: 22
Re: Problem adding chm help to an application
« Reply #27 on: October 07, 2017, 09:56:47 am »
@wp

Thanks again, I finally got it working.


msimeon

  • New Member
  • *
  • Posts: 22
Re: Problem adding chm help to an application
« Reply #28 on: October 07, 2017, 11:47:37 am »
@serbod
I did some fixes and improvements to LHelp - https://github.com/serbod/lazhelp

Internal HTML pages representation depends on IPro package and also need some fixing.

Can you now display correctly a chm file with images ?  This was the issue that started this discussion ! I did dowwnload and compiled your improved lhelp but to me it did not solve that particular problem.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Problem adding chm help to an application
« Reply #29 on: October 07, 2017, 11:58:11 am »
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?

 

TinyPortal © 2005-2018