Profile Picture

Mouse cursor problem

Posted By Jens Wallman 9 Years Ago
Author
Message
Jens Wallman
Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 8, Visits: 40
Hi, we're in the process of upgrading from the 2008 version to the 2014.1 version and we've run into some problems with the way mouse cursors are handled in the 2014.1 version. In the older version we simply created the Tools we needed and set the desired cursor for each tool. Then depending on user action we simply added or removed the currently active tool to get the desired mouse cursor to be shown. In our case we want the cursor to change when the user has pressed a custom button(e.g a zoom button). Once the cursor has been set we want the cursor to be shown regardless of what the mouse pointer is pointing to(Series,Wall,DataPoint etc). In the 2014.1 version the cursor needs to be set on each element in the graph by the following rather awkward action:

  protected void SetupCursor()
        {
            System.Windows.Forms.Cursor cursor = new System.Windows.Forms.Cursor("ZoomIn.cur");
           
            nChartControl1.InteractivityStyle.Cursor.Cursor = cursor;
            nChartControl1.Controller.Tools.Add(new NCursorTool());

            foreach(NChartWall w in m_Chart.Walls)
            {
                w.InteractivityStyle.Cursor.Cursor = cursor;
            }

            foreach (NAxis a in m_Chart.Axes)
            {
                a.InteractivityStyle.Cursor.Cursor = cursor;
            }

            foreach (NSeries s in m_Chart.Series)
            {
                s.InteractivityStyle.Cursor.Cursor = cursor;
            }
        }

Since the cursor change is most likely a response to the mouse moving, iterating through potentially a large amount of series might be a bit of a performance hog. Have we missed any obvious way of setting a "global" cursor? Or is there any other way of achieving the functionality we used to have in the 2008 version?






Similar Topics


Reading This Topic