Recent

Author Topic: [SOLVED] Where is TCHMHelpDatabase? Again.  (Read 4260 times)

ggallo

  • New Member
  • *
  • Posts: 13
[SOLVED] Where is TCHMHelpDatabase? Again.
« on: September 18, 2013, 04:59:57 pm »
No solution found yet, so I resurrect this topic in a new post!

Hi All!

I'm new to this forum, and the main reason I registered to ask this question. I program with Lazarus a while (and object pascal not only a while), and I found every answer to my questions until now.

I'd like to add CHM context sensitive help to my application, but there are no documentation on this. The wiki page said that it works from 1.0 release, but I can't find the above cited class nor I found some howto on this topic. I read the Lazarus sources to find out how to use, but nothing useful found there.

The simplest thing: I can't found how to reach that when I press the F1 key in my application to show me the CHM file. The chmhelp demo working but it not deals with linking the help opening to application OnHelp event, not dealing with context sensitive help showing. It's really not dealing with any help related things except starting the LHelp app and sending a command to it. That not so useful in an average GUI app, I think. I don't want to bother with starting the help viewer because it's an already solved problem in lazarus with HTML content (I think).

So, if anybody knows how can I replace THTMLHelpDatabase with a CHM version, or knows exactly that it is not possible yet (opposite to wiki page), please write it here for me (us).

Thanks!
« Last Edit: September 19, 2013, 12:11:32 am by ggallo »
Windows 7 64 bit | openSuSE 12.3 32 bit
Lazarus 1.2.4 | fpc 2.6.4 | Win32/64 | Linux gtk2

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Where is TCHMHelpDatabase? Again.
« Reply #1 on: September 18, 2013, 05:26:40 pm »
Quote
It's really not dealing with any help related things except starting the LHelp app and sending a command to it. That not so useful in an average GUI app, I think. I don't want to bother with starting the help viewer because it's an already solved problem in lazarus with HTML content (I think).
I don't get it, this is how a context sensitive help should be executed. What do you actually want?

ggallo

  • New Member
  • *
  • Posts: 13
Re: Where is TCHMHelpDatabase? Again.
« Reply #2 on: September 18, 2013, 09:41:25 pm »
I don't get it, this is how a context sensitive help should be executed. What do you actually want?

If I'm right, there are some automatism in Lazarus built in to handle help requests (e.g. pressing the F1 key) with HTML files.
I want to use this automatism, but with CHM files. I don't want to code everywhere an LHelp call on the current context, look for pressing F1 key, or any similar things by hand. It's already done in the system with a HTML help source.

The wiki shows the official method based on HTML help:

Quote
Setup HTML help for your application

Adding HTML help to your application is easy:
Put a THTMLHelpDatabase on a form.
Set AutoRegister to true.
Set KeywordPrefix to HTML/. It means all keywords must start with the string HTML/.
Set BaseURL to file://html/. This will search the HTML files in the sub folder html. You can specify full paths like file:///usr/lib/yourhelp/ or an URL like http://www.yoursite.com/.
Put a THTMLBrowserHelpViewer on the form. This component can start the user's default browser.
Set AutoRegister to true.

Creating a help entry
Now create the sub folder html and create a html page html/edit1.html.
Put a TEdit on a form.
Set HelpType to htKeyword
Set HelpKeyword to html/edit1.html
When running the program you can focus the edit and press F1 to invoke the help.

So I would like to use this form, but with CHM files. The wiki page above the previous section says:

Quote
You can use a CHMHelpDatabase control like the HTMLHelpdatabase control described below.

But the CHMHelpDatabase control non-existent yet, or I can't find it. This is my problem.
Windows 7 64 bit | openSuSE 12.3 32 bit
Lazarus 1.2.4 | fpc 2.6.4 | Win32/64 | Linux gtk2

ggallo

  • New Member
  • *
  • Posts: 13
[SOLVED] Where is TCHMHelpDatabase? Again.
« Reply #3 on: September 19, 2013, 12:10:47 am »
So, I answer my question to let other find it with search:

Finally I found the missing components in the latest snapshot of Lazarus and in the SVN repo. I then get the "components/chmhelp" contents from there (it's version 0.2 instead of version 0.1 received with Lazarus 1.0.12 installer), installed it in Lazarus IDE, and then inserted in my application with some success (but I init it manually in code, not on the form at design time - it works that way, too).

For the first time, CHMHelpDatabase and LHelpConnector works, context set to a TEdit at design time showing in the LHelp viewer app on F1 key press.
I get some LHelp/Connector error messages (Help Viewer Error - lhelp does not respond), I currently investigating this.

I think the wiki page must be corrected in this manner.

I try to update this post/topic if I find the source of the above error message.
Also I try to set it up to use Windows integrated CHM viewer (not cross-platform, but OS build-in).
Windows 7 64 bit | openSuSE 12.3 32 bit
Lazarus 1.2.4 | fpc 2.6.4 | Win32/64 | Linux gtk2

 

TinyPortal © 2005-2018