I try to use internet explorer as Html editor in designmode from Delphi. I use the Mshtml and SHDocVw units and editing goes fine. I also display some glyphs like the 'special characters' option in Word (e.g. paragraph: ¶). Now there appears to be a difference between caret positioning between Hiding Glyphs or Showing Glyphs.
1) Hidden glyphs
When pressing <End>
key on 'Sample Text', the Caret is positioned directly after the last character 't': Sample Text|
When I now type the <1>
key, the html result is as I expected:
<p>Sample Text1</p>
2) Showing glyphs
When pressing <End>
key on 'Sample Text', the Caret is not directly positioned after the last character, but after the Glyph : Sample Text¶ |
When I now type the <2>
key, the html result is
<p>Sample Text</p>2
So the '2' ends up outside the paragraph.
I also checked what happens if I hide the glyphs before pressing a non-system key:
3) Showing glyphs and hiding them afterwards
First show glyphs, press <End>
key on 'Sample Text', hide the glyphs, the Caret is still not directly positioned after the last character, there appears some space in the screen (no real character/element in the html-source however): Sample Text |
When I now type the <3>
key, the html result is
<p>Sample Text</p>3
So the '3' still ends up outside the paragraph.
The same problems exist with keys like <Home>
and the arrow keys.
How can I prevent this? Is there a way to prevent caret placement after the glyph, or change it to the last character of the paragraph?