예제 #1
0
        void ShowDescription()
        {
            if (descriptionWindow == null)
            {
                return;
            }
            var rect = GetRowArea(SelectedItemIndex);
            int y    = rect.Y + Theme.Padding - (int)vadj.Value;

            descriptionWindow.ShowPopup(this, new Gdk.Rectangle(0, Math.Min(Allocation.Height, Math.Max(0, y)), Allocation.Width, rect.Height), PopupPosition.Left);
            descriptionWindow.Show();
        }
        void ShowDescription(TooltipInformation description)
        {
            HideDescription();

            if (description == null)
            {
                return;
            }

            var window = new TooltipInformationWindow();

            window.AddOverload(description);
            descriptionWindow = window;
            var rect = GetRowArea(SelectedItemIndex);
            int y    = rect.Y + Theme.Padding - (int)vadj.Value;

            descriptionWindow.ShowPopup(this, new Gdk.Rectangle(0, Math.Min(Allocation.Height, Math.Max(0, y)), Allocation.Width, rect.Height), PopupPosition.Left);
            descriptionWindow.Show();
        }
예제 #3
0
            public override void DisplayAt(Point point)
            {
                //The horizontal and verical offsets are specified in terms of device pixels
                //so convert logical pixel position in point to device pixels.
                //_popup.HorizontalOffset = point.X * WpfHelper.DeviceScaleX;
                //_popup.VerticalOffset = point.Y * WpfHelper.DeviceScaleY;
                _popup.Location = point;

                if (base.Content != _popupContentContainer.Content)
                {
                    if (base.Content.Parent == null)
                    {
                        _popupContentContainer.Content = base.Content;
                        _popup.Show();
                    }
                    else
                    {
                        //The intended content still has a parent. Clear out the old content and hope things are better next time around.
                        _popupContentContainer.Content = null;
                    }
                }
            }