#3 scroll to selected anchor

closed-accepted
None
5
2005-09-21
2005-09-20
No

When an entry is clicked in the contents or index
browser, xchm opens the page containing the entry, but
it doesn't scroll to the entry. This is not optimal,
especially when the entry is an anchor somewhere in a
very long page. This patch fixes this. It's been tested
browsing the NSIS (nsis.sourceforge.net) documentation
(you will not want to use it without this patch any
longer ;- ...)

Markus Schwarzenberg

Discussion

    • assigned_to: nobody --> thewhiterabbit
    • status: open --> closed-accepted
     
  • Logged In: YES
    user_id=162312

    Ok, added it to CVS. It's going to be in v1.3. Thanks for the patch.

     
  • Logged In: YES
    user_id=81393

    Thanks. But now I'm getting the impression the described
    behavior is actually a wxwindows bug, because:
    * xchm always passed (without this patch) the complete
    location to wxHtmlWindow::LoadPage(), so why wxHtmlWindow
    doesn't scroll to the anchor when it loads the page?

    * There are situations where this patch first calls
    wxHtmlWindow::LoadPage(<LOC_WITHOUT_ANCHOR>), after that it
    calls ScrollToAnchor(<ANCHOR>), but after that wx still
    doesn't scroll to the anchor.

    Can you reproduce this behavior on a platform != solaris?
    Test case:
    * open NSIS.chm.
    * click Chapter2/Compiler --> "2.4 Compiler" opens.
    * click highligted word "here" --> "4.8. Installer
    Atributes" opens. Actually, the window should be scrolled
    down to "4.8.2.4 SetCompressor"
    This happens even with this patch, which does an explicit
    ScrollToAnchor.
    Attached a new patch wich contains some debugging printfs.

     
  • Logged In: YES
    user_id=162312

    You're right, the patch is useless :-D. Just removed it.
    You'd better let the wxWidgets people know about it (though
    I doubt they'll fix it anytime soon).
    Cheers.