Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Diagram Item Focus Issue (Read 10111 times)
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Diagram Item Focus Issue
Feb 20th, 2008 at 11:44am
Print Post  
Hi there

When using a custom control with an irregular shape (in this example, just rounded corners) it seems to be possible to adversly effect the focus behaviour of nodes.

Using a control with a rounded corner on a diagram control with a dark background (black), it is possible to see the corner of the diagram item frame that the UI Element exists inside.  As expected, mousing over the edge of this frame gives the node resize arrows.  Clicking on the diagram background away from the node gives focus to the diagram and the frame on the node disapears.  Clicking on the node again returns focus and the frame reapears allowing node resize.

If you move the pointer to the edge of the rounded corner of the UI  Element (the mouse is now within the squared corner of the diagram item) and click, the frame dims slightly and now we have our problem.  Moving over the frame no longer gives resize arrows and it is not possible to move the diagram item on the diagram.  It is as if the focus has now shifted to the UI Element rather than the diagram item and it does not seem possible to set the focus back.  This also disables the deletion of the diagram item.

I have a couple of small screen shots showing this that I can email if required, but currently I'm unable to host them to include in this post.


Many thanks


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Item Focus Issue
Reply #1 - Feb 20th, 2008 at 1:36pm
Print Post  
Hi,

This worked fine for us -

d.ModificationStart = ModificationStart.AutoHandles;
Rectangle r = new Rectangle();
r.Fill = Brushes.Red;
r.RadiusX = r.RadiusY = 30;
r.Width = 100;
r.Height = 80;
d.Items.Add(r);

Could you try it in your application? If it doesn't work there, I will send you our latest version of the dll - we have fixed some hit-testing related bugs since we started the beta tests.

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Diagram Item Focus Issue
Reply #2 - Feb 20th, 2008 at 2:00pm
Print Post  
Hi Stoyan

Thanks for your code suggestion, but i am still able to get the recangle node into the same 'stuck' state as before if i repeat these steps:

1) Mouse over rectangle to make the handle boarder appear
2) Move mouse back to edge of node (ensuring that you don't click on the node straight away) and re-size

Node will now be 'stuck', preventing further re-size, moving and deletion.



Always  happy to test drive new versions when available Smiley


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Item Focus Issue
Reply #3 - Feb 20th, 2008 at 2:21pm
Print Post  
Hi Paul,

Ok, please try that with the latest version:
https://mindfusion.org/_beta/hittest.zip

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Diagram Item Focus Issue
Reply #4 - Feb 25th, 2008 at 11:33am
Print Post  
Hi Stoyan

Thanks for the DLL - we're still having some issues with mouse co-ordinates against the location values of nodes but I'll cover thart in a different post when I can give you better information.

One minor hiccup we experienced with the new DLL was that it generates design-time license errors - is this a possible conflict with having the MSI from 18th february installed?
There also seems to be new behaviour when used in conjunction with scroll viewers - it seems to always centre itself, where as before if placed in the top left of a scroll viewer it would stay there. Is this by design or a temporary side effect on beta?

Many thanks


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Item Focus Issue
Reply #5 - Feb 25th, 2008 at 12:59pm
Print Post  
Hi Paul,

Check if removing the Width and Height attributes from the Diagram element fixes the ScrollViewer problem. Regarding design-time license, what error exactly are you getting - is it reported by the license compiler - LC.exe, or by visual Studio when you drop a Diagram on the form?

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Diagram Item Focus Issue
Reply #6 - Feb 27th, 2008 at 8:28am
Print Post  
Thanks for the suggestion, but I currently do not have any height tags in the XAML defining the diagram object.
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Item Focus Issue
Reply #7 - Feb 27th, 2008 at 8:50am
Print Post  
Is there a Margins attribute?
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Diagram Item Focus Issue
Reply #8 - Feb 27th, 2008 at 9:12am
Print Post  
No, no margins either.

|With regard to the license issue, which I forgot to cover, this is and IDE error - within Expression Blend (December 2007 Preview) I get the text of "Couldn't get design-tme license for  MIndfusion.Diagramming.WPF.Diagram".  Within VS 2008 RTM the XAML designer failes to render  / instantiate the diagram.
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Item Focus Issue
Reply #9 - Feb 27th, 2008 at 10:30am
Print Post  
Is there a "WpfDiagram" string value under the HKEY_LOCAL_MACHINE\SOFTWARE\MindFusion\ComponentLicenses registry key on your system?

Could you post here the <ScrollViewer> and <Diagram> lines from your XAML code?

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Diagram Item Focus Issue
Reply #10 - Feb 27th, 2008 at 12:59pm
Print Post  
I have:

Mindfusion Limited\ComponentLicenses\Mindfusion.Diagramming.Winforms.FlowChart


By the sounds of it I'm missing somthing?


My scrollviewer / diagram XAMLl is as follows:

<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" x:Name="oCardFlowScroll" Grid.RowSpan="1" Grid.Column="0" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" RenderTransformOrigin="0.5,0.5">
<ScrollViewer.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</ScrollViewer.RenderTransform>
<MindFusion_Diagramming_Wpf:Diagram x:Name="oCardFlow" ShowGrid="False" AdjustmentHandlesSize="6" ZoomFactor="25" AllowUnanchoredLinks="False" Width="Auto" RenderTransformOrigin="0.5,0.5">
<MindFusion_Diagramming_Wpf:Diagram.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</MindFusion_Diagramming_Wpf:Diagram.RenderTransform>
<MindFusion_Diagramming_Wpf:Diagram.BackBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF000000" Offset="0"/>
<GradientStop Color="#FF000000" Offset="1"/>
<GradientStop Color="#FFFFFFFF" Offset="0.767"/>
</LinearGradientBrush>
</MindFusion_Diagramming_Wpf:Diagram.BackBrush>
<MindFusion_Diagramming_Wpf:Diagram.LinkPen>
<Pen Brush="#FFFF7600" Thickness="5"/>
</MindFusion_Diagramming_Wpf:Diagram.LinkPen>
</MindFusion_Diagramming_Wpf:Diagram>
</ScrollViewer>
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Item Focus Issue
Reply #11 - Feb 27th, 2008 at 1:21pm
Print Post  
Hi,

Import this into the Windows registry:
https://mindfusion.org/_beta/wpflic.zip

Why do you need all these RenderTransforms in the XAML?

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Diagram Item Focus Issue
Reply #12 - Feb 27th, 2008 at 1:41pm
Print Post  
Thanks for the reg entry - that worked great and i now have design-time rendering of the diagram control again.

With reference to the render transforms, I'd not really notice them until I posted the code.  They seem to be an artifact of Expression Blend - it puts them in when you re-seize stuff.  I have since removed them and re-tested, but with the same end result.
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Item Focus Issue
Reply #13 - Feb 27th, 2008 at 2:00pm
Print Post  
Regarding centering - it looks like a bug in the ScrollViewer control. If you replace the Diagram with a button, you will see that it is centered too, ignoring the alignment attributes:

<ScrollViewer Name="ScrollViewer1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" HorizontalContentAlignment="Left" VerticalContentAlignment="Top">
     <Button Width="100" Height="100" />
</ScrollViewer>

I think the ScrollViewer from the WPF CTP builds worked better. Now we have other problems with the ScrollViewer too - for example dropping the diagram inside a ScrollViewer adds fixed Width and Height attribute values, and they make the ScrollViewer ignore the size returned by the Diagram's MeasureOverride method - which is based on the Bounds and MeasureUnit properties. The result is that scrolling is disabled until you remove the Width and Height attributes.

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Diagram Item Focus Issue
Reply #14 - Feb 28th, 2008 at 12:09pm
Print Post  
I think i found a cause / work around regarding this - with previous WPFDiagram Dlls I had the diagram set to 'stretch' within the scroll viewer and all seemed to be OK.  I just tried setting the alignment on the diagram to top/left (rather then than content alignment properties on the scroll viewer) and it no longer centers.

Don't know if this is of any use to you guys.



Paul
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint