Discussion:
atomicselection attribute problem
(too old to reply)
Todor Todorov
2006-02-05 14:52:25 UTC
Permalink
I am writing a HTML editor. I have a challenge the atomicselection attribute
in IE 6. Let me give an example:

Here is some text with <span atomicselection="true">an atomic selectable
part</span>.

If the user selects the span, the selection will look like this:

Here is some text with <span atomicselection="true">[sel_start]an atomic
selectable part[sel_end]</span>.

The user can now copy and paste or simply drag and drop the selected text.
The result can look like this:

Here is some [sel_start]an atomic selectable part[sel_end] text with <span
atomicselection="true"></span>.

It is clear that the user now moved the "atomic" text out of the
atomicselection tag and the text is no longer protected. The user can edit
it as (s)he wishes.

Can ypu please point to a solution to this problem? One idea I had is to
extend the selection to include the <span> tag as well, but I don't know ho
to do that. I am hosting the web browser control and have access to the COM
interfaces, but only limited access/influence on the HTML being displayed.

Thanks!
Wei-Dong XU [MS]
2006-02-06 06:38:14 UTC
Permalink
Hi Todor,

"I am writing a HTML editor"
Currently as I know on this issue, you should be editting the html code in
the design mode of html component. At the design mode, if we are going to
enable the ATOMICSELECTION, we will need to send one IDM_ATOMICSELECTION
command to the html component. This MSDN article introduces the command id:
IDM_ATOMICSELECTION Command ID
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/r
eference/constants/idm_atomicselection.asp

This reference article introduces more information about the
ATOMICSELECCTION attribute.
ATOMICSELECTION Attribute
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref
erence/properties/atomicselection.asp

Based on my seperience, I'd suggest please use the IOleCommandTarget::Exec
method to send this command.

Please feel free to let me know if you have any further question on this
issue.

Best Regards,
Wei-Dong XU
Microsoft Support
---------------------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
---------------------------------------------------------------------------
It is my pleasure to be of any assistance.

Loading...