Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Controlling resize of a box (Read 4143 times)
johnjohnson
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Apr 27th, 2007
Controlling resize of a box
Apr 27th, 2007 at 6:02am
Print Post  
Hi,

I use this code to add a cropbox item to my FlowChart. The user can move and resize this box, so this works fine.

What I am missing is the abillity for the user to hold down the Shift key while resizing this cropbox and keep the proportions of the box while resizing. A feature users knows well from other applications.

How do I code this feature in FlowChart ?

public Box DrawCropBox(float calcAdXpos, float calcAdYpos, float calcAdWidth, float calcAdHeight)
{
Box annonceCropBox = null;

annonceCropBox = fc.CreateBox(calcAdXpos, calcAdYpos, calcAdWidth, calcAdHeight);
annonceCropBox.Style = BoxStyle.Rectangle;
annonceCropBox.FrameColor = Color.Red;

annonceCropBox.Tag = "CropBox";
annonceCropBox.FillColor = Color.FromArgb(0, Color.White);
annonceCropBox.ShadowColor = Color.FromArgb(0, Color.White);
return annonceCropBox;
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Controlling resize of a box
Reply #1 - Apr 27th, 2007 at 6:17am
Print Post  
Hi,

You can enable the box.Constraints.KeepRatio property to keep the proportions while resizing. FlowChart.NET does not enable KeepRatio  automatically when Shift is held down. You could set it to true or false for the crop box in a MouseDown event handler, depending on the Control.ModifierKeys property value.

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


I love YaBB 1G - SP1!

Posts: 3
Joined: Apr 27th, 2007
Re: Controlling resize of a box
Reply #2 - Apr 27th, 2007 at 7:20am
Print Post  
Hi,

I am using version FlowChart.NET 4.0.4, and I can't find the KeepRatio property.

Should it be present in this version ?

If not, how can I get the functionality in my version ?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Controlling resize of a box
Reply #3 - Apr 27th, 2007 at 7:29am
Print Post  
Hi,

KeepRatio was added in version 4.2.

I guess you could use custom drawing while the box is being modified to draw a rectangle with some fixed proportions inside the box.BoundingRect. When the modification completes, update the box coordinates so they match the initial ratio, and disable Box.CustomDraw.

Stoyan
  
Back to top
 
IP Logged
 
johnjohnson
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Apr 27th, 2007
Re: Controlling resize of a box
Reply #4 - Apr 27th, 2007 at 7:45am
Print Post  
Hi,

Ok, thanks.

It seems it time for an update  Smiley

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Controlling resize of a box
Reply #5 - Apr 27th, 2007 at 8:48am
Print Post  
8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint