Announcement

Collapse
No announcement yet.

Context sensitive PB help..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Context sensitive PB help..

    In PBedit's context sensitive help system, looking up keywords that
    have several uses, like COMM, always fails to show the "Found" popup
    dialog to select from. It flashes, but then disappears. At least for
    me it does. Maybe there is an update of the Roboex files somewhere?

    Anyway, while struggling with next version of Poffs, I thought I'd
    implement the same context sensitive help system in the editor I'll
    be using to view messages, and found that calling WinHelp twice
    fixes this "problem".

    Maybe useful for those of you who are developing your own PB editors.
    BTW, same approach works fine with any help file, this including
    WinApi32.hlp - but then you only have to call it once, of course,
    like in first case below..

    Code:
    #COMPILE EXE
    #INCLUDE "WIN32API.INC"
    $PBhelp = "C:\PBDLL60\BIN\pbdll.hlp" '<- NOTE! change to *your* PB path!!!
     
    '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    ' Small test of calling PB's help file for context sensitive help.
    '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    FUNCTION PBMAIN () AS LONG
      LOCAL I AS LONG, txt AS STRING
     
      MSGBOX "Call up help for COMM, PB way (?)"            '<- this is standard way and should work..
      txt = "COMM"                                          '<- show context sensitive help for this one
      I = WinHelp(0, $PBhelp, %HELP_KEY, BYVAL STRPTR(txt)) '<- %HELP_PARTIALKEY gives same result
     
      MSGBOX "Call up help for COMM, my way"
      I = WinHelp(0, $PBhelp, %HELP_INDEX, 0&)              '<- for PB help, first activate once,
      I = WinHelp(0, $PBhelp, %HELP_KEY, BYVAL STRPTR(txt)) '<- then try to find context sensitive help
    END FUNCTION
    ------------------

  • #2
    Hello,

    Also, the problem will go away if you don't close the help program between uses. ie just minimize it.

    Colin Schmidt

    ------------------
    Colin Schmidt & James Duffy, Praxis Enterprises, Canada
    [email protected]

    Comment


    • #3
      You need to BIND the help to your app.
      Use the winhwlp API and provide a handle.
      If your window terminates, the help should terminate too.


      ------------------
      hellobasic

      Comment


      • #4
        You are right Edwin. Calling WinHelp(hWnd, PBhelp, %HELP_QUIT, 0&) in
        %WM_DESTROY should be there too. This was just little sample. In some
        of my own utilities, developed for my use only, I actually often skip
        that part because I *want* the help file to remain loaded, but for
        "official" app's, one should do it (same should actually be done
        before calling up help in the routines above too).

        Colin, the problem is PBedit only is able to call up one helpfile at a time.
        If you have given it the path to winapi32.hlp in Options, it closes Pbdll.hlp
        before caling up Winapi32.hlp on unknown commands. One can always start one of
        the helpfiles manually, but better if PB can fix this problem in next release,
        if not before..


        ------------------

        Comment

        Working...
        X