2

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?

bert4573
  • 31
  • 2
  • Can you show some code that exhibits this behaviour? – whosrdaddy Apr 16 '12 at 20:30
  • I didn't write any (special) code needed to create this behaviour. I did write code to put the Webbrowser in Designmode by setting designmode := 'on' in the OnDocumentComplete eventhandler and did write code to use Glyphs according to [http://msdn.microsoft.com/en-us/library/ie/aa969614%28v=vs.85%29.aspx](http://msdn.microsoft.com/en-us/library/ie/aa969614%28v=vs.85%29.aspx) of which I used the IDM_ADDTOGLYPHTABLE part. – bert4573 Apr 17 '12 at 06:17

0 Answers0