Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Unable to move node before resizing (Read 1814 times)
ayushneema
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 23rd, 2009
Unable to move node before resizing
Sep 29th, 2009 at 4:23pm
Print Post  
hi
i am creting a node using follwing code:
Code
Select All
ShapeNode mainNode = new ShapeNode(diagram);

int height = 30;

int width = 30;


var format = new StringFormat();
                format.Alignment = StringAlignment.Center;
                format.LineAlignment = StringAlignment.Far;
                format.FormatFlags = StringFormatFlags.NoWrap;
                format.Trimming = StringTrimming.EllipsisCharacter;

                mainNode.EnableStyledText = true;
                mainNode.PolygonalTextLayout = false;
                mainNode.TextFormat = format;
                mainNode.ClipToBounds = true;

                mainNode.AnchorPattern = null;
                mainNode.HandlesStyle = HandlesStyle.SquareHandles | HandlesStyle.EasyMove;
                mainNode.EnabledHandles = AdjustmentHandles.ResizeHandles | AdjustmentHandles.Move;
                diagram.Nodes.Add(mainNode);



mainNode.Shape = stickyNoteShape;
                height = note.ObjectHeight;
                width = note.ObjectWidth;

                if (width == 30)
                {
                    width += note.XPos;
                    height += note.YPos;
                }

                mainNode.Bounds = new Rect(new Point(note.XPos + xOffset, note.YPos + yOffset)
                        , new Size(width - note.XPos, height - note.YPos));
                mainNode.Brush = new SolidColorBrush(Color.FromArgb(95, 211, 211, 211));
                mainNode.Pen = new Pen(new SolidColorBrush(Color.FromRgb(189, 186, 105)), 1);
                Uri uri = new Uri(App.GetImagesPath() + Image
                mainNode.Image = new BitmapImage(uri);
                mainNode.ImageAlign = ImageAlign.TopLeft;
                mainNode.Text = note.NoteName;
                mainNode.TextBrush = Brushes.Black;
                mainNode.ZIndex = 0; 


but i am unable to move after selecting.
but when i resize it i am able to move it.
please provide the valuable suggestion
Thanks
Ayush Neema
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Unable to move node before resizing
Reply #1 - Sep 29th, 2009 at 7:28pm
Print Post  
Hi,

HandlesStyle is not a flags enum and SquareHandles | EasyMove is not an expected value, though it works accidentally with the code passing through various "else" blocks...

In the handles style you are getting as end result, there is a few millimeters area near the borders that allows creating links, but if the node is very small, the link creation area covers all of it. You could set the node to be larger initially and moving it will work. However, better set HandlesStyle to Custom and handle the Draw/HitTestHandles events, because this that combination might stop working in some future version.

Stoyan
  
Back to top
 
IP Logged
 
ayushneema
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 23rd, 2009
Re: Unable to move node before resizing
Reply #2 - Oct 1st, 2009 at 11:07am
Print Post  
it's working .. Cheesy
thanks stoyo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint