Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic WinForms diagram - Windows 8 Touch compatibility (Read 2889 times)
Denis
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Jan 23rd, 2014
WinForms diagram - Windows 8 Touch compatibility
Jan 23rd, 2014 at 4:08pm
Print Post  
Hi,

Are there any plans to add touch functions to the diagram controls? Maybe they are there and need to be enabled?

I remember trying the control on a Dell Venue 8 Pro which runs Windows 8.1 (Standard, NOT RT) and the panning and pinch to zoom functions did not work at all.

I'm guessing that the controls were designed to intercept only mouse events, so some things work like double clicks, but it does not react to touch very graciously.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: WinForms diagram - Windows 8 Touch compatibility
Reply #1 - Jan 23rd, 2014 at 5:03pm
Print Post  
Hi,

We have implemented pinch to zoom and pan gestures in the WinRT and Android versions of the diagram control. The Windows Forms library does not seem to provide any touch events though, we'll see if we can implement that by handling some low level Windows messages like WM_TOUCH.

Stoyan
  
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 125
Location: England
Joined: Oct 23rd, 2006
Re: WinForms diagram - Windows 8 Touch compatibility
Reply #2 - Apr 10th, 2014 at 10:16am
Print Post  
I have pinch to zoom working in my WinForms application. You need to map Ctrl + Mouse Wheel onto your diagramView's zoom factor. I have a trackBar control that also zooms the diagramView. The code should look something like...

diagramView.MouseWheel += diagramView_MouseWheel;

private void diagramView_MouseWheel(object sender, MouseEventArgs args)
{
if (ModifierKeys == Keys.Control)
{
// Zooming... (limits 25..200)
if (args.Delta > 0)
{
if (toolStripTrackBarZoom.Value <= 175)
toolStripTrackBarZoom.Value += 25;
}
else
{
if (toolStripTrackBarZoom.Value >= 50)
toolStripTrackBarZoom.Value -= 25;
}
}
}

private void toolStripTrackBarZoom_ValueChanged(object sender, EventArgs e)
{
diagramView.ZoomFactor = toolStripTrackBarZoom.Value;
}
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint