コード例 #1
0
ファイル: EvilDPSArea.cs プロジェクト: Tilps/Stash
        private void ShowTooltip()
        {
            Point loc = Cursor.Position;
            Control child = this.GetChildAtPoint(this.PointToClient(loc));
            if (child is EvilDPSBar)
            {
                EvilDPSGraph g = GetGraphForBar(child);
                if (g.Samples.Count == 0)
                    return;
                ToolStripDropDown f = new ToolStripDropDown();
                f.Margin = Padding.Empty;
                f.Padding = Padding.Empty;
                ToolStripControlHost host = new ToolStripControlHost(g);
                host.Padding = Padding.Empty;
                host.Margin = Padding.Empty;
                f.Items.Add(host);
                f.Width = 300;
                f.Height = 80;
                g.Dock = DockStyle.Fill;
                host.Dock = DockStyle.Fill;
                g.Width = 300;
                g.Height = 80;
                f.Show(Cursor.Position);

                currentGraph = g;
            }
        }
コード例 #2
0
ファイル: EvilDPSArea.cs プロジェクト: Tilps/Stash
 private EvilDPSGraph GetGraphForBar(Control child)
 {
     EvilDPSBar[] bars = new EvilDPSBar[] { evilDPSBarDOut, evilDPSBarDIn, evilDPSBarHOut, evilDPSBarHIn, evilDPSBarPDOut, evilDPSBarPDIn };
     List<int>[] samples = new List<int>[] { douts, dins, houts, hins, dpouts, dpins };
     EvilDPSGraph g = new EvilDPSGraph();
     int pos = Array.IndexOf(bars, child);
     if (pos >= 0)
         g.Samples = samples[pos];
     return g;
 }