Caret postioning affected by glyphs usage in Internet explorer in designmode

問題 Caret postioning affected by glyphs usage in Internet explorer in designmode

  • 2012年4月14日 10:47
     
      包含代码

    Hi,

    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>

    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>

    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?

    Kind regards,

    Bert

全部回复

  • 2012年4月16日 7:52
     
     
    You can try Regular expression

    NEU_ShieldEdge

  • 2012年4月17日 6:38
     
     

    Thank you for your answer,

    Indeed I could use that, but if there's an other way by having more control over Caret placement, I would prefer that sollution.