Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drawing out of the shape's bounds (Read 1385 times)
jpinera
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 4th, 2011
Drawing out of the shape's bounds
Jul 4th, 2011 at 5:07pm
Print Post  
I'm developing a grafcet editor, and I need to draw out of the node's bounds. The node is drawn as a ronded rect shape (one of the predefined shapes). Each node has associated four strings that must be written in the corners of the shape:


Text1 +--------------------------------+ Text2
| |
| |
Text3 +--------------------------------+ Text4

I created a derived class from NodeShape, and I overwrite the Draw method to call the base implementation and then, call a function that writes the strings and call the Repaint method with a rect that includes all modified area.

It seems that is working fine (nodes draw all strings) but, after that, the rest of the application don't repaints correctly (some buttons are not shown, grids don0t refresh its dat, etc). If I don't call the repaint method, the rest of the application repaints correctly, but the nodes are not shown complete (part of the text is not shown).

I have tried to use the CustomDraw (Additional2) but the result is the same, the rest of the aplication is not correctly refresh.

How can I draw out of the bounds of the node?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drawing out of the shape's bounds
Reply #1 - Jul 4th, 2011 at 5:22pm
Print Post  
Override GetRepaintRect to include the labels' area in the rectangle and the nodes should draw fully without you having to force a repaint.

As for graphic elements disappearing from other controls on the form, I suppose this could happen when GDI+ runs out of resources. Check if you are calling Dispose on any GDI+ objects created in your Draw override.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jpinera
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 4th, 2011
Re: Drawing out of the shape's bounds
Reply #2 - Jul 6th, 2011 at 6:15am
Print Post  
Thank you very much. I overrided the GetRepaintRect and now It 's working fine.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint