示例#1
0
        private void PopupHelp(CHelpData help)
        {
            Point pt = Cursor.Position;

            pt.Offset(0, 5);
            CWebViewerPopup.Popup(pt, help);
        }
示例#2
0
        public static void Popup(Point screenPoint, CHelpData help)
        {
            if (help == null || !help.HasData)
            {
                if (m_staticPopup != null)
                {
                    m_staticPopup.Visible = false;
                }
                return;
            }
            if (m_staticPopup == null)
            {
                //Création du viewer static
                m_staticPopup = new CWebViewerPopup();
            }

            Screen scr     = Screen.FromPoint(screenPoint);
            Point  ptStart = screenPoint;
            Size   sz      = help.SizePopup;

            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.Size     = sz;
            m_staticPopup.Location = ptStart;
            m_staticPopup.m_webViewer.DocumentText = help.TexteHTML;
            m_staticPopup.m_webViewer.Show();
            //help.FillRichText(m_staticPopup.m_richText);
            m_staticPopup.Show();

            /*m_staticPopup.Show();
             * m_staticPopup.BringToFront();
             * m_staticPopup.m_pointSourisInitial = Cursor.Position;
             * m_staticPopup.Capture = true;
             * m_staticPopup.Focus();*/
        }