Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Evaluating Diagramming product - some questions (Read 6025 times)
Lothar Behrens
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Feb 13th, 2014
Evaluating Diagramming product - some questions
Feb 13th, 2014 at 8:08am
Print Post  
Hi,

I am a DevExpress user and like to focus my questions around integrating the two libraries.

1.) I have seen a IScrollBarProvider interface that let me use my DevExpress scrollbars for skinning reasons. Does anyone have yet developed an implementation based on that interface, I could benefit from (not to reinvent)?

2.) Is there anyhow a databinding possible to show simultanuously, say, the node names in a grid?
(Nevron has at least data import capabilities, but I have seen a posting here with a very simple starting point for Entity Framework)

3.) Are there any DevExpress users out there to share some whitepapers of their products using Mindfusion Diagramming (product descriptions on your web pages are good enough)?

I am tending to use Mindfusion for one reason: IScrollBarProvider for skinning purposes.

Please impress me with more possibilities Smiley

Thanks,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Evaluating Diagramming product - some questions
Reply #1 - Feb 13th, 2014 at 9:31am
Print Post  
Hi,

Here is a DevExpress implementation:

Code
Select All
using DevExpress.XtraEditors;
using MindFusion.Diagramming.WinForms;

namespace ScrollBarProviderWrapper
{
 public class DevExpressScrollBarProvider : IScrollBarProvider
 {
  #region IScrollBarProvider Members

  public void AddScrollEventHandler(System.Windows.Forms.Control scrollBar, System.Windows.Forms.ScrollEventHandler handler)
  {
   ScrollBar(scrollBar).Scroll += handler;
  }

  public System.Windows.Forms.Control CreateHorizontalScrollBar()
  {
   return new HScrollBar();
  }

  public System.Windows.Forms.Control CreateVerticalScrollBar()
  {
   return new VScrollBar();
  }

  public float GetLargeChange(System.Windows.Forms.Control scrollBar)
  {
   return (float)ScrollBar(scrollBar).LargeChange;
  }

  public float GetMaximum(System.Windows.Forms.Control scrollBar)
  {
   return (float)ScrollBar(scrollBar).Maximum;
  }

  public float GetMinimum(System.Windows.Forms.Control scrollBar)
  {
   return (float)ScrollBar(scrollBar).Minimum;
  }

  public float GetValue(System.Windows.Forms.Control scrollBar)
  {
   return (float)ScrollBar(scrollBar).Value;
  }

  public void SetLargeChange(System.Windows.Forms.Control scrollBar, float value)
  {
   ScrollBar(scrollBar).LargeChange = (int)value;
  }

  public void SetMaximum(System.Windows.Forms.Control scrollBar, float value)
  {
   ScrollBar(scrollBar).Maximum = (int)value;
  }

  public void SetMinimum(System.Windows.Forms.Control scrollBar, float value)
  {
   ScrollBar(scrollBar).Minimum = (int)value;
  }

  public void SetValue(System.Windows.Forms.Control scrollBar, float value)
  {
   ScrollBar(scrollBar).Value = (int)value;
  }

  #endregion

.......

 public partial class Form1 : Form
 {
  public Form1()
  {
   InitializeComponent();

   diagramView1.ScrollBarProvider = new DevExpressScrollBarProvider();
  }
 } 



I'm pretty sure we added this interface for a customer that used DevExpress too, but that was a long time ago and I can't point you to their website.

There is no built-in databinding support. You could probably create a small adapter that implements INotifyCollectionChanged and raises the interface events in response to diagram's ItemAdded, ItemRemoved, TextEdited events to make the grid update dynamically. Or perhaps just set diagram.Nodes as grid's data source and use some grid update method to refresh the data from same events.

I hope that helps,
Stoyan

  
Back to top
 
IP Logged
 
Lothar Behrens
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Feb 13th, 2014
Re: Evaluating Diagramming product - some questions
Reply #2 - Feb 13th, 2014 at 1:01pm
Print Post  
While waiting, I have made a decision by stomage and I am happy. I am a owner now Smiley

I'll take your provider implementation as it seems to be clear what will happen where.

Thank you very much Smiley

Lothar
  
Back to top
 
IP Logged
 
Lothar Behrens
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Feb 13th, 2014
Re: Evaluating Diagramming product - some questions
Reply #3 - Feb 13th, 2014 at 2:08pm
Print Post  
Just a small correction. The code should actually look like this:

Code
Select All
using DevExpress.XtraEditors;
using MindFusion.Diagramming.WinForms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace Wrappers
{
    class ScrollBarProvider : IScrollBarProvider
    {
        public void AddScrollEventHandler(Control scrollBar, ScrollEventHandler handler)
        {
            ((ScrollBarBase)scrollBar).Scroll += handler;
        }

        public Control CreateHorizontalScrollBar()
        {
            return new DevExpress.XtraEditors.HScrollBar();
        }

        public Control CreateVerticalScrollBar()
        {
            return new DevExpress.XtraEditors.VScrollBar();
        }

        public float GetLargeChange(Control scrollBar)
        {
            return (float)((ScrollBarBase)scrollBar).LargeChange;
        }

        public float GetMaximum(Control scrollBar)
        {
            return (float)((ScrollBarBase)scrollBar).Maximum;
        }

        public float GetMinimum(Control scrollBar)
        {
            return (float)((ScrollBarBase)scrollBar).Minimum;
        }

        public float GetValue(Control scrollBar)
        {
            return (float)((ScrollBarBase)scrollBar).Value;
        }

        public void SetLargeChange(Control scrollBar, float value)
        {
            ((ScrollBarBase)scrollBar).LargeChange = (int)value;
        }

        public void SetMaximum(Control scrollBar, float value)
        {
            ((ScrollBarBase)scrollBar).Maximum = (int)value;
        }

        public void SetMinimum(Control scrollBar, float value)
        {
            ((ScrollBarBase)scrollBar).Minimum = (int)value;
        }

        public void SetValue(Control scrollBar, float value)
        {
            ((ScrollBarBase)scrollBar).Value = (int)value;
        }
    }
}
 



Actually this code works.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Evaluating Diagramming product - some questions
Reply #4 - Feb 13th, 2014 at 2:18pm
Print Post  
Ours worked too, but I forgot to copy this method, sorry:

Code
Select All
 private ScrollBarBase ScrollBar(System.Windows.Forms.Control scrollBar)
  {
   return (ScrollBarBase)scrollBar;
  } 

  
Back to top
 
IP Logged
 
LanDocs
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Aug 7th, 2014
Re: Evaluating Diagramming product - some questions
Reply #5 - Aug 7th, 2014 at 1:11pm
Print Post  
Hi!
I use your code for DevExpress implementation:

Stoyo wrote on Feb 13th, 2014 at 9:31am:
Hi,

Here is a DevExpress implementation:

Code
Select All
using DevExpress.XtraEditors;
using MindFusion.Diagramming.WinForms;

namespace ScrollBarProviderWrapper
{
 public class DevExpressScrollBarProvider : IScrollBarProvider
 {
  #region IScrollBarProvider Members

  public void AddScrollEventHandler(System.Windows.Forms.Control scrollBar, System.Windows.Forms.ScrollEventHandler handler)
  {
   ScrollBar(scrollBar).Scroll += handler;
  }

  public System.Windows.Forms.Control CreateHorizontalScrollBar()
  {
   return new HScrollBar();
  }

  public System.Windows.Forms.Control CreateVerticalScrollBar()
  {
   return new VScrollBar();
  }

  public float GetLargeChange(System.Windows.Forms.Control scrollBar)
  {
   return (float)ScrollBar(scrollBar).LargeChange;
  }

  public float GetMaximum(System.Windows.Forms.Control scrollBar)
  {
   return (float)ScrollBar(scrollBar).Maximum;
  }

  public float GetMinimum(System.Windows.Forms.Control scrollBar)
  {
   return (float)ScrollBar(scrollBar).Minimum;
  }

  public float GetValue(System.Windows.Forms.Control scrollBar)
  {
   return (float)ScrollBar(scrollBar).Value;
  }

  public void SetLargeChange(System.Windows.Forms.Control scrollBar, float value)
  {
   ScrollBar(scrollBar).LargeChange = (int)value;
  }

  public void SetMaximum(System.Windows.Forms.Control scrollBar, float value)
  {
   ScrollBar(scrollBar).Maximum = (int)value;
  }

  public void SetMinimum(System.Windows.Forms.Control scrollBar, float value)
  {
   ScrollBar(scrollBar).Minimum = (int)value;
  }

  public void SetValue(System.Windows.Forms.Control scrollBar, float value)
  {
   ScrollBar(scrollBar).Value = (int)value;
  }

  #endregion

.......

 public partial class Form1 : Form
 {
  public Form1()
  {
   InitializeComponent();

   diagramView1.ScrollBarProvider = new DevExpressScrollBarProvider();
  }
 } 



I'm pretty sure we added this interface for a customer that used DevExpress too, but that was a long time ago and I can't point you to their website.

There is no built-in databinding support. You could probably create a small adapter that implements INotifyCollectionChanged and raises the interface events in response to diagram's ItemAdded, ItemRemoved, TextEdited events to make the grid update dynamically. Or perhaps just set diagram.Nodes as grid's data source and use some grid update method to refresh the data from same events.

I hope that helps,
Stoyan



and got strange scrollbars behavior - DevExpress scrollbars doesn't work same as MindFusion scrollbars. See my example in attachment, please. In example left DiagramView use DevExpress scrollbars and right DiagramView use MindFusion scrollbars, ZoomTrackBar change zoom value for both DiagramViews. How make DevExpress scrollbars to work same as MindFusion scrollbars?
  

ScrollTestApp.zip (Attachment deleted)
Back to top
 
IP Logged
 
LanDocs
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Aug 7th, 2014
Re: Evaluating Diagramming product - some questions
Reply #6 - Aug 7th, 2014 at 1:24pm
Print Post  
Hello,

We have the same problem with scrollbars on FCNet 6.1.3 and DevExpress 14.1. Is where a way to make them working as native MindFusion's scrollbars?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Evaluating Diagramming product - some questions
Reply #7 - Aug 7th, 2014 at 2:20pm
Print Post  
Hi,

If you mean the scrollbars not hiding when zooming out, it seems to happen because the DX scrollbars' GetLargeChange method starts returning incorrect values when we hide them first time, and they get shown again. Instead of delegating from GetLargeChange to them, return a value stored from last set:

Code
Select All
private float largeChange;

        public float GetLargeChange(System.Windows.Forms.Control scrollBar)
        {
   return largeChange;
        }

        public void SetLargeChange(System.Windows.Forms.Control scrollBar, float value)
        {
            ScrollBar(scrollBar).LargeChange = (int)value;
   largeChange = (int)value;
        } 



Then it works correctly for us using DX13.

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


I Love MindFusion!

Posts: 5
Joined: Aug 7th, 2014
Re: Evaluating Diagramming product - some questions
Reply #8 - Aug 8th, 2014 at 8:10am
Print Post  
Thank you very much! It works for us too.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint