/* H O V E R G R A P H */ /*---------------------------------------------------------------------------- * %%Function: HoverGraph * %%Qualified: bg.BgGraph.HoverGraph * %%Contact: rlittle * * ----------------------------------------------------------------------------*/ private void HoverGraph(object sender, System.EventArgs e) { PictureBox pb = (PictureBox)sender; if (BvFromPb(pb) != BoxView.Graph) { return; } Grapher grph = (Grapher)pb.Tag; Point ptRaw = Cursor.Position; Point pt = pb.PointToClient(ptRaw); PTFI ptfiHit = new PTFI(); bool fHit = false; RectangleF rectfHit; object oHit; fHit = grph.FHitTest(pt, out oHit, out rectfHit); ptfiHit = (PTFI)oHit; if (fHit) { if (m_ch == null) { m_ch = new Hover(); } m_ch.ShowTip(ptRaw, ptfiHit.bge); this.Focus(); m_fTipShowing = true; m_rectfTipHitRegion = rectfHit; } this.Focus(); // now lets register for this again user32.TRACKMOUSEEVENT tme = new user32.TRACKMOUSEEVENT(); tme.cbSize = Marshal.SizeOf(tme); tme.dwFlags = 1; tme.dwHoverTime = -1; tme.hwndTrack = pb.Handle; user32.TrackMouseEvent(ref tme); }
/* H O V E R G R A P H */ /*---------------------------------------------------------------------------- %%Function: HoverGraph %%Qualified: bg.BgGraph.HoverGraph %%Contact: rlittle ----------------------------------------------------------------------------*/ private void HoverGraph(object sender, System.EventArgs e) { PictureBox pb = (PictureBox)sender; if (BvFromPb(pb) != BoxView.Graph) return; Grapher grph = (Grapher)pb.Tag; Point ptRaw = Cursor.Position; Point pt = pb.PointToClient(ptRaw); PTFI ptfiHit = new PTFI(); bool fHit = false; RectangleF rectfHit; object oHit; fHit = grph.FHitTest(pt, out oHit, out rectfHit); ptfiHit = (PTFI)oHit; if (fHit) { if (m_ch == null) m_ch = new Hover(); m_ch.ShowTip(ptRaw, ptfiHit.bge); this.Focus(); m_fTipShowing = true; m_rectfTipHitRegion = rectfHit; } this.Focus(); // now lets register for this again user32.TRACKMOUSEEVENT tme = new user32.TRACKMOUSEEVENT(); tme.cbSize = Marshal.SizeOf(tme); tme.dwFlags = 1; tme.dwHoverTime = -1; tme.hwndTrack = pb.Handle; user32.TrackMouseEvent(ref tme); }