Exemple #1
0
        internal ToolTipTextNeededEventArgs OnToolTipTextNeeded(
            RadElement sender)
        {
            Size empty = Size.Empty;
            ToolTipTextNeededEventArgs e = new ToolTipTextNeededEventArgs(this.ToolTip, sender.ToolTipText, empty);

            this.owner.CallOnToolTipTextNeeded((object)sender, e);
            return(e);
        }
Exemple #2
0
        internal ToolTipTextNeededEventArgs OnToolTipTextNeeded(RadItem sender)
        {
            Size   offset      = Size.Empty;
            Cursor mouseCursor = Cursor.Current;

            if (mouseCursor != null)
            {
                offset.Width   = 1;
                offset.Height += mouseCursor.Size.Height - mouseCursor.HotSpot.Y;
            }

            ToolTipTextNeededEventArgs e = new ToolTipTextNeededEventArgs(sender.ToolTipText, offset);

            this.owner.CallOnToolTipTextNeeded(sender, e);
            return(e);
        }
Exemple #3
0
        private void radGanttView1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
        {
            Point      mousePosition     = this.radGanttView1.PointToClient(Control.MousePosition);
            RadElement elementUnderMouse = this.radGanttView1.ElementTree.GetElementAtPoint(mousePosition);

            if (elementUnderMouse == null)
            {
                return;
            }

            GanttGraphicalViewBaseItemElement itemElement = elementUnderMouse as GanttGraphicalViewBaseItemElement;

            if (itemElement == null)
            {
                itemElement = elementUnderMouse.FindAncestor <GanttGraphicalViewBaseItemElement>();
            }

            if (itemElement == null)
            {
                return;
            }

            if (elementUnderMouse is DrivingToPickUpLocationElement)
            {
                e.ToolTipText = string.Format("Driving to site: {0}", ((DataRowView)itemElement.Data.DataBoundItem)["DrivingToPickUpLocation"]);
            }
            else if (elementUnderMouse is LoadingElement)
            {
                e.ToolTipText = string.Format("Loading time: {0}", ((DataRowView)itemElement.Data.DataBoundItem)["Loading"]);
            }
            else if (elementUnderMouse is DrivingElement)
            {
                e.ToolTipText = string.Format("Driving: {0}", ((DataRowView)itemElement.Data.DataBoundItem)["Driving"]);
            }
            else if (elementUnderMouse is DriverRestElement)
            {
                e.ToolTipText = string.Format("Driver rest: {0}", ((DataRowView)itemElement.Data.DataBoundItem)["DriverRest"]);
            }
            else if (elementUnderMouse is WaitingElement)
            {
                e.ToolTipText = string.Format("Waiting: {0}", ((DataRowView)itemElement.Data.DataBoundItem)["Waiting"]);
            }
            else if (elementUnderMouse is UnloadingElement)
            {
                e.ToolTipText = string.Format("Unloading: {0}", ((DataRowView)itemElement.Data.DataBoundItem)["Unloading"]);
            }
        }