//----------------------------------------------------------------- public void ShowToolTip(object objet) { if (objet == null) { return; } m_lastObjetPopup = objet; CModeleTexte modele = CTimosAppRegistre.GetModeleTexteForType(m_strContexte, objet.GetType()); if (modele != null) { if (m_lastControlMouseMove != null) { Point pt = m_lastControlMouseMove.PointToScreen(m_lastPoint); pt.Offset(16, 16); CRichTextViewerPopup.Popup(pt, modele, objet); } } }
//------------------------------------------------------------------------- private void m_btnTest_Click(object sender, EventArgs e) { if (m_objetTest == null) { SelectObjetTest(); } if (m_objetTest == null) { return; } CResultAErreur result = MAJ_Champs(); if (!result) { CFormAlerte.Afficher(result.Erreur); return; } CRichTextViewerPopup.Popup(PointToScreen(m_btnTest.Location), ModeleTexte, m_objetTest); }
public static void Popup(Point screenPoint, CModeleTexte modele, object objet) { if (objet == null || modele == null) { return; } if (m_staticPopup == null) { //Création du viewer static m_staticPopup = new CRichTextViewerPopup(); } Screen scr = Screen.FromPoint(screenPoint); Point ptStart = screenPoint; Size sz = new Size(modele.Largeur, modele.Hauteur); if (ptStart.X + sz.Width > scr.WorkingArea.Right) { ptStart.Offset(-sz.Width, 0); } if (ptStart.Y + sz.Height > scr.WorkingArea.Bottom) { ptStart.Offset(0, -sz.Height); } m_staticPopup.Visible = false; m_staticPopup.Size = sz; m_staticPopup.Location = ptStart; m_staticPopup.m_richText.Init(modele, objet); m_staticPopup.AutoPlacement = false; m_staticPopup.Show(); /*m_staticPopup.Show(); * m_staticPopup.BringToFront(); * m_staticPopup.m_pointSourisInitial = Cursor.Position; * m_staticPopup.Capture = true; * m_staticPopup.Focus();*/ }
//----------------------------------------------------------------- public void HideToolTip() { CRichTextViewerPopup.HideTooltip(); m_bAfficheSansDelai = false; m_lastObjetPopup = null; }