Esempio n. 1
0
        internal void ShowScreenTip(ScreenTipNeededEventArgs args)
        {
            RadItem item   = args.Item;
            Size    offset = args.Offset;
            int     delay  = args.Delay;

            IntPtr activeHwnd = NativeMethods.GetActiveWindow();

            NativeMethods.SetWindowLong(
                new HandleRef(this, this.ScreenPresenter.Handle),
                NativeMethods.GWL_HWNDPARENT, new HandleRef(this, activeHwnd));

            Cursor mouseCursor = Cursor.Current;

            if (mouseCursor != null)
            {
                Point screenTipLocation = Point.Empty;

                if (this.ShowScreenTipsBellowControl)
                {
                    screenTipLocation = this.ownerControl.PointToScreen(this.ownerControl.Location);
                }
                else
                {
                    screenTipLocation = item.PointToScreen(item.Location);
                }

                screenTipLocation.X += offset.Width;
                screenTipLocation.Y += offset.Height;

                this.ScreenPresenter.Show(item.ScreenTip, screenTipLocation, delay);
            }
        }
Esempio n. 2
0
        private void radGridView1_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
        {
            GridDataCellElement cell = e.Item as GridDataCellElement;

            if (cell != null)
            {
                this.ShowScreenTipForCell(cell);
            }
        }
Esempio n. 3
0
        internal void ShowScreenTip(ScreenTipNeededEventArgs args)
        {
            RadElement radElement = args.Item;
            Size       offset     = args.Offset;
            int        delay      = args.Delay;

            NativeMethods.SetWindowLong(new HandleRef((object)this, this.ScreenPresenter.Handle), -8, new HandleRef((object)this, NativeMethods.GetActiveWindow()));
            if (!(Cursor.Current != (Cursor)null))
            {
                return;
            }
            Point empty      = Point.Empty;
            Point pivotPoint = !this.ShowScreenTipsBellowControl ? radElement.PointToScreen(radElement.Location) : this.ownerControl.PointToScreen(this.ownerControl.Location);

            pivotPoint.X += offset.Width;
            pivotPoint.Y += offset.Height;
            this.ScreenPresenter.Show((IScreenTipContent)radElement.ScreenTip, pivotPoint, delay);
        }
Esempio n. 4
0
        internal ScreenTipNeededEventArgs CallOnScreenTipNeeded(RadElement item)
        {
            Size empty = Size.Empty;

            if (this.ShowScreenTipsBellowControl)
            {
                empty.Height = this.ownerControl.ClientRectangle.Height;
                empty.Width  = item.ControlBoundingRectangle.X - this.ownerControl.ClientRectangle.X;
            }
            else
            {
                empty.Height = Math.Max(item.Size.Height, 15);
            }
            ScreenTipNeededEventArgs e = new ScreenTipNeededEventArgs(item, empty);

            this.owner.CallOnScreenTipNeeded((object)this, e);
            return(e);
        }
Esempio n. 5
0
        internal ScreenTipNeededEventArgs CallOnScreenTipNeeded(RadItem item)
        {
            Size offset = Size.Empty;

            if (this.ShowScreenTipsBellowControl)
            {
                offset.Height = this.ownerControl.ClientRectangle.Height;
                offset.Width  = item.ControlBoundingRectangle.X - this.ownerControl.ClientRectangle.X;
            }
            else
            {
                offset.Height = Math.Max(item.Size.Height, 15);
            }

            ScreenTipNeededEventArgs e = new ScreenTipNeededEventArgs(item, offset);

            this.owner.CallOnScreenTipNeeded(this, e);
            return(e);
        }
Esempio n. 6
0
        internal void UpdateScreenTip(ScreenTipNeededEventArgs args)
        {
            RadElement radElement = (RadElement)null;

            if (args != null)
            {
                radElement = args.Item;
            }
            if (!this.ShowItemToolTips || radElement == this.currentlyActiveScreentipItem)
            {
                return;
            }
            this.HideScreenTip();
            this.currentlyActiveScreentipItem = radElement;
            if (this.currentlyActiveScreentipItem == null)
            {
                return;
            }
            this.ShowScreenTip(args);
        }
Esempio n. 7
0
        internal void UpdateScreenTip(ScreenTipNeededEventArgs args)
        {
            RadItem item = null;

            if (args != null)
            {
                item = args.Item;
            }

            if (this.ShowItemToolTips && item != this.currentlyActiveScreentipItem)
            {
                this.HideScreenTip();
                this.currentlyActiveScreentipItem = item;

                if (this.currentlyActiveScreentipItem != null)
                {
                    this.ShowScreenTip(args);
                }
            }
        }