void RepositionDeclarationViewWindow() { if (base.GdkWindow == null) { return; } EnsureDeclarationViewWindow(); if (declarationviewwindow.Overloads == 0) { return; } var selectedItem = List.SelectedItemIndex; Gdk.Rectangle rect = List.GetRowArea(selectedItem); if (rect.IsEmpty || rect.Bottom < (int)List.vadj.Value || rect.Y > List.Allocation.Height + (int)List.vadj.Value) { return; } declarationviewwindow.ShowArrow = true; int ox; int oy; base.GdkWindow.GetOrigin(out ox, out oy); declarationviewwindow.MaximumYTopBound = oy; int y = rect.Y + Theme.Padding - (int)List.vadj.Value; declarationviewwindow.ShowPopup(this, new Gdk.Rectangle(0, Math.Min(Allocation.Height, Math.Max(0, y)), Allocation.Width, rect.Height), PopupPosition.Left); declarationViewHidden = false; }
void RepositionDeclarationViewWindow() { if (base.GdkWindow == null) { return; } EnsureDeclarationViewWindow(); if (declarationviewwindow.Overloads == 0) { return; } var selectedItem = List.SelectedItem; Gdk.Rectangle rect = List.GetRowArea(selectedItem); if (rect.IsEmpty || rect.Bottom < (int)List.vadj.Value || rect.Y > List.Allocation.Height + (int)List.vadj.Value) { return; } declarationviewwindow.ShowArrow = true; int ox; int oy; base.GdkWindow.GetOrigin(out ox, out oy); declarationviewwindow.MaximumYTopBound = oy; int y = rect.Y + Theme.Padding - (int)List.vadj.Value; if (!declarationViewHidden && Visible && List.Visible && completionDataList != null && List.SelectionFilterIndex < completionDataList.Count && List.SelectionFilterIndex != -1) { declarationviewwindow.ShowPopup( this, new Gdk.Rectangle(0, Math.Min(Allocation.Height, Math.Max(0, y)), Allocation.Width, rect.Height), PopupPosition.Left); } if (declarationViewHidden || !Visible || !List.Visible || completionDataList == null || List.SelectionFilterIndex >= completionDataList.Count || List.SelectionFilterIndex == -1) { HideDeclarationView(); } }
void ShowTipInfoWindow (TextEditor editor, TooltipInformationWindow tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY) { Gtk.Widget editorWidget = editor; var startLoc = editor.OffsetToLocation (item.Offset); var endLoc = editor.OffsetToLocation (item.EndOffset); var p1 = editor.LocationToPoint (startLoc); var p2 = editor.LocationToPoint (endLoc); int w = (int)(p2.X - p1.X); var caret = new Gdk.Rectangle ( (int)p1.X, (int)p1.Y, (int)w, (int)editor.LineHeight ); tipWindow.ShowPopup (editorWidget, caret, PopupPosition.Top); }
bool DelayedTooltipShow() { var selectedItem = List.SelectedItem; if (selectedItem < 0 || selectedItem >= completionDataList.Count) { return(false); } var data = completionDataList [selectedItem]; IEnumerable <ICompletionData> filteredOverloads; if (data.HasOverloads) { filteredOverloads = data.OverloadedData; if (PropertyService.Get("HideObsoleteItems", false)) { filteredOverloads = filteredOverloads.Where(x => !x.DisplayFlags.HasFlag(DisplayFlags.Obsolete)); } } else { filteredOverloads = new ICompletionData[] { data }; } if (data != currentData) { declarationviewwindow.Clear(); var overloads = new List <ICompletionData> (filteredOverloads); foreach (var overload in overloads) { declarationviewwindow.AddOverload((CompletionData)overload); } currentData = data; if (data.HasOverloads) { for (int i = 0; i < overloads.Count; i++) { if (!overloads[i].DisplayFlags.HasFlag(DisplayFlags.Obsolete)) { declarationviewwindow.CurrentOverload = i; break; } } } } if (declarationviewwindow.Overloads == 0) { HideDeclarationView(); return(false); } Gdk.Rectangle rect = List.GetRowArea(selectedItem); if (rect.IsEmpty || rect.Bottom < (int)List.vadj.Value || rect.Y > List.Allocation.Height + (int)List.vadj.Value) { return(false); } if (declarationViewHidden && Visible) { declarationviewwindow.ShowArrow = true; int ox; int oy; base.GdkWindow.GetOrigin(out ox, out oy); declarationviewwindow.MaximumYTopBound = oy; int y = rect.Y + Theme.Padding - (int)List.vadj.Value; declarationviewwindow.ShowPopup(this, new Gdk.Rectangle(Gui.Styles.TooltipInfoSpacing, Math.Min(Allocation.Height, Math.Max(0, y)), Allocation.Width, rect.Height), PopupPosition.Left); declarationViewHidden = false; } declarationViewTimer = 0; return(false); }