I’m writing an html reader that allows users to mark it up. That is,
highlight words, add notes, etc. I’ve tried several text-like controls
and have lately settled on wx.html.HtmlWindow.
However, the problem is in order to store the marks, notes, etc., in a
portable way, I need to get information from a user’s interaction with
the window about what exact part of the original HTML source they
interacted with.
This is hard with HtmlWindow, as far as I can see, because the cells
you get out of a cell-clicked event don’t give much information about
the original html. So I added a taghandler and put every word in the
documents within a tag that gives each word’s paragraph
and word. This way I know exactly where every word cell is by paragraph
and word. The handler just adds a word cell like normal, but use
SetId(“paragraph,word”) to identify each word.
Unfortunately, this makes the parser or window rendering very very
slow. I’m guessing this is because the parser doesn’t efficiently
handle documents with a large number of tags.
Is there anyway around this? Or do any of you know another, more
efficient way to get paragraph,word indexes out of an HtmlWindow
without custom tags? I considered tagging only the paragraphs (since
they’re tagged with
s anyways), but this gets even more
complex since I have to figure out how to count words given in cells.
Is there a better control to use? I’ve tried TextCtrl and the stc
classes, but while those make it a little easier to see exactly where I
am in a document when I click, etc., it’s hard to make hyperlinks works
well because those controls don’t give enough info about how they wrap
the lines, etc.
Any help would be appreciated. Thanks!
–Josh
···
–
Joshua Menke
NNML Lab
BYU CS
josh@cs.byu.edu