Recent

Author Topic: LazHelp, a help system written in and for Lazarus  (Read 22962 times)

JD

  • Hero Member
  • *****
  • Posts: 1802
Re: LazHelp, a help system written in and for Lazarus
« Reply #15 on: March 26, 2011, 10:37:13 am »
Wonderful! Can't tell you how much I appreciate this. I usually create help files using the CHM format & that's tricky to use on Linux.

Now with LazHelp, all things being equal, we'll eventually have something like the C++ library wxWindows' wxHTML Help which runs native on all systems that the library supports. Who knows, maybe LazHelp will one day be like HelpBlocks http://www.helpblocks.com/

Can I insert graphics, like screenshots, in the files that LazHelp creates?

Keep up the good work.
Windows (10, 7) - Lazarus 2.1/FPC 3.2, Delphi

Indy 10.6 series; mORMot; Zeos 7.3; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8894
  • FPC developer.
Re: LazHelp, a help system written in and for Lazarus
« Reply #16 on: March 26, 2011, 01:20:20 pm »
Wonderful! Can't tell you how much I appreciate this. I usually create help files using the CHM format & that's tricky to use on Linux.

?

Quote
Now with LazHelp, all things being equal, we'll eventually have something like the C++ library wxWindows' wxHTML Help which runs native on all systems that the library supports. Who knows, maybe LazHelp will one day be like HelpBlocks http://www.helpblocks.com/

Helpblocks is a content generator for existing helpsystem, not a helpsystem in itself?

NelsonN

  • Jr. Member
  • **
  • Posts: 77
    • Beam Me Up!
Re: LazHelp, a help system written in and for Lazarus
« Reply #17 on: March 26, 2011, 04:35:39 pm »
Great work. I am about to start on the help system for my cross platform product and have been reading up on the help systems for all three operating systems I will offer my product for and now this will make that a lot easier and with less headaches.

Thank you.
Lazarus trunk / FPC 3.0.4 / 32-bit and 64-bit with Windows 10.

Bad Sector

  • New Member
  • *
  • Posts: 47
    • Runtime Terror
Re: LazHelp, a help system written in and for Lazarus
« Reply #18 on: March 26, 2011, 07:18:36 pm »
Can I insert graphics, like screenshots, in the files that LazHelp creates?

You can (the editor has a screenshot of itself in the help) but it is a bit tricky because your code has somehow to provide the TGraphic instance to use. Use the img element with a name like, f.e. "shot1" and register an event handler for the onGetGraphic event of the TLazHelp instance you use. When the help system requests the graphic it will call this handler with the "shot1" (or whatever you used) in the AName parameter and expect a TGraphic instance for the AGraphic parameter.

Personally in the editor i just used a PNG as a lazarus resource (made with the lazres tool that comes with lazarus). It was a single image so that was ok. If you have many images you might want to automate things a bit and possibly load them from external files. In that case your onGetGraphic should load the image file requested from the disk and provide it as a graphic. Note that TLazHelp will keep the instance cached so it won't ask you each time the image needs to be displayed. However also note that it doesn't make a copy of the instance: it uses the instance you provided so you need to keep the instances around for the lifetime of the TLazHelp instance. An easy method to do that is to use TImage instances to load the graphics and have the TLazHelp instance as the owner of the TImage instance so that once TLazHelp is destroyed it will also destroy the TImages.

Note that if you want to use graphics which are already used in your program (like button icons, etc) you don't need to duplicate things. Just register them with TLazHelp using the TLazHelp.RegisterGraphic method which accepts a name and a TGraphic instance. For image lists use TLazHelp.RegisterImageList which uses a prefix for each image (f.e. for a "il" prefix the first image will be "il0", the second "il1", etc). Note that unlike the above methods, the images from image list are copied to private bitmaps.

In the future i might add the ability to embed base64-encoded images for easier use of external graphics.
Kostas "Bad Sector" Michalopoulos
Runtime Terror

JD

  • Hero Member
  • *****
  • Posts: 1802
Re: LazHelp, a help system written in and for Lazarus
« Reply #19 on: March 26, 2011, 09:22:27 pm »

Lazarus' CHM component makes CHM files look ugly in Linux.

The own generated CHMs should be fine mostly. Of course you can't use all of CSS with an embedded browser.
 
« Last Edit: March 30, 2011, 06:07:52 pm by marcov »
Windows (10, 7) - Lazarus 2.1/FPC 3.2, Delphi

Indy 10.6 series; mORMot; Zeos 7.3; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

 

TinyPortal © 2005-2018