Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-04

Help system completed

9 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tony Maro

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 http://tony.maro.net/ Check out my software "CheckBook Tracker" A GPL (free) replacement for Microsoft Money! -------------- next part -------------- A non-text attachment was scrubbed... Name: gz00019.gz Type: application/octet-stream Size: 2865 bytes Desc: "helpsystem.tgz" Url : http://localhost/pipermail/lazarus/attachments/20030411/df48f713/gz00019.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: gz00018.gz Type: application/octet-stream Size: 3063 bytes Desc: "diff.gz" Url : http://localhost/pipermail/lazarus/attachments/20030411/df48f713/gz00018.obj

Reply by email

Lord Satan
to Tony Maro
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.

Shouldn't Galeon be found before Mozilla as every Galeon user has to install Mozilla anyway and if you check for Mozilla first Galeon would never be run?

Reply by email

Olivier Guilbaud
to Tony Maro: Attached are two files. One is the help system component. Drop this on a form and it…

How imagine seeks it to you in this help? (kind the CTRL+F1 on a word cle of Delphi which posts the help of this key word)

I saw some a system help which uses a kind file map with the following structure :
keyword1 /toto.html#themocle
keywork2 /toto.html#themocle2

this file is coded for found the key words very quickly.

I had found the idea interesting.

The IDE of FreePascal a system of assistance with the possibility has of adding files (in different format). The only thing which is not very at the point, it is (in my opinion) posting. Pages HTML, it is nevertheless rather universal.

There is not a possibility of adpter existing it?

Olivier

Earlier message 93 lines
----- Original Message ----- From: "Tony Maro" To: "Lazarus List" Sent: Friday, April 11, 2003 7:25 AM Subject: Re: [lazarus] Help system completed > 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 > > > > 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/ > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives > >

Reply by email

Tony Maro
to Lord Satan: Shouldn't Galeon be found before Mozilla as every Galeon user has to install Mozilla…
Lord Satan wrote 5 lines
Of course you can. But why does the component look for it, when it never will be used? Either you don't look for Galeon at all or you do it in an order that makes sense. That was the point and not if you can use Galeon or not.

Mmm.. well I guess i did it this way because I hate Galeon. ;-)

But I see your point.

I've got to do some major reworks to fit the help system to the changes Mattias has made to the TApplication object and such, so I'll put Galeon first just for you. And then when I use the control I'll be putting Mozilla as preferred. Galeon doesn't handle XML files as well as the newer Mozilla does.

-Tony

Reply by email

Tony Maro
to Tony Maro: Attached are two files. One is the help system component. Drop this on a form and it…

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

Tony Maro wrote 62 lines
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 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/

Reply by email

Lord Satan
to Lord Satan: Shouldn't Galeon be found before Mozilla as every Galeon user has to install Mozilla…
Show quoted text 8 lines
> > 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. > > Shouldn't Galeon be found before Mozilla as every Galeon user has to install Mozilla anyway and if you check for Mozilla first Galeon would never be run? In that case you can simply set Galeon as preferred browser, no ?

Of course you can. But why does the component look for it, when it never will be used? Either you don't look for Galeon at all or you do it in an order that makes sense. That was the point and not if you can use Galeon or not.

Reply by email

Michael Van Canneyt
to Lord Satan: Shouldn't Galeon be found before Mozilla as every Galeon user has to install Mozilla…
Lord Satan wrote 5 lines
> 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. Shouldn't Galeon be found before Mozilla as every Galeon user has to install Mozilla anyway and if you check for Mozilla first Galeon would never be run?

In that case you can simply set Galeon as preferred browser, no ?

Michael.

Reply by email

olivier
to Tony Maro: Attached are two files. One is the help system component. Drop this on a form and it…

Sorry, I simply was mistaken in message for to answer : Change the object with : " Re: [ lazarus ] Context sensitive help "

I said simply that the Htlm assistances, it is well. I simply extrapolated while speaking about the Lazarus assistance and which would have to be allowed to find of the key words in addition to the number.

Olivier

Le Vendredi 11 Avril 2003 23:21, Tony Maro a �crit :

Show quoted text 29 lines
On Friday 11 April 2003 01:12 pm, Olivier Guilbaud wrote: > How imagine seeks it to you in this help? (kind the CTRL+F1 on a word > cle of Delphi which posts the help of this key word) > > I saw some a system help which uses a kind file map with the following > structure : > keyword1 /toto.html#themocle > keywork2 /toto.html#themocle2 > > this file is coded for found the key words very quickly. > > I had found the idea interesting. > > The IDE of FreePascal a system of assistance with the possibility has of > adding files (in different format). The only thing which is not very at > the point, it is (in my opinion) posting. Pages HTML, it is nevertheless > rather universal. > > There is not a possibility of adpter existing it? > > Olivier I have a feeling that Babel didn't do this post justice. I have no idea what was said. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Tony Maro
to Tony Maro: Attached are two files. One is the help system component. Drop this on a form and it…
Olivier Guilbaud wrote 21 lines
How imagine seeks it to you in this help? (kind the CTRL+F1 on a word cle of Delphi which posts the help of this key word) I saw some a system help which uses a kind file map with the following structure : keyword1 /toto.html#themocle keywork2 /toto.html#themocle2 this file is coded for found the key words very quickly. I had found the idea interesting. The IDE of FreePascal a system of assistance with the possibility has of adding files (in different format). The only thing which is not very at the point, it is (in my opinion) posting. Pages HTML, it is nevertheless rather universal. There is not a possibility of adpter existing it? Olivier

I have a feeling that Babel didn't do this post justice. I have no idea what was said.

Reply by email