[lazarus] Help system completed

Tony Maro tony at maro.net
Fri Apr 11 01:08:32 EDT 2003


I just realized that despite the check for csDesigning in
ComponentState, it still runs that code segment during design mode in
the Create method.

Anybody have an idea why?

-Tony

On Fri, 2003-04-11 at 00:13, Tony Maro wrote:
> Mattias (et al),
> 
> Attached are two files.
> 
> One is the help system component.  Drop this on a form and it implements
> an HTML context sensitive help system.
> 
> The other is a diff I have tried to make.  Basically all I did was add a
> "HelpID" integer property to TWinControl and the expose that in some of
> the standard controls such as TEdit and TMemo.  I peeked inside the diff
> and it seemed to show other differences - possibly CVS had some newer
> files than I did when I created the diff.  I don't know if this will
> cause problems for you, but like I said I didn't do anything major, just
> did as described above.
> 
> Hopefully you will find this useful enough for the LCL.
> 
> Quick rundown on the THelpSystem component:
> 
> You can specify a "preferred browser" such as "opera" and it will try to
> find it first.  if it can't find it then it will look for mozilla,
> opera, galeon and konqueror in that order.  If you don't specify a
> browser it checks those four.  If it's compiled in win32 it looks for
> iexplorer (should that be iexpore?) after mozilla and opera.  I can't
> test that though... so I assume it works.
> 
> When created at runtime, it hooks itself into the parent form's onkeyup
> event.  It will STILL PROCESS any existing onkeyup event for the form,
> because it will read that address out if it exists and call it after
> executing it's own code.  When destroyed, it replaces the form's
> original OnKeyUP event handler.  There may be a better way with
> messages, but this was the only way I could figure out how to do it
> without a major headache and things that are over my head.
> 
> You provide a stringlist that contains the helpid number followed by a
> colon followed by the URL such as:
> 
> 0:http://tony.maro.net/
> 1:/home/tony/test.htm
> 
> It will also do relative URL's to the executable.  When this property is
> set you can do something like:
> 
> 2:help/test.htm
> 
> and it will look for [applicationpath]/help/test.htm
> 
> if the requested helpID doesn't exist in the stringlist, it will look
> for a helpid in the stringlist of "0" and open it as the default help
> page.  If all else fails it throws a messagedlg stating it couldn't open
> the help system.
> 
> Feel free to rename the component or hack the code or flat out reject it
> at will.  I find it very useful for my project, maybe others will.
> 
> -- 
> Tony Maro
> tony at maro.net
> http://tony.maro.net/
> 
> Check out my software "CheckBook Tracker"
> A GPL (free) replacement for Microsoft Money!
-- 
Thanks,

Tony Maro

Need a Linux replacement for Microsoft Money?
Check out CheckBook Tracker!
http://tony.maro.net/






More information about the Lazarus mailing list