Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Handles that are out of bounds (Read 6939 times)
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Handles that are out of bounds
May 27th, 2010 at 1:58am
Print Post  
Hello Stoyan,

I have a problem with my custom containers.

I overrided the GetBounds function so that the containers, when folded, look like square elements.

It works fine, but the handles do not follow.
It doesnt match the bounds of the container as you can see in this picture :



This has many issues : It looks weird and most of all we can move the container without really touching it but by touching its handles which are out of bounds !!!!

What can I do to fix this ?

Thank you,
Amaury
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Handles that are out of bounds
Reply #1 - May 27th, 2010 at 5:26am
Print Post  
Hi,

You can use the FoldedContainerSize property to set the folded size. If you don't have it in your version, try setting Bounds instead in response to the ContainerFolded event.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Handles that are out of bounds
Reply #2 - May 27th, 2010 at 2:25pm
Print Post  
Hello Stoyan.

The FoldedContainerSize works well but it set that for all kind of containers and that is not what I want. I just need that for one kind of container.

I also setted the bounds in the containerFolded event, this works well. But when I first load my saved diagram, even though I also setted the bounds the same way as when the folded event is called, my bug is still here, looks like someone go over my code.

Any idea on what can I do ?

PS : I put a breakpoint in the DrawHandles function of my custom containers to check the bounds, and they are correct as they should be, but the behavior is still incorrect Sad

Thanks
Amaury
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Handles that are out of bounds
Reply #3 - May 27th, 2010 at 2:52pm
Print Post  
Hi Amaury,

At what point are you setting Bounds when loading - is it in a LoadFrom/Xml override?

Stoyan
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Handles that are out of bounds
Reply #4 - May 27th, 2010 at 2:54pm
Print Post  
no,
we use some custom functionality of our own for that.
We store positions and size of our containers when saving.

When we reoppen our projet, we create all the element and then resize/move them when we reapply all the layout
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Handles that are out of bounds
Reply #5 - May 27th, 2010 at 3:32pm
Print Post  
Are you also folding the containers at that point?

We have added a per-container FoldedSize property here:
https://mindfusion.eu/_beta/fcnet536_foldedsize.zip

Stoyan
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Handles that are out of bounds
Reply #6 - May 27th, 2010 at 4:02pm
Print Post  
Yes, I am folding the container at  that point.

I also noticed that setting the minimun size solve the problem for the width.
I was hoping that setting the captionHeight will solve the problem for the Height but it just does a weird behavior with the manipulator ?

Do you have any good advice ? I would like to avoid modifying my dlls at this point.
Hoe did you implement the per-container foldedSize ?
(cause I already have one also).


Thanks again for the help Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Handles that are out of bounds
Reply #7 - May 27th, 2010 at 5:56pm
Print Post  
And are you setting their Bounds to the desired size after folding them?
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Handles that are out of bounds
Reply #8 - May 27th, 2010 at 5:59pm
Print Post  
Here is what I do :

Code
Select All
container.Folded = true;

container.Bounds = new RectangleF(container.Bounds.Location, container.FoldedSize);
 



container.FoldedSize return a const value
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Handles that are out of bounds
Reply #9 - May 27th, 2010 at 6:14pm
Print Post  
I cannot reproduce it if I just set Folded and Bounds and leave it at that. Are you sure some code later doesn't modify the container?
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Handles that are out of bounds
Reply #10 - May 27th, 2010 at 6:21pm
Print Post  
yes Im quite sure...

I rediffined the Bounds property
Code
Select All
	  public new RectangleF Bounds
	  {
		get
		{
		    return GetBounds();
		}
		set
		{
		    base.Bounds = value;
		}
	  }
 



Put a breakpoint in the set and after setting it from my code I show in my previsous message, nobody call the Bounds property Sad
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Handles that are out of bounds
Reply #11 - May 27th, 2010 at 6:44pm
Print Post  
Hey hey,

I am on something, it seems that this was the UpdateBounds call that did break everything.

I removed the call and it is correct.

Can you explain me what is wrong with that ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Handles that are out of bounds
Reply #12 - May 27th, 2010 at 6:52pm
Print Post  
Are you adding or moving child nodes after setting Bounds? That will set a new value internally and the handles drawing and hit-testing code uses it. Setting Bounds should be the last thing done for the container.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Handles that are out of bounds
Reply #13 - May 27th, 2010 at 6:52pm
Print Post  
UpdateBounds will do that too.
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Handles that are out of bounds
Reply #14 - May 27th, 2010 at 6:56pm
Print Post  
Settings the bounds was the last thing I did.
But I was calling UpdateBounds right after...

So i removed all the calls of UpdateBounds when my containers are folded and it works fine now.

so why does UpdateBounds breaks everyhting for my CustomContainer when they are folded ?
Maybe I do somethiing wrong ?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint