wx.HtmlHelpController: How to show SPECIFIC help (language independent)?

Hello all,
I want to give context-dependant help but I want to do it in a language-independent an clean way.

The wx.html.HtmlHelpController.Display() function seems to work only with the verbatim title of a help topic .

wx.html.HtmlHelpController.DisplayID() shows just the content.

Look at the followiing example

I create an HtmlhelpController and open some books :
in __init__ of the frame
         self.Help = wx.html.HtmlHelpController()
         _addBook("helpfiles/incredix_essential.hhp")

I have an event handler who gets a context and shall translate it into something the the Helpcontroller understands. It look like so:

     def PsOnHelp(self,topic, sequence, context, value=None):
         print context
         if context == 'CustomerForm':
             #self.Help.DisplayID(1004)
             #self.Help.Display('helpfiles/LP_implementation.htm')
             self.Help.Display('Zweck') # this works
         else:
             self.Help.DisplayContents()

As you can see I tried the numeric Ids, the file names and what not. The only thing that works is the text itself. There are a bunch of problems with this:
* Every redactional change in the help text would break this.
* It is language dependant
* The headlines must be unique over all help books.

There must be a better way

···

--
Viele Grüße / All the best

Norbert

Hello all,
sorry for being trigger-happy. The wxWidgets documentation led me on the right track. It works to use the html-filename of the topic, but *without* the path part. That is the point wehre the documentation is misleading.

DisplayID seems not to work and this makes sense in a way. The .hpp File which is read by the controller does not contan the numeric IDs at all.

Norbert

Norbert Klamann schrieb:

···

Hello all,
I want to give context-dependant help but I want to do it in a language-independent an clean way.

The wx.html.HtmlHelpController.Display() function seems to work only with the verbatim title of a help topic .

wx.html.HtmlHelpController.DisplayID() shows just the content.

Look at the followiing example

I create an HtmlhelpController and open some books :
in __init__ of the frame
        self.Help = wx.html.HtmlHelpController()
        _addBook("helpfiles/incredix_essential.hhp")

I have an event handler who gets a context and shall translate it into something the the Helpcontroller understands. It look like so:

    def PsOnHelp(self,topic, sequence, context, value=None):
        print context
        if context == 'CustomerForm':
            #self.Help.DisplayID(1004)
            #self.Help.Display('helpfiles/LP_implementation.htm')
            self.Help.Display('Zweck') # this works
        else:
            self.Help.DisplayContents()

As you can see I tried the numeric Ids, the file names and what not. The only thing that works is the text itself. There are a bunch of problems with this:
* Every redactional change in the help text would break this.
* It is language dependant
* The headlines must be unique over all help books.

There must be a better way

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Norbert Klamann wrote:

Hello all,
I want to give context-dependant help but I want to do it in a language-independent an clean way.

The wx.html.HtmlHelpController.Display() function seems to work only with the verbatim title of a help topic .

wx.html.HtmlHelpController.DisplayID() shows just the content.

Look at the followiing example

I create an HtmlhelpController and open some books :
in __init__ of the frame
        self.Help = wx.html.HtmlHelpController()
        _addBook("helpfiles/incredix_essential.hhp")

I have an event handler who gets a context and shall translate it into something the the Helpcontroller understands. It look like so:

    def PsOnHelp(self,topic, sequence, context, value=None):
        print context
        if context == 'CustomerForm':
            #self.Help.DisplayID(1004)
            #self.Help.Display('helpfiles/LP_implementation.htm')
            self.Help.Display('Zweck') # this works
        else:
            self.Help.DisplayContents()

As you can see I tried the numeric Ids, the file names and what not. The only thing that works is the text itself. There are a bunch of problems with this:
* Every redactional change in the help text would break this.
* It is language dependant
* The headlines must be unique over all help books.

There must be a better way

Are you specifying the topic name and/or ID in the help book's .hhc file?

···

--
Robin Dunn
Software Craftsman

Robin Dunn schrieb:

Norbert Klamann wrote:

SNIP

There must be a better way

Are you specifying the topic name and/or ID in the help book's .hhc file?

No, I did not know that such a beast existed.

···

--
Viele Grüße / All the best

Norbert

Norbert Klamann wrote:

Robin Dunn schrieb:

Norbert Klamann wrote:

SNIP

There must be a better way

Are you specifying the topic name and/or ID in the help book's .hhc file?

No, I did not know that such a beast existed.

See http://docs.wxwidgets.org/stable/wx_wxhtml.html#helpformat

···

--
Robin Dunn
Software Craftsman