Ejemplo n.º 1
0
        private void OnPieceRemoved(object source, Cdn.PieceRemovedArgs args)
        {
            d_treeview.NodeStore.Remove(args.Piece);
            d_lastAddedData = null;

            UpdatePreview();
        }
Ejemplo n.º 2
0
        private void OnGraphButtonPress(object source, ButtonPressEventArgs args)
        {
            if (args.Event.Button == 1 &&
                args.Event.Type == Gdk.EventType.ButtonPress &&
                d_iscubic &&
                d_dataLine != null)
            {
                Point ptx = new Point(args.Event.X, args.Event.Y);

                if (StartDrag(ptx))
                {
                    args.RetVal = true;
                    return;
                }
            }

            if (!d_iscubic || args.Event.Type != Gdk.EventType.TwoButtonPress || args.Event.Button != 1)
            {
                return;
            }

            Point pt = d_graph.Graph.PixelToAxis(new Point(args.Event.X, args.Event.Y));

            List <Point> added = new List <Point>();

            if (d_graph.Graph.SnapRulerToAxis)
            {
                int factor = d_graph.Graph.SnapRulerToAxisFactor;

                if ((args.Event.State & Gdk.ModifierType.ControlMask) != 0)
                {
                    factor *= 2;
                }

                pt = d_graph.Graph.SnapToAxis(pt, factor);
            }

            added.Add(pt);

            if (d_function.Pieces.Length == 0 && d_lastAddedData != null)
            {
                added.Add(d_lastAddedData);
            }

            d_lastAddedData = pt;

            UpdatePieces(added.ToArray());
            args.RetVal = true;
        }