Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SHape inside a shape (Read 5529 times)
Chetna Tumme
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 10
Joined: Nov 28th, 2012
SHape inside a shape
Feb 21st, 2013 at 11:51am
Print Post  
Hi Stoyan,

In my application, I have small shape inside a big shape.

So when I resize a outer Big shape, the inner shape size also increments/ decrements relative to outer shape.

I want it as follows:

1. I should be able to set minimum and maximum limiting size for inner shape.

2. Even if outer shape is resized upto any extent, inner shape should grow in size upto maximum limit.

Note: only outer shape has anchor points, not the inner shape

So how can I achieve such behaivor through mind fusion.

Thanks in advance,
Chetna
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SHape inside a shape
Reply #1 - Feb 21st, 2013 at 5:28pm
Print Post  
Hi Chetna,

Are you resizing the inner node in response to the outer node's NodeModifying event? The node.Constraints object contains properties such as MinWidth,MinHeight,MaxWidth,MaxHeight. They are applied only when a user modifies the node interactively, but you can still use them to store your min/max limits and check them when resizing from the event handler. E.g. assuming newRect contains the size you have calculated from the parent node:

Code
Select All
newRect = ... ; // calculated from outer node
var c = innerNode.Constraints;
newRect.Width = Math.Max(c.MinWidth, Math.Min(c.MaxWidth, newRect.Width));
newRect.Height = Math.Max(c.MinHeight, Math.Min(c.MaxHeight, newRect.Height)); 



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


I Love MindFusion!

Posts: 10
Joined: Nov 28th, 2012
Re: SHape inside a shape
Reply #2 - Feb 22nd, 2013 at 5:23am
Print Post  
Hello Stoyan,

Please refer the image attached.
Here the inner message shape should not grow beyond certain limit, even if I resize the outer rectangle of shape to any extent.

Note that anchor points are applied only to outer shape.

The code to create the node is also there in image.

Kind regards,
Chetna
  

BPMNShape.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SHape inside a shape
Reply #3 - Feb 22nd, 2013 at 7:49am
Print Post  
Hi,

You cannot do this using a single Shape definition. You could use a second node attached to the main node to display the mail icon, and update its size with whatever constraints you need applied. Alternatively, change the ShapeNode template to show an additional Path object where the constraints are implemented via Silverlight's layout propeties such as Stretch, MinWidth, MinHeight.

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


I Love MindFusion!

Posts: 1
Joined: Mar 20th, 2013
Re: SHape inside a shape
Reply #4 - Mar 20th, 2013 at 7:34pm
Print Post  
Hi Stoyan,

how we can attache one shape to another shape?

will you please guide me on this?

Thanks,
Jayraj



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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SHape inside a shape
Reply #5 - Mar 20th, 2013 at 8:15pm
Print Post  
Hi,

You can attach a node to another one using the AttachTo method:

mailNode.AttachTo(masterNode);

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint