Ejemplo n.º 1
0
        void MouseUp(object sender, VizComponentMouseEventArgs e)
        {
            const int treshold = 10;

            //Trying to see if mouse was dragged or was it clicked
            if (e.MouseEventArgs.Button == MouseButtons.Left &&
                (iMouseClickPoint.X - treshold < e.MouseEventArgs.Location.X && iMouseClickPoint.X + treshold > e.MouseEventArgs.Location.X) &&
                (iMouseClickPoint.Y - treshold < e.MouseEventArgs.Location.Y && iMouseClickPoint.Y + treshold > e.MouseEventArgs.Location.Y)
                )
            {
                Vector2 v     = choroMap.ConvertScreenCoordinatesToMapCoordinates(e.MouseEventArgs.Location);
                int     index = iMapData.GetRegionId(v);

                List <int> selectedItems = new List <int>();

                // if CTRL is pressed, add the line to the selection
                Keys keys = Control.ModifierKeys;
                bool add  = (keys == Keys.Control);

                bool visibility = false;
                if (index != -1)
                {
                    visibility = polygonLayer.IndexVisibilityHandler.GetVisibility(index);
                    if (visibility)
                    {
                        selectedItems.Add(index);
                        iDoc.SetSelectedItems(selectedItems, add, true);
                    }
                }
                else
                {
                    iDoc.SetSelectedItems(selectedItems, add, true);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the event of mouse pressing over the PC plot
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void pcPlot_Picked(object sender, IndexesPickedEventArgs e)
        {
            //ParallelCoordinatesPlot plot = (ParallelCoordinatesPlot)sender;
            List <int> selectedLines = e.PickedIndexes;

            // if CTRL is pressed, add the line to the selection
            Keys keys = Control.ModifierKeys;
            bool add  = (keys == Keys.Control);

            iDoc.SetSelectedItems(selectedLines, add, true);
        }