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.
IHTMLPaintSite's InvalidateRect Not Working?
Posted by:
ramida (---.ipt.aol.com)
Date: Monday, 04-Jul-2005, 13:50:54
Hi there,
I've been trying to add a ruler to the top and left side of the Html Editor via binary behavior rendering. I want these rulers to be fixed (not move) while the user scrolls a document. In the Draw method of the IHTMLPainter interface, I call the GetDrawInfo method of the IHTMLPaintSite interface to determine the rcViewport.top and left values. The proper location of the rulers are calculated correctly, but are not updated when I make a call to the InvalidateRect method inside an event handler that handles scrolling of the Document.body element. Using the editor's Refresh method redraws the rulers in their correct locations, but there is so much flickering!
Has someone used the InvalidateRect method in their project(s)?
Or is there an alternative way of rendering a ruler to the top and left sides of the Editor?
Thanks, ramida
Re: IHTMLPaintSite's InvalidateRect Not Working?
Posted by:
ramida (---.ipt.aol.com)
Date: Monday, 04-Jul-2005, 20:02:12
Please disregard this post. I just found out there is a bug with IHTMLPaintSite's InvalidateRect (after doing a Google search).
But I found a solution to fixing a rendered behavior so it won't move when the document is scrolled. The key is setting
_HTML_PAINT_ZORDER.HTMLPAINT_ZORDER_WINDOW_TOP
in the GetPainterInfo() method of the IHTMLPainter interface.
Later, ramida
Re: IHTMLPaintSite's InvalidateRect Not Working?
Posted by:
ramida (152.1.87.---)
Date: Tuesday, 05-Jul-2005, 15:42:12
Hi Tim,
It turned out my "solution" only works when the document is scrolled vertically! :-( For horizantal scrolls, the rendered behavior moves and needs to be updated (redrawn). The only way this is redrawn without much flickering it by calling the InvalidateRect method ,which, unfortunately, is broken (Google search: keyword "IHTMLPaintSite InvalidateRect").
Joerg of NetRix was able to fix its rulers to the top and left sides of the document so there must be a solution out there.
I'm still trying and will keep this group posted of any positive progress.
Later, ramida
Re: IHTMLPaintSite's InvalidateRect Not Working?
Posted by:
joergkrause (---.dynamic.qsc.de)
Date: Tuesday, 05-Jul-2005, 20:54:53
I'm not sure that this is the one and only part of the solution, but the mshtml PIA has a lot of errors, and there are no ways to solve this without replacing the PIA completely. Using the following interface definition may solve your problem:
[ComImport()]
[Guid("3050f6a7-98b5-11cf-bb82-00aa00bdce0b")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IHTMLPaintSite
{
void InvalidatePainterInfo();
void InvalidateRect(System.IntPtr prcInvalid);
void InvalidateRegion( System.IntPtr rgnInvalid);
void GetDrawInfo( System.Int32 lFlags, out HTML_PAINT_DRAW_INFO pDrawInfo);
void TransformGlobalToLocal( POINT ptGlobal, out POINT pptLocal);
void TransformLocalToGlobal( POINT ptLocal, out POINT pptGlobal);
void GetHitTestCookie(out System.Int32 plCookie);
}
Call InvalidateRect(IntPtr.Zero) to invalidate the whole document surface. Assure you've put a try/catch around the call, because sometimes it fails for some reason.
Joerg
www.netrixcomponent.net - HTML WYSIWYG Editor component for .NET
Re: IHTMLPaintSite's InvalidateRect Not Working?
Posted by:
ramida (152.1.87.---)
Date: Wednesday, 06-Jul-2005, 15:57:56
Hi Joerg,
Thanks for your response. I tried your IHTMLPaintSite interface definition but can't get InvalidateRect to work correctly. Maybe adding a ruler via binary behavior rendering is not a good idea afterall.
I revisited your NetRix demo application and noticed that your ruler is actually a user control, with the HtmlEditor superimposed above it! I tried the same idea with my ruler drawing within a Windows Class Control Library project and it seem to work nicely (albeit with an additional DLL for the Editor). I'm trying to incorporate the ruler drawing in the HtmlEditor itself, but I'm not sure if it's a good idea.
Thanks again.
ramida
Re: IHTMLPaintSite's InvalidateRect Not Working?
Posted by:
ramida (152.1.87.---)
Date: Wednesday, 06-Jul-2005, 20:58:25
Hi Joerg,
Just a follow-up on the ruler user control. I noticed a problem -- the vertical ruler doesn't scroll when the document is scrolled vertically; likewise, the horizontal ruler doesn't scroll when the document is scrolled horizontally. The ruler's synchronized scrolling with the document is important because it gives the user a real sense of the document's dimensions.
I'm now looking at pursuing my idea of adding a ruler via binary behavior rendering because a ruler attached to the body element scrolls with it.
The problem now is how to make InvalidateRect work. :-(
Later, ramida :-)
出会い放題-出会える出会い系サイト
Posted by: 出会い (---.88.44.61.ap.gmo-access.jp)
Date: Wednesday, 28-Jan-2009, 09:14:11
<ul><font size="2">
<li><a href="http://www.biotechcgi.com/" title="出会い放題">出会い</a></li>
<li><a href="http://www.aec-dk.com/sefure/" title="ご近所のセフレ探し">セフレ</a></li>
<li><a href="http://www.mb-friends.net/" title="セフレ伝説">セフレ</a></li>
<li><a href="http://www.aec-dk.com/merutomo/" title="ご近所のメル友探し">メル友</a></li>
<li><a href="http://www.hi-tech-reno.com/merutomo/" title="オトナのメル友探し">メル友</a></li>
<li><a href="http://www.aec-dk.com/" title="ご近所の人妻探し">人妻</a></li>
<li><a href="http://seo-mobi.net/ninjajan315/" title="人妻出会い">人妻出会い</a></li>
<li><a href="http://www.hi-tech-reno.com/" title="素敵な恋人探し">恋人探し</a></li>
<li><a href="http://seo-mobi.net/jk/" title="女子高生-女子高生専門サイト">女子高生</a></li>
<li><a href="http://www.utgltd.com/" title="100%出会い系サイト">出会い系サイト</a></li>
<li><a href="http://www.aec-dk.com/deai/" title="裏出会いサイト-大人の出会い系サイト">裏出会いサイト</a></li>
<li><a href="http://www.hi-tech-reno.com/deai/" title="無料出会いサイト">無料出会いサイト</a></li>
</font></ul>