Message files and SHOWHELP

Started by Jim M., June 16, 2015, 04:25:55 PM

Previous topic - Next topic

Jim M.

We've just started using message files and the SHOWHELP function to implement some very limited context-sensitive help.

Is there any way we can customize the interface?  Specifically we would like to rename the 'Screen' and 'Resume' buttons.

Also:  Is there any way to have the help open in a child window?

Finally:  is there any way to format the help text?  I have discovered that adding html coding does not work.

Thanks,
Jim

Reuben B.

Jim,

Rather than answering your questions directly, I'll give our existing developers a chance to provide some examples of how they have implemented help in their applications.

What I will point out for you is that if you look in FGLDIR/src and FGLDIR/lib, you will see some files named fglhelp.* that contain the code that is executed when showhelp is called.   You can override these functions by placing a function with the same name and signature higher up in the search path.

Reuben
Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero

Reuben B.

Hopefully you found the fglhelp files in FGLDIR/src and can see how the showhelp function is implemented.

To see what I mean by overriding the function, add to your .4gl ...

Code (genero) Select
FUNCTION showhelp(i)
DEFINE i INTEGER

    MESSAGE i
END FUNCTION


and note what happens.  So you can customize showhelp() completely as you like from that starting point.

QuoteSpecifically we would like to rename the 'Screen' and 'Resume' buttons.
If you wanted to just rename the 'Screen' and 'Resume' buttons, you'll note that in fglhelp.per, they are defined TEXT=%"fgl.helpViewer.screen"

so if you added to your strings (.str) file an entry for this token, e.g.
fgl.helpViewer.screen = "My Screen Button Text"

then you can customize that way without overriding the .4gl or .per

QuoteIs there any way to have the help open in a child window?

By default it should.  It should open the window with style="viewer".  I wonder if you have omitted that style from your .4st.  Have a look in FGLDIR/lib/default.4st for the viewer entry and add to your .4st if you have.

QuoteFinally:  is there any way to format the help text?  I have discovered that adding html coding does not work.

It should as it is displayed to a TEXTEDIT which will by default has htmlFormat.  A quick test with HTML code for bold worked for me.  Again check your .4st and make sure you haven't disabled the use of html for textedits.

Hope that helps,

Reuben
Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero

Jim M.

Thanks for the help,  we won't have time to try this out immediately but it sounds like this advice should take care of our issues.