HtmlEditor :  Phorum 5 The fastest message board... ever.

This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.

Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
HtmlEditor still evolving?
Posted by: Quentin Pouplard (---.upc.chello.be)
Date: Tuesday, 31-Oct-2006, 14:40:29

Hi,

I'm trying to use the control for my mail client project (http://www.sf.net/projects/myoe).

I'm based on the latest subversion repository, are you interested in my changes? My objective is to get a good mail editor in HTML and an easy to use control in order to add HTML editing where required (event description, signature, contact comments, mail, etc...). The best imho, would be to avoid branching, but maybe you prefer keep full control of your version?

Also, I'd like to know if you have change pending (interface declaration for instance)?

best regards,

Quentin Pouplard
[myoedev.blogspot.com]

Re: HtmlEditor still evolving?
Posted by: Tim (---.gotadsl.co.uk)
Date: Tuesday, 31-Oct-2006, 16:01:54

Quentin,

I am interested in changes; of course I'm also concerned not to break existing code unless there is good reason.

Can you email your updates to me to begin with?

I am open to the idea of giving check-in rights to a few other people.

Tim

Re: HtmlEditor still evolving?
Posted by: Quentin Pouplard (---.upc.chello.be)
Date: Tuesday, 31-Oct-2006, 17:15:44

For now, I've made only one change: exposing the current selection from the control (I hope it's gonna be readable), the purpose is to allow to play with HTML directly, for inserting content that the control doesn't do by default (img with CSS style for instance). Maybe there are better ways?

[Browsable(false)]
public String SelectedText
{
get
{
try
{
if (HtmlDocument2 != null)
{
IHTMLTxtRange range = HtmlDocument2.GetSelection().createRange() as IHTMLTxtRange;

return range.htmlText;
}
return null;
}
catch
{
return "";
}
}
set
{
if (value != null && HtmlDocument2 != null)
{
IHTMLSelectionObject selection = HtmlDocument2.GetSelection();

if (selection != null)
{
IHTMLTxtRange range = HtmlDocument2.GetSelection().createRange() as IHTMLTxtRange;
if (range != null) range.pasteHTML(value);
}
}
}
}

I'm mostly implementing on top of the current control a control that contains enough UI in order to do things correctly, basically: [members.chello.be]

It's up to you, either you decide that your lib as to stay low-level mshtml, and people have to build GUI on top of that, or you want your lib to evolve to a more high-level editor. I'll understand both.

I will also have to add some code to manage image and linked content (as a mail client I need to put image as attachment, not let them client side), but I'm not sure how it will impact the html editor (probably some helper method to get a list of image, and be able to change their url to a CID).

ps: and no matter what, I'm open to share the source, on your subversion, or on the myoe one.

Re: HtmlEditor still evolving?
Posted by: Tim (---.gotadsl.co.uk)
Date: Tuesday, 31-Oct-2006, 18:09:18

> It's up to you, either you decide that your lib as to stay low-level mshtml,
> and people have to build GUI on top of that, or you want your lib to
> evolve to a more high-level editor. I'll understand both.

Personally I think the base control should be low-level but there's no reason why we shouldn't add a GUI as well, in the same way as the code currently includes the demo app.

Do you think your property should be called SelectedHTML rather than SelectedText?

Tim

Re: HtmlEditor still evolving?
Posted by: Quentin Pouplard (---.upc.chello.be)
Date: Tuesday, 31-Oct-2006, 18:33:21

I agree for the naming, I've changed it to SelectedHTML.

Now we just have to decide if we put my code in a separate assembly, on in the same one. Personally, I'd like to keep it as a single assembly, it makes things look more simple: add the assembly, drag the control, and you're done, no need to reference more assemblies. (that's the same reason I use your code including interface definition and avoid the big mshtml interrop assembly).

Maybe other people are interresting in such control? There was some beta code or binary only source posted on this forum, I'd like to make something open source and free.

Quentin

Re: HtmlEditor still evolving?
Posted by: Quentin Pouplard (---.upc.chello.be)
Date: Wednesday, 01-Nov-2006, 16:04:09

Hi,

Just another small change: in the SelectionForeColor getter (and the other), it seems that the returned color isn't right on my machine, the conversion should be:

int color = int.Parse(Result.ToString());

int r = color % 256;
color /= 256;
int g = color % 256;
color /= 256;
int b = color % 256;

return Color.FromArgb(r,g,b);

Instead of ColorTranslator.FromHtml(...).

It makes sense, setting the value use the same method.



Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
cmeLT
This is a moderated forum. Your message will remain hidden until it has been approved by a moderator or administrator
This forum powered by Phorum.