Blog
Rich Edit Progress
Date: 9/8/2005
Well, after a lot of poking around with HTML rich text controls I can say that it certainly wasn't the easy solution I was looking for. I've tried both the IE and Mozilla control and they both have show stopper issues.

IE
  • Delete key doesn't work.
  • Lots of weird duplicate p tags everywhere.
Mozilla
  • Layout of iframes can't be made to fill remaining space. 100% width and height are broken in that they get there dimensions off the body element instead of the parent div element. Meaning I can't resize the edit area to the client part of the window.
  • Bug #303829 means you can't implement popup dialogs in Mozilla.
  • No way of reliably calling javascript through the ActiveX interface. Meaning that to save the edited HTML back into a DOM accessable field you have to implement ugly hacks like retasking onmouseout to do the work for you and then programatically move the mouse out of the window.
  • It only works with the 11mb Mozilla ZIP release, not the installer version of Mozilla or Firefox or the Mozilla ActiveX installer. That sucks.
  • No way to get the size of the content without scrollbars to resize the window to fit everything in.
So I have a "kinda" working solution with the Mozilla control but it still sucks in some parts. So I'm not keen to release it on unsuspecting users.

I have learnt some cool new things though:
  • You can disable scroll bars on an element by using the style "overflow: hidden;"
  • There are special CSS colours that map to you current system colours. Very useful for creating UI elements that intergrate with the rest of an application.
  • At least in Mozilla an iframe with "display: hidden;" still appears as empty space in the layout of elements. If you use "display: none;" then you can't address it anymore, it kinda disappears. Sooooo what I did is "width:0px; height:0px" until I needed it and then set it's size with javascript when I needed it. But you do that like this:
    ctrl.style.width = "100px";
    ctrl.style.height = "80px";
    
    instead of
    ctrl.width = "100px";
    ctrl.height = "80px";
    
    shrug.
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]