Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic About HandlesStyle.EasyMove (Read 1823 times)
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
About HandlesStyle.EasyMove
May 2nd, 2019 at 7:07am
Print Post  

Hello.
I rmeoved my cusotgm handles, the mindfusion handles really work better.
Anyway have a trouble with handles, cant move nodes when click very close to the border, if nodes are little, is a bug problem.

EasyMove handle work perfect, is exactly what I need, with exception of central circle of that handle.
There is a way to remove that central circle?

If not, please can create a EasyMove handle with that central circle removed? and same behavior of easy move handle?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: About HandlesStyle.EasyMove
Reply #1 - May 2nd, 2019 at 10:48am
Print Post  
Hi Pablo,

With all handle styles there is some space left for drawing links, which is shown by the round center handle when using EasyMove style. If you don't care about drawing links, use Custom style with these event handlers to get EasyMove behavior without the center handle and link area -

Code
Select All
void OnDrawAdjustmentHandles(object sender, DrawItemEventArgs e)
{
    var node = (DiagramNode)e.Item;
    var bounds = node.Bounds;
    bounds.X = bounds.Y = 0;

    InternalUtils.DrawAdjustmentHandles(
        e.Graphics,
        diagram.ActiveItemHandlesStyle,
        diagram.DisabledHandlesStyle,
        bounds, node.RotationAngle,
        node.EnabledHandles, true,
        HandlesStyle.SquareHandles2,
        diagram.AdjustmentHandlesSize,
        node);
}

void OnHitTestAdjustmentHandles(object sender, HitTestEventArgs e)
{
    var node = (DiagramNode)e.Item;
    node.HandlesStyle = HandlesStyle.EasyMove;
    e.HitResult = node.HitTestHandle(e.MousePosition);
    if (e.HitResult == null)
        e.HitResult = NodeAdjustmentHandle.Move;
    node.HandlesStyle = HandlesStyle.Custom;
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: About HandlesStyle.EasyMove
Reply #2 - May 3rd, 2019 at 7:03am
Print Post  

Thanks for your guide, anyway the code have some errors I cant solve.
Based on some info I found on the forum, I make work in this way.
I test and there is no problem, work ok.
You think is ok?

Here the code in case is useful for any other user.

private void form_DrawAdjustmentHandles(object sender, DrawItemEventArgs e)
{
var node = (DiagramNode)e.Item;
var bounds = node.Bounds;
bounds.X = bounds.Y = 0;

InternalUtils.DrawAdjustmentHandles(
e.Graphics,
form.ActiveItemHandlesStyle,
form.DisabledHandlesStyle,
bounds, node.RotationAngle,
node.EnabledHandles, true,
HandlesStyle.SquareHandles2,
form.AdjustmentHandlesSize,
node);

}

private void form_HitTestAdjustmentHandles(object sender, HitTestEventArgs e)
{

var node = (DiagramNode)e.Item;
node.HandlesStyle = HandlesStyle.EasyMove;

int handle = -1;
node.HitTestHandle(e.MousePosition, ref handle);
if (handle == -1 && node.ContainsPoint(e.MousePosition))
handle = 8;
e.HitResult = handle;
node.HandlesStyle = HandlesStyle.Custom;

}



  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: About HandlesStyle.EasyMove
Reply #3 - May 3rd, 2019 at 8:18am
Print Post  
Hi Pablo,

Your project's still referencing older version of the assemblies then. HitResult is not an integer value since v3.4.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint