Esempio n. 1
0
        static private void DisplayList(object sender, System.Timers.ElapsedEventArgs e)
        {
            ScintillaControl sci = UITools.MainForm.CurSciControl;
            ListBox          cl  = completionList;

            if (cl.Items.Count == 0)
            {
                return;
            }
            // evaluate position
            cl.Height = Math.Min(cl.Items.Count, 10) * cl.ItemHeight + 4;
            Point coord = new Point(sci.PointXFromPosition(startPos), sci.PointYFromPosition(startPos));

            listUp  = (coord.Y + cl.Height > (sci as Control).Height);
            coord   = sci.PointToScreen(coord);
            coord   = ((Form)UITools.MainForm).PointToClient(coord);
            cl.Left = coord.X - 20 + sci.Left;
            if (listUp)
            {
                cl.Top = coord.Y - cl.Height + sci.Top;
            }
            else
            {
                cl.Top = coord.Y + UITools.LineHeight(sci) + sci.Top;
            }
            //
            if (!cl.Visible)
            {
                cl.Show();
                cl.BringToFront();
            }
        }
Esempio n. 2
0
        static public void CallTipShow(ScintillaControl sci, int position, string text)
        {
            toolTip.Visible = false;
            isActive        = true;
            Text            = text;
            AutoSize();
            // position
            startPos    = position + text.IndexOf('(') + 1;
            currentPos  = sci.CurrentPos;
            currentLine = sci.LineFromPosition(currentPos);
            Point p = new Point(sci.PointXFromPosition(position), sci.PointYFromPosition(position));

            p            = ((Form)UITools.MainForm).PointToClient(((Control)sci).PointToScreen(p));
            toolTip.Left = p.X + sci.Left;
            if (currentLine > sci.LineFromPosition(position))
            {
                toolTip.Top = p.Y - toolTip.Height + sci.Top;
            }
            else
            {
                toolTip.Top = p.Y + UITools.LineHeight(sci) + sci.Top;
            }
            toolTip.Show();
            toolTip.BringToFront();
            UITools.LockControl(sci);             // lock keys
        }