Page 2 of 2

Posted: Tue Sep 02, 2008 2:32 pm
by Antonio Linares
Günther,

You can not use numbers for topics when using CHM files. It does not work. Please use strings. i.e:

HelpTopic("Setup") // this works fine with your CHM file

Use strings that correspond to one of the Contents entries, or a specific opic string from your CHM builder tool.

Regarding the use of lShow, what we do is to avoid the show of help if the help is already displayed. It can't be a CLASSDATA or you will be limited a just one shown help from your app, when you can have several simultaneously (not the same as "recursive", that is what lShow controls).

Posted: Tue Sep 02, 2008 4:09 pm
by byte-one
Antonio, the problem is also without a defined nHelpid from dialog! The ::help() from the window-class is called twice if F1 pressed on the dialog!

Posted: Tue Sep 02, 2008 6:31 pm
by Antonio Linares
Günther,

Please test this EXE using your CHM file (not included):
http://rapidshare.com/files/142115491/testhelp.zip.html

Posted: Wed Sep 03, 2008 8:20 am
by byte-one
Antonio, your EXE not functioning! I have msginfos included in dialog.prg and windows.prg. This show that at first are called the help from dialog (this is okay and functioning also with helpID) but then is called the help from main window! (this should not be!)

Posted: Wed Sep 03, 2008 10:40 am
by Antonio Linares
Günther,

We are not using your modified dialog.prg and window.prg. We use our standard FWH library, with our recent changes.

Could you please explain why our EXE is not working right ? Please describe how to reproduce it. Thanks,

We are testing it here in Vista 32 and works ok.

Posted: Wed Sep 03, 2008 11:28 am
by byte-one
Antonio, please download this ZIP and read testhelp.txt.
All others can also download the files to test the helptest.exe with the helpfile.

http://byte-one.com/helptest.zip

Posted: Wed Sep 03, 2008 9:36 pm
by byte-one
I have now tested with a dialog called from a dialog. The same thing! First called the help from the shown dialog, then called the help from parent dialog and at end the help from main window. The right ding is to only show the help from focused dialog or window and NOT call all the helps from the complete hierarchie!

Popup help is functioning but should only called with the"?" symbol in dialogmenu. F1 should shown the normal help for this dialog or window. For popup help should the file to be set with a function like SetHelpPopup( popupfile )!

Posted: Wed Sep 03, 2008 10:02 pm
by Antonio Linares
Günther,

> Antonio, please download this ZIP and read testhelp.txt.

There is NO a "goto" topic in your CHM file.

Change your example to use "Setup" topic, that does exists!

DEFINE DIALOG oDlg NAME "test" TITLE "Help-Test-Dialog with Help-ID 11" HELPID "Setup"

REDEFINE BUTTON ID 104 OF oDlg ACTION HelpTopic( "Setup" )

I have the feeling that you don't read what I am telling you...

Posted: Wed Sep 03, 2008 10:32 pm
by Antonio Linares
Günther,

What we have noticed, and we agree with you, is that HelpTopic() is non modal when using CHM files, so F1 goes to other windows too, as static lShow is not a solution for a non modal situation.

We are working to provide a solution.

Posted: Wed Sep 03, 2008 11:04 pm
by Antonio Linares
Günther,

Fixed. This is the required change:

Code: Select all | Expand

METHOD Help( nWParam, nLParam ) CLASS TDialog

   local hWndChild := HelpCtrlHwnd( nLParam ), nAtChild

   static lShow := .f.

   ::lHelpIcon = .f.

   if ! lShow
      lShow = .t.
      if ( nAtChild := AScan( ::aControls, { | o | o:hWnd == hWndChild } ) ) != 0 .and. ;
         ! Empty( ::aControls[ nAtChild ]:nHelpID )
         ::aControls[ nAtChild ]:HelpTopic()
      else
         ::HelpTopic()
      endif
      lShow = .f.
      return 1  // NEW !!!!!!!!
   endif   

return nil

Here you have your modified PRG, RC and the EXE:
http://rapidshare.com/files/142429970/gunther.zip.html
I kindly ask other readers to test it and confirm how it works for you, thanks

Posted: Wed Sep 03, 2008 11:13 pm
by byte-one
Oh Antonio, its functioning! I am happy!!!!!!

The CHM you uploaded is defect!? On itself can not called any topics.

This points are also to view:

1.) Popup help is functioning but should only called with the"?" symbol in dialogmenu. F1 should shown the normal help for this dialog or window.
2.) For popup help should the file to be set with a function like SetHelpPopup( popupfile )!
3.) The coordinates from the popup-help is the mouse-position. It should be the position from the control if the mouse-position could be on any position when F1 pressed. (only if point 1.) are aktive!)

Posted: Sat Sep 06, 2008 9:40 am
by byte-one
I have made some changes from this points:

1.) Popup help is functioning but should only called with the"?" symbol in dialogmenu. F1 should shown the normal help for this dialog or window.
2.) For popup help should the file to be set with a function like SetHelpPopup( popupfile )!
3.) The coordinates from the popup-help is the mouse-position. It should be the position from the control if the mouse-position could be on any position when F1 pressed. (only if point 1.) are aktive!)


to 2.) In the file helpchm.prg i defined the functions SetHelpPopup() and GetHelpPopup() to define the textfile embedded in the CHM.
to 3.) I have also changed control.prg (method __helpTopic()), help32.prg and helpchm.prg to set the coordinates relativ to the calling control!

Antonio, please show me an way to 1.). It is not good, when F1 on an get shows the popup-help from this get-control. It should show the HelpTopic from the dialog! Only the "?" in dialog sysmenu should show the popup!

If all points OK, I will publish you the changes to inspect.