public void Show(Xwt.Popover.Position orientation, Xwt.Widget reference, Xwt.Rectangle positionRect, Widget child) { var parent = reference.ParentWindow; popover = new PopoverWindow((Gtk.Widget)((WidgetBackend)Toolkit.GetBackend(child)).NativeWidget, orientation); popover.SetPadding(frontend.Padding); popover.TransientFor = ((WindowFrameBackend)Toolkit.GetBackend(parent)).Window; popover.DestroyWithParent = true; popover.Hidden += (o, args) => { popover.ReleaseInnerWidget(); sink.OnClosed(); popover.Destroy(); }; var screenBounds = reference.ScreenBounds; if (positionRect == Rectangle.Zero) { positionRect = new Rectangle(Point.Zero, screenBounds.Size); } positionRect = positionRect.Offset(screenBounds.Location); var position = new Point(positionRect.Center.X, popover.ArrowPosition == Popover.Position.Top ? positionRect.Bottom : positionRect.Top); popover.ShowAll(); popover.GrabFocus(); int w, h; popover.GetSize(out w, out h); popover.Move((int)position.X - w / 2, (int)position.Y); popover.SizeAllocated += (o, args) => { popover.Move((int)position.X - args.Allocation.Width / 2, (int)position.Y); popover.GrabFocus(); }; }
public void Show(Xwt.Popover.Position orientation, Xwt.Widget reference, Xwt.Rectangle positionRect, Widget child) { var parent = reference.ParentWindow; popover = new PopoverWindow ((Gtk.Widget)((WidgetBackend)Toolkit.GetBackend (child)).NativeWidget, orientation); popover.SetPadding (frontend.Padding); popover.TransientFor = ((WindowFrameBackend)Toolkit.GetBackend (parent)).Window; popover.DestroyWithParent = true; popover.Hidden += (o, args) => { popover.ReleaseInnerWidget (); sink.OnClosed (); popover.Destroy (); }; var screenBounds = reference.ScreenBounds; if (positionRect == Rectangle.Zero) positionRect = new Rectangle (Point.Zero, screenBounds.Size); positionRect = positionRect.Offset (screenBounds.Location); var position = new Point (positionRect.Center.X, popover.ArrowPosition == Popover.Position.Top ? positionRect.Bottom : positionRect.Top); popover.ShowAll (); popover.GrabFocus (); int w, h; popover.GetSize (out w, out h); popover.Move ((int)position.X - w / 2, (int)position.Y); popover.SizeAllocated += (o, args) => { popover.Move ((int)position.X - args.Allocation.Width / 2, (int)position.Y); popover.GrabFocus (); }; }
public void Init(IWindowFrameBackend parent, IWidgetBackend child, Xwt.Popover.Position orientation) { popover = new PopoverWindow ((Gtk.Widget)child.NativeWidget, orientation); popover.TransientFor = ((WindowFrameBackend)parent).Window; popover.DestroyWithParent = true; popover.Hidden += (o, args) => { if (Closed != null) Closed (this, EventArgs.Empty); }; }
public void Initialize (IPopoverEventSink sink) { this.sink = sink; this.BackgroundColor = Xwt.Drawing.Color.FromBytes (0xee, 0xee, 0xee, 0xf9); this.popover = new PopoverWindow (); }
public void Initialize(IPopoverEventSink sink) { this.sink = sink; this.BackgroundColor = Xwt.Drawing.Color.FromBytes(0xee, 0xee, 0xee, 0xf9); this.popover = new PopoverWindow(); }
public virtual void Initialize(PopoverWindow popupWindow) { }