PDA

View Full Version : What is a "system.delegate" ?


martroyx
10-05-2008, 08:01 PM
Hi, I'm trying to manually fire the PaintEventsHandler or any other handler with the controls.invoke methods but I don't get it ... what is a "system.delegate" ? can somebody explain this to me ?

Thank for your help!

Martin Dufour

LoneRobot
10-05-2008, 08:04 PM
Hi Martin, could you provide a bit more information on what you are trying to do? usually calling invalidate() or refresh() will trigger the paint handler, forcing a control to redraw it's surface.

martroyx
10-05-2008, 08:33 PM
Hi Swami, I doing some node connection editor but I'm geting some flikering when redrawing the connection. I think that if I could manualy call the paint handler I could get rid of it (this work for the currently drawing connection but not the allready connected one since it rely on controls.Invalidate() ; controls.update()). any idea ?

thank !

martroyx
10-05-2008, 08:38 PM
here a screenshoot of what it look like ..file:///C:/Documents%20and%20Settings/Administrator/Desktop/Xbrain_01.jpg

LoneRobot
10-05-2008, 09:08 PM
hey martin,

nice looking interface and an interesting looking project. Control flicker can be caused by a few things. Sometimes overiding the onbackgroundpaint event (essentially to do nothing) can sort flickering issues, as the flicker is the control redrawing the background color before the paint event fires.

Other options are enabling doublebuffering if it is an inherited control, as this draws on a memory graphics object before drawing it. You can in theory perform your own doublebuffering but i haven't tried it.

martroyx
10-05-2008, 09:36 PM
Thank, I'm currently looking at the manual doublebuffering but this don't seam easy to setup.


XGraph = PboxMap.CreateGraphics()
XGraph.CompositingQuality = XGraph.CompositingQuality.HighSpeed
XGraph.InterpolationMode = XGraph.InterpolationMode.Low
XGraph.SmoothingMode = XGraph.SmoothingMode.HighSpeed
--//--
XGraphManager = (dotnetclass "System.Drawing.BufferedGraphicsManager").Current
XGraphManager.MaximumBuffer = (dotnetobject "System.Drawing.Size" (PboxMap.Width+1) (PboxMap.Height+1))
XBuffer = (XGraphManager.Allocate XGraph )--??
--//--


also , how to "overiding the onbackgroundpaint" from inside 3dsmax ?

Thank a lot !

Martin Dufour

PEN
10-05-2008, 09:43 PM
Have you seen this?

http://www.lumonix.net/helium.html

martroyx
10-05-2008, 09:47 PM
well, yes but I wanted to do my own so that I can learn at the same time :-)

my main question remain ... what's a "system.delegate" ?

Take for your time !

Martin Dufour

martroyx
10-05-2008, 11:40 PM
Everything working fine now, this has been fixed by doing all the drawing from inside the painthandler,

Finally I can sleep a bit :-P
Thank you very mush for your help!

Martin Dufour

LoneRobot
10-06-2008, 07:22 AM
hi martin, i thought you were doing this to get your custom controls, but i'm glad you resolved it. Keep us updated with your project!

martroyx
10-06-2008, 07:33 AM
Thank, I will :cool:

Good work with your multi-threading thing, very good stuff !

Take care,
Martin Dufour

LoneRobot
10-06-2008, 08:28 AM
cheers martin!

martroyx
10-06-2008, 03:53 PM
XBrain is the update to my dinorigcreator script, I have to go thought
almost ten thousand line, so this will take a while, I think! :rolleyes:
Damn, I'm afraid of opening this thing again!

I'll use this this thread to post update from time to time, here the first one...
http://www.youtube.com/watch?v=Te0JvrgayRA

Martin Dufour

CGTalk Moderation
10-06-2008, 03:53 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.