Blog
Page: 0 ... 5 ... 10 ... 15 ... 20 ... 25 ... 30 ... 35 ... 40 ... 45
The Rich Edit Saga
Date: 10/8/2005
Well I think I'm finally done with playing around with rich edit controls for a while. I've hit a wall and it's not moving.

I've given up trying to embed mozilla on win32, it's just too large a dependency. So I'm using IE at the moment and the Easy Web Editor as the content. It works fine if you load it into a normal IE window but if you embed it in an application via the IE ActiveX control it behaves differently.

The problem stems from the fact that the body's onKeyDown handle is not called in the activex version. This causes several problems, firstly and most direly the delete key doesn't work. Secondly the key handler fixes IE's editor putting p tags everywhere instead of br's.

So I put together a simple activex test case for people interested in helping fix the problem to download and play with.
(4) Comments | Add Comment

i.Scribe in the Arctic
Date: 9/8/2005
2 intrepid aussies are treking across the Artic reporting their adventures via email. And yup they are using the XGate software and i.Scribe via Iridium satellite phone to blog their progress.

Speaking of Scribe is interesting places I got an email postcard from someone travelling europe with i.Scribe installed on the flash card of their digital camera. Great for internet cafes :)

Anyone else got some cool Scribe travel stories?
(0) Comments | Add Comment

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.
(0) Comments | Add Comment

Scribe Rich Edit
Date: 5/8/2005
Ok, so don't assume this might work someday but this is NOT a mock up, it's a real screenshot.



Technically it's RTE inside the Mozilla ActiveX Control as installed with the ZIP download of the Mozilla suite, hosted via ATL in C++... in a plugin.

*breathe*

Currently I have no way of getting the edited HTML back out of the control. But it's fun to play with.
(4) Comments | Add Comment

Hosting Mozilla/IE in one page of C++
Date: 5/8/2005
I don't think anyone has put is as succiently as this before. It's written with ATL and you'll need to link with comsupp.lib but other than that it's pretty self contained.

All you need to do is start using the IWebBrowser2 pointer 'Browser'.
(12) Comments | Add Comment

Windows XP is only good for English
Date: 3/8/2005
I love windows ;) you just have to hand it to them for screwing it up royally.

Lets see, Scribe had a problem receiving mail on 2k/XP systems where the user's username had an accent in the name. So I created an account called Máya and loaded up Scribe, sure enough it fails to receive mail. Then I get to the bottom of the problem, and the windows API call GetTempPath is returning the wrong path. Given that the path to the temp folder is:
C:\\Documents and Settings\\Máya\\Local Settings\\Temp
GetTempPath on XP no less returns you:
C:\\DOCUME~1\\MAYA\\LOCALS~1\\Temp
which doesn't actually exist because the username has been "ascii-fied".

So I change the code to use GetTempPathW and try and compile. VC++ 6 falls over with the error message "can't create temp file". Hehehehehe. I wonder why!

Then of course applications that use GetTempPath start breaking and doing weird things. Like some app, not sure which, decided in it's infinite wisdom that since the temp path doesn't exist... well it should CREATE it. Yeah that's the right thing to do... sure... so now you have the real temp path and an "ascii-fied" version. Which isn't going to confuse anyone or create problems... ;)
(0) Comments | Add Comment