Page 1 of 1

ViewXY: Panning when fully zoomed out

Posted: Wed Jul 23, 2014 1:18 pm
by greggorob64
I've been having issues trying to get my chart to disable panning when the chart is 'fully zoomed out' (i have internal values to what defines fully 'zoomed out'. The only way i could accomplish my task was using the 'before panning' event, and cancel is my chart ranges matched the fully 'zoomed out' range.

Since my latest update, it seems the 'beforepanning' method parameters have changed, and I can't cancel the pan!

What do i do from here?

Thanks

Code: Select all

//new
      void ViewXY_BeforePanning(List<RangeInfo> xRanges, List<RangeInfo> yRanges)
      {
           // no cancel!
      }

      //old
      void ViewXY_BeforePanning(List<RangeChangeInfo> xRanges, List<RangeChangeInfo> yRanges, ref bool cancel)
      {
         try
         {
            var range = xRanges.First();
            if (range.OldMax.EqualsWithThreshold(this.XAxisMaximumValue) && range.OldMin.EqualsWithThreshold(this.XAxisMinimumValue))
            {
               cancel = true;
            }
         }
         catch (Exception exception)
         {
            PCSException.LogException(Get.File(), Get.Line(), exception, MessageSeverity.Severe);
            MessageBox.Show(
               string.Format(BauerControls.NVH.NVHVisualizationControls.Properties.Resources.UnknownErrorWithLocation,
                  GetLocation(),
                  Environment.NewLine,
                  exception.Message),
               BauerControls.NVH.NVHVisualizationControls.Properties.Resources.UnknownErrorCaption,
               MessageBoxButtons.OK,
               MessageBoxIcon.Error);
         }
      }

Re: ViewXY: Panning when fully zoomed out

Posted: Thu Jul 24, 2014 5:16 am
by ArctionTero
Latest (6.0.9) should contain cancel in BeforePanning as it hasn't been removed since introduced.

Are you absolutely sure you have referenced correct dll?

Re: ViewXY: Panning when fully zoomed out

Posted: Mon Jul 28, 2014 3:55 pm
by greggorob64
I'm totally wrong. When I downloaded source I (stupidly) opened the source sent to me in june, not the one from a week ago.

Oops! You can kill this thread.