[ wxwindows-Bugs-1696116 ] HtmlWindow selection support inadequate

SourceForge.net noreply at sourceforge.net
Sat Apr 7 10:21:21 PDT 2007


Bugs item #1696116, was opened at 2007-04-07 10:21
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1696116&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: HTML
Group: Feature request
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ken Seehart (kenseehart)
Assigned to: Vaclav Slavik (vaclavslavik)
Summary: HtmlWindow selection support inadequate

Initial Comment:
Currently, the features in wxHtmlWindow associated with selection are arbitrary and incomplete.

Currently the API only allows programmable selection of word (by screen position) or all.  This is analogous to supporting addition on integers but only in the range from 10 to 50 not including primes.

It is impossible to get the current selection range.  Only a /copy/ of the currently selected plain text is available.

It is impossible to implement general selection features with the current API and there is no workaround that I can see.

The best way to handle selection is to base it on html source positions.  That way it is completely general and predictable.  For example, the "view selection source" feature of Firefox would become trivial to implement.  Also, it would be possible to save and restore selection ranges when adding content to the bottom.  In fact, selection functionality might be the only thing standing in the way of implementing some simple HTML editing capabilities (though my intent is not to open Pandora's Box here)!

The correct feature set would be as follows (just like TextCtrl):
----------------------------------
wxHtmlWindow::GetSelection

virtual void GetSelection(long* from, long* to) const

Gets the current selection span relative to the HTML source. If the returned values are equal, there was no selection.
----------------------------------
wxHtmlWindow::SetSelection

virtual void SetSelection(long from, long to)

Selects the text for html source starting at the first position up to (but not including) the character at the last position. If both parameters are equal to -1 all text in the control is selected.
----------------------------------

In order to tie this in with existing functionality it would be also helpful to translate between html source indexes and cells (e.g. get the source range associated with a cell object).



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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1696116&group_id=9863




More information about the wx-dev mailing list