Ejemplo n.º 1
0
        private void dataKey_Enter(object sender, EventArgs e)
        {
            if (isSettingGraphs)
            {
                return;
            }

            DataKey dataKey = sender as DataKey;

            if (dataKey != null)
            {
                ScrollControlIntoView(dataKey);
                int index = Keys.IndexOf(dataKey);
                if (index != SelectedGraphIndex && Graphs.IndexInRange(index))
                {
                    SelectedGraph = Graphs[index];
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Uses Sets (which is used for drawing) so must be on the event thread)
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMouseClick(MouseEventArgs e)
        {
            Program.AssertOnEventThread();

            base.OnMouseClick(e);
            Select();

            if (ArchiveMaintainer == null || ArchiveMaintainer.LoadingInitialData)
            {
                return;
            }

            if (HaveMoved || DataPlotNav == null || DataKey == null || ArchiveMaintainer == null)
            {
                HaveMoved = false;
                return;
            }
            if (DataEventList != null && e.Location.Y < Padding.Top + 18)
            {
                DataEventList.OnEventsMouseClick(new MouseActionArgs(e.Location, GraphRectangle(), DataPlotNav.XRange, SelectedYRange));
                DataKey.SelectedItem = null;
            }
            else if (GraphRectangle().Contains(e.Location))
            {
                foreach (DataSet set in DataPlotNav.CurrentArchive.Sets.ToArray())
                {
                    if (!set.Draw || DataKey == null || !DataKey.DataSourceUUIDsToShow.Contains(set.Uuid))
                    {
                        continue;
                    }
                    if (set.OnMouseClick(new MouseActionArgs(e.Location, GraphRectangle(), DataPlotNav.XRange, SelectedYRange)))
                    {
                        DataKey.SelectDataSet(set);
                        return;
                    }
                }
                DataKey.SelectedItem = null;
            }
            else
            {
                DataKey.SelectedItem = null;
            }
        }
Ejemplo n.º 3
0
 private DataKey CreateKey(Point location)
 {
     DataKey key = new DataKey();
     key.Location = location;
     key.Size = new Size(KEY_WIDTH, GRAPH_HEIGHT - (2 * GRAPH_PADDING));
     key.ArchiveMaintainer = ArchiveMaintainer;
     key.Anchor = AnchorStyles.Right | AnchorStyles.Top;
     Keys.Add(key);
     this.Controls.Add(key);
     return key;
 }
Ejemplo n.º 4
0
 private void PlotNav_RangeChanged()
 {
     DataKey.UpdateItems();
     RefreshBuffer();
 }