コード例 #1
0
ファイル: DataSet.cs プロジェクト: zhaoyingpu/xenadmin
        public DataPoint OnMouseMove(MouseActionArgs args)
        {
            if (Deselected)
            {
                return(null);
            }
            LongPoint p = LongPoint.DeTranslateFromScreen(new LongPoint(args.Point), args.XRange, args.YRange, new LongRectangle(args.Rectangle));

            return(ClosestPointTo(p));
        }
コード例 #2
0
 internal void OnEventsMouseClick(MouseActionArgs args)
 {
     foreach (DataEvent e in DataEvents)
     {
         LongPoint pt = LongPoint.TranslateToScreen(e.Point, args.XRange, args.YRange, new LongRectangle(args.Rectangle));
         if (pt.X - 8 <= args.Point.X && args.Point.X <= pt.X + 8)
         {
             SelectedItem = e;
             return;
         }
     }
     SelectedItem = null;
 }
コード例 #3
0
ファイル: DataSet.cs プロジェクト: zhaoyingpu/xenadmin
        public bool OnMouseClick(MouseActionArgs args)
        {
            DataRange        yrange = this.CustomYRange ?? args.YRange;
            List <DataPoint> range  = BinaryChop(Points, args.XRange);

            if (range.Count == 0)
            {
                return(false);
            }
            List <LongPoint> polypoints = new List <LongPoint>();

            foreach (DataPoint p in range)
            {
                LongPoint lp = LongPoint.TranslateToScreen(p.Point, args.XRange, yrange, new LongRectangle(args.Rectangle));
                polypoints.Add(new LongPoint(lp.X, lp.Y + 10));
                polypoints.Insert(0, new LongPoint(lp.X, lp.Y - 10));
            }
            Polygon poly = new Polygon(polypoints);

            return(poly.Contains(new LongPoint(args.Point)));
        }
コード例 #4
0
ファイル: DataEventList.cs プロジェクト: huizh/xenadmin
 internal void OnEventsMouseClick(MouseActionArgs args)
 {
     foreach(DataEvent e in DataEvents)
     {
         LongPoint pt = LongPoint.TranslateToScreen(e.Point, args.XRange, args.YRange, new LongRectangle(args.Rectangle));
         if(pt.X - 8 <= args.Point.X && args.Point.X <= pt.X + 8)
         {
             SelectedItem = e;
             return;
         }
     }
     SelectedItem = null;
 }