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 }
static public void Show(ArrayList itemList, bool autoHide) { // check controls ScintillaControl sci = UITools.MainForm.CurSciControl; ListBox cl = completionList; try { if ((itemList == null) || (itemList.Count == 0)) { if (isActive) { Hide(); } return; } if (sci == null) { if (isActive) { Hide(); } return; } if (InfoTip.CallTipActive) { InfoTip.Hide(); } } catch (Exception ex) { ErrorHandler.ShowError("Completion list Control exception.", ex); } // state allItems = itemList; autoHideList = autoHide; word = ""; if (currentWord != null) { word = currentWord; currentWord = null; } fullList = (word.Length == 0) || !autoHide || !autoFilterList; lastIndex = 0; exactMatchInList = false; startPos = sci.CurrentPos - word.Length; currentPos = sci.CurrentPos; // lock keys isActive = true; UITools.LockControl(sci); // populate list tempo.Enabled = autoHide && (displayDelay > 0); if (tempo.Enabled) { tempo.Interval = displayDelay; } FindWordStartingWith(word); }