HTML Reader that allows Markup: Help

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

Josh Menke wrote:

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 <WORD> 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?

Not that I can think of, although it's been a while since I've really looked at the html parser and cell classes.

I considered tagging only the paragraphs (since they're tagged with <p>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?

Have you looked at wxMozilla? It can be used in an editor mode, but I don't know if it gives you access at the level you would need...

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

I haven’t, I didn’t know there was a wxMozilla, though I suspected there would be. Is there a wrapper out yet for wxPython?

Nevermind, just found the wxPython wrapper comes with wxMozilla. Thanks.

···

On 1/16/06, Josh Menke josh@cs.byu.edu wrote:

–Josh


Robin Dunn
Software Craftsman

http://wxPython.org
Java give you jitters? Relax with wxPython!


To unsubscribe, e-mail:

wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org


Joshua Menke
NNML Lab
BYU CS
josh@cs.byu.edu


Joshua Menke
NNML Lab
BYU CS
josh@cs.byu.edu