Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) scroll the screen using mouse (Read 8351 times)
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
scroll the screen using mouse
Jun 18th, 2012 at 9:21am
Print Post  
Dear team,

              i want to scroll the screen using mouse other than horizontal & vertical bar.
kindly help me.
  

if you want something then go and grab it
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: scroll the screen using mouse
Reply #1 - Jun 18th, 2012 at 10:13am
Print Post  
Setting DiagramView.Behavior = Pan will let you scroll by dragging any part of the view with the mouse. If you prefer to scroll from the MouseWheel handler, it should look like this:

Code
Select All
void diagramView_MouseWheel(object sender,
                             MouseEventArgs args)
{
            float newScrollY = diagramView.ScrollY - args.Delta / 50;
            if (newScrollY > diagram.Bounds.Top)
                        diagramView.ScrollY = newScrollY;
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: scroll the screen using mouse
Reply #2 - Jun 18th, 2012 at 12:58pm
Print Post  
thanks stoyan,

         but i want drag and move with horizontal & vertical
  

if you want something then go and grab it
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: scroll the screen using mouse
Reply #3 - Jun 18th, 2012 at 6:56pm
Print Post  
Quote:
but i want drag and move with horizontal & vertical


Sorry, I cannot understand that.
  
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: scroll the screen using mouse
Reply #4 - Jun 19th, 2012 at 4:17am
Print Post  
dear stoyan,

           when i use DiagramView.Behavior=pan; i can not  create / select the links.but my need is
1. if i click on the node i allow to create the links.
2. if i am just dragging on diagram view then i have to scroll horizontal & vertical
  

if you want something then go and grab it
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: scroll the screen using mouse
Reply #5 - Jun 19th, 2012 at 7:05am
Print Post  
Call diagram.GetNodeAt from DiagramView.MouseMove handler and toggle Behavior between DrawLinks / Pan depending on whether there's any node at the mouse position.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: scroll the screen using mouse
Reply #6 - Jun 20th, 2012 at 5:45am
Print Post  
Dear stoyan,
thanks a lot. but having trouble with tables & links. now i am trying with getitemat


the code is here

Point f = new Point(e.X, e.Y);

if(diagram.GetItemAt(f,false)!=null)
{
diagramView.Behavior = Behavior.DrawLinks;
}
else
{
diagramView.Behavior = Behavior.Pan;
}

some time i cannot get the link to be selected in tables Embarrassed
  

if you want something then go and grab it
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: scroll the screen using mouse
Reply #7 - Jun 20th, 2012 at 7:22am
Print Post  
If (e.X,e.Y) is the mouse position you get in MouseMove handler, you will have to convert it from pixels to diagram coordinates using the DiagramView.ClientToDoc method. Otherwise GetItemAt will not return the correct object.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: scroll the screen using mouse
Reply #8 - Jun 20th, 2012 at 7:34am
Print Post  
Thanks stoyan,
        it works  now Smiley
  

if you want something then go and grab it
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: scroll the screen using mouse
Reply #9 - Jul 4th, 2012 at 6:35am
Print Post  
Dear stoyan,

               now i cann't drag the node after the visible of diagram view. i have manually drag the diagram view and then move the nodes.
  

if you want something then go and grab it
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: scroll the screen using mouse
Reply #10 - Jul 4th, 2012 at 7:24am
Print Post  
Enable the AutoScroll property and the DiagramView should scroll automatically when you drag a node toward the view's edge.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: scroll the screen using mouse
Reply #11 - Jul 4th, 2012 at 7:54am
Print Post  
Dear stoyan,

        i have already enabled the autoscroll = true in diagram view. if i drag the  mouse with out the node then the diagramview is moving on the edge but if i drag with the node then it is not working
  

if you want something then go and grab it
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: scroll the screen using mouse
Reply #12 - Jul 5th, 2012 at 7:08am
Print Post  
dear stoyan,

          kindly help i am waiting for you advice.
  

if you want something then go and grab it
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: scroll the screen using mouse
Reply #13 - Jul 5th, 2012 at 5:49pm
Print Post  
I can see nothing like this in my test app. Try adding your initialization and event handling code to the attached test project to find out what causes it.

I hope that helps,
Stoyan
  

AutoScrollTest.zip (Attachment deleted)
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: scroll the screen using mouse
Reply #14 - Jul 6th, 2012 at 7:20am
Print Post  
Thanks Stoyan,

your code is working fine when it is in normal mode. when i maximize the form it is not working.
FYI :
i am using "FlowChart.NET component, version 5.3.3" and my insulation does n't have have the MindFusion.Scripting.dll .
  

if you want something then go and grab it
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint