public static CodeCompletionPopup Show(ArrayList items, Point p) { if (popup == null) { popup = new CodeCompletionPopup(); } //popup.VerticalOffset = p.Y; //popup.HorizontalOffset = p.X; double font = Kaxaml.Properties.Settings.Default.EditorFontSize; popup.PlacementRectangle = new Rect(p.X, p.Y - font, 1, font); popup.CompletionItems = items; if (items == null || items.Count == 0) { return(popup); } popup.CompletionListBox.SelectedIndex = 0; popup._OverrideForceAccept = false; popup.Show(); return(popup); }
public static CodeCompletionPopup Show(ArrayList items, Point p) { if (popup == null) { popup = new CodeCompletionPopup(); } //popup.VerticalOffset = p.Y; //popup.HorizontalOffset = p.X; double font = Kaxaml.Properties.Settings.Default.EditorFontSize; popup.PlacementRectangle = new Rect(p.X, p.Y - font, 1, font); popup.CompletionItems = items; if (items == null || items.Count == 0) { return popup; } popup.CompletionListBox.SelectedIndex = 0; popup._OverrideForceAccept = false; popup.Show(); return popup; }
public void ShowCompletionWindowUI(object param) { _SpaceIsValid = false; if (param is ArrayList) { ArrayList items = (ArrayList)param; Window mainWindow = System.Windows.Application.Current.MainWindow; double borderX = 0; // mainWindow.ActualWidth - (mainWindow.Content as FrameworkElement).ActualWidth; double borderY = mainWindow.ActualHeight - (mainWindow.Content as FrameworkElement).ActualHeight; System.Drawing.Point editorPoint = TextEditor.PointToScreen(new System.Drawing.Point(0, 0)); System.Drawing.Point caretPoint = TextEditor.ActiveTextAreaControl.Caret.ScreenPosition; popup = CodeCompletionPopup.Show(items, new Point(editorPoint.X + caretPoint.X + borderX, editorPoint.Y + caretPoint.Y + (FontSize * 1.3) + 3)); popup.ResultProvided += w_ResultProvided; } }