private void tvConnections_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { try { var nodeProducingTooltip = (ConnectionInfo)e.Model; e.Text = nodeProducingTooltip.Description; } catch (Exception ex) { Runtime.MessageCollector.AddExceptionStackTrace("tvConnections_MouseMove (UI.Window.ConnectionTreeWindow) failed", ex); } }
void olv_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { string t = string.Empty; switch (e.ColumnIndex) { case 3: t = "Copy Link to Clipboard"; break; case 4: t = "Open Folder"; break; case 5: t = "Remove File"; break; } e.Text = t; }
private void ToolsListObjView_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { if (e.Column != WaitForExitColumnHeader) { return; } if (!(e.Model is ExternalTool rowItemAsExternalTool) || !rowItemAsExternalTool.TryIntegrate) { return; } e.Text = $"'{Language.strCheckboxWaitForExit}' cannot be enabled if '{Language.strTryIntegrate}' is enabled"; }
private void ToolsListObjView_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { if (e.Column != WaitForExitColumnHeader) { return; } var rowItemAsExternalTool = e.Model as ExternalTool; if (rowItemAsExternalTool == null || !rowItemAsExternalTool.TryIntegrate) { return; } e.Text = string.Format("'{0}' cannot be enabled if '{1}' is enabled", Language.strCheckboxWaitForExit, Language.strTryIntegrate); }
private void olvStudent_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { switch (e.ColumnIndex) { case 0: e.Text = $"Identyfikator ucznia: {(e.Model as StudentAllocation).Student.ID}\nIdentyfikator przydziału do klasy: {(e.Model as StudentAllocation).ID}"; break; case 5: e.Text = (e.Model as StudentAllocation).Student.BirthPlace.ToString(); break; default: break; } }
//Método para poner los tooltip private void listadoEnlaces_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { e.ToolTipControl.IsBalloon = true; Enlaces enlace = (Enlaces)e.Model; if (e.Column == columnaLike) { e.Text = "Voto positivo"; } else if (e.Column == columnaDontLike) { e.Text = "Voto negativo"; } else if (e.Column == columnaReportarFallo) { if (UsuarioConectado.credenciales == "admin") { if (enlace.reportarFallo == 1) { e.Text = "Activo"; } else if (enlace.reportarFallo == 2) { e.Text = "Revisar"; } else { e.Text = "Caido"; } } else { if (enlace.reportarFallo == 1) { e.Text = "Reportar link caído"; } else { e.Text = "Enlace en revisión"; } } } else if (e.Column == columnaTema) { e.Text = enlace.tema; } }
void tlwAlbums_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { var alb = (AlbumDto)e.Item.RowObject; var arsts = alb.Dvds.Where(x => x.StartsWith("_")).ToList(); if (arsts.Any()) { if (arsts.Count > 11) { e.Text = string.Join("\n", arsts.Take(5)) + "\n...\n" + string.Join("\n", arsts.Skip(arsts.Count - 5).Take(5)); } else { e.Text = string.Join("\n", arsts); } } }
private void olvAllCars_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { if (e.Column == colModel || e.Column == colPhysics) { return; } Car c = (Car)e.Model; e.Title = c.manufacturer + " " + c.name; e.Text = string.Format(Loc.String(63), c.cat); e.Text += "\n" + string.Format(Loc.String(64), c.trans); e.Text += "\n" + string.Format(Loc.String(65), c.year); e.Text += "\n" + string.Format(Loc.String(66), c.power); e.Text += "\n" + string.Format(Loc.String(67), c.weight); e.Text += "\n\n" + string.Format(Loc.String(68), c.folder); e.Text += "\n" + string.Format(Loc.String(69), c.physics); }
private void olvAllCars_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { if (e.Column == colModel || e.Column == colPhysics) { return; } Car c = (Car)e.Model; e.Title = c.manufacturer + " " + c.name; e.Text = "Category: " + c.cat; e.Text += "\nTrans: " + c.trans; e.Text += "\nYear: " + c.year; e.Text += "\nPower: " + c.power + " HP"; e.Text += "\nWeight: " + c.weight + " kg"; e.Text += "\n\nModel Folder: " + c.folder; e.Text += "\nPhysics Folder: " + c.physics; }
private void Tree_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { var model = e.Model; if (model is IMasqueradeAs m) { model = m.MasqueradingAs(); } e.AutoPopDelay = 32767; string problem = _activator.DescribeProblemIfAny(model); if (!string.IsNullOrWhiteSpace(problem)) { e.StandardIcon = ToolTipControl.StandardIcons.Error; e.Title = model.ToString(); e.Text = problem; e.IsBalloon = true; } else if (model is ICanBeSummarised sum) { e.StandardIcon = ToolTipControl.StandardIcons.Info; if (model is IMapsDirectlyToDatabaseTable d) { e.Title = $"{model} (ID: {d.ID})"; } else { e.Title = model.ToString(); } e.Text = sum.GetSummary(false, false); e.IsBalloon = true; } }
private void ListView_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { if (e.Model is ProcessRowModel model && model.PreviousValues != null) { var columnIndex = e.ColumnIndex - _fixColumnCount; if (columnIndex >= 0) { var valueIndex = columnIndex / 2; var previousValue = valueIndex < model.PreviousValues.Length ? model.PreviousValues[valueIndex] : null; var newValue = valueIndex < model.NewValues.Length ? model.NewValues[valueIndex] : null; if (previousValue != newValue) { e.Text = "previous value: " + FormattingHelpers.ToDisplayValue(previousValue) + (previousValue == null ? "" : " (" + previousValue.GetType().GetFriendlyTypeName() + ")") + "\r\nnew value: " + FormattingHelpers.ToDisplayValue(newValue) + (newValue == null ? "" : " (" + newValue.GetType().GetFriendlyTypeName() + ")"); } } } }
void OnTooltipShow(object sender, ToolTipShowingEventArgs e) { var item = ContentView.GetItem(e.RowIndex); if (item == null) { return; } var rowObject = item.RowObject; if (rowObject == null) { return; } var columnHeader = ContentView.GetColumn(e.ColumnIndex); if (columnHeader == null) { return; } var cellInfo = rowObject.GetType().GetField(columnHeader.AspectName); if (cellInfo == null) { throw new Exception(String.Format(@"Unexpected exception that should not happen: Type {0} does not contain a field named {1}.", rowObject.GetType(), columnHeader.AspectName)); } if (cellInfo.FieldType == typeof(string)) { e.Text = cellInfo.GetValue(rowObject) as string; } else if (cellInfo.GetCustomAttribute(typeof(StoragePresenceAttribute), false) != null) { var items = ((Array)cellInfo.GetValue(rowObject)).Cast <object>().ToArray(); e.Text = @"[ " + String.Join(", ", items) + @" ]"; } }
private void ListView_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { string stringValue = null; try { OLVColumn column = e.Column ?? e.ListView.GetColumn(0); if (column.AspectName != null && AppManager.Instance.IsCustomEditProperty(SourceObjectType, column.AspectName)) { object objectValue = Dm.Instance.GetCustomPropertyValue(e.Model, column.AspectName, true, AppManager.Instance.TooltipTruncatedMaxItemCount, AppManager.Instance.TooltipTruncatedMaxLength); stringValue = objectValue != null?objectValue.ToString() : null; if (string.IsNullOrEmpty(stringValue)) { return; } else { e.ToolTipControl.SetMaxWidth(400); // Changing colour doesn't work in systems other than XP e.BackColor = Color.AliceBlue; e.ForeColor = Color.IndianRed; e.AutoPopDelay = 15000; e.Text = stringValue; } } else { return;//default tooltip } } catch (Exception ex) { Log.LogError(ex); stringValue = ex.ToString(); } }
private void objectListView1_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { e.ToolTipControl.IsBalloon = true; if (listaAMostrar.Equals("enlaces")) { Enlaces enlace = (Enlaces)e.Model; if (e.Column == Column5) { e.Text = enlace.tema; } else if (e.Column == Column3) { e.Text = enlace.titulo; } else if (e.Column == Column7) { if (enlace.reportarFallo == 1) { e.Text = "Activo"; } else if (enlace.reportarFallo == 2) { e.Text = "Revisar"; } else { e.Text = "Caido"; } } } else { Usuario usuario = (Usuario)e.Model; if (e.Column == Column6) { if (UsuarioConectado.nombre.Equals("admin")) { if (usuario.Credenciales.Equals("admin")) { e.Text = "Quitar privilegios de admin"; } } if (usuario.Credenciales.Equals("normal")) { e.Text = "Conceder privilegios de admin"; } } } if (e.Column == Column8) { if (listaAMostrar.Equals("usuarios")) { Usuario usuario = (Usuario)e.Model; if (usuario.Credenciales.Equals("admin") && !UsuarioConectado.nombre.Equals("admin")) { } else { e.Text = "Eliminar"; } } else { e.Text = "Eliminar"; } } }
/// <summary> /// Handle a get display info message /// </summary> /// <param name="msg">The msg</param> /// <returns>True if the message has been handled</returns> public virtual bool HandleGetDispInfo(ref Message msg) { //System.Diagnostics.Trace.WriteLine("HandleGetDispInfo"); this.SetMaxWidth(); ToolTipShowingEventArgs args = new ToolTipShowingEventArgs(); args.ToolTipControl = this; this.OnShowing(args); if (String.IsNullOrEmpty(args.Text)) return false; this.ApplyEventFormatting(args); NativeMethods.NMTTDISPINFO dispInfo = (NativeMethods.NMTTDISPINFO)msg.GetLParam(typeof(NativeMethods.NMTTDISPINFO)); dispInfo.lpszText = args.Text; dispInfo.hinst = IntPtr.Zero; if (args.RightToLeft == RightToLeft.Yes) dispInfo.uFlags |= TTF_RTLREADING; Marshal.StructureToPtr(dispInfo, msg.LParam, false); return true; }
private void ApplyEventFormatting(ToolTipShowingEventArgs args) { if (!args.IsBalloon.HasValue && !args.BackColor.HasValue && !args.ForeColor.HasValue && args.Title == null && !args.StandardIcon.HasValue && !args.AutoPopDelay.HasValue && args.Font == null) return; this.PushSettings(); if (args.IsBalloon.HasValue) this.IsBalloon = args.IsBalloon.Value; if (args.BackColor.HasValue) this.BackColor = args.BackColor.Value; if (args.ForeColor.HasValue) this.ForeColor = args.ForeColor.Value; if (args.StandardIcon.HasValue) this.StandardIcon = args.StandardIcon.Value; if (args.AutoPopDelay.HasValue) this.AutoPopDelay = args.AutoPopDelay.Value; if (args.Font != null) this.Font = args.Font; if (args.Title != null) this.Title = args.Title; }
/// <summary> /// Handles the CellToolTipShowing event of the container control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="BrightIdeasSoftware.ToolTipShowingEventArgs"/> instance containing the event data.</param> void container_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { var flight = (IFlight)e.Model; e.Text = flight.Segments.DescriptionForToolTip; }
protected string GetUnderlyingObjectText(ToolTipShowingEventArgs e) { return(GetUnderlyingObjectText(ContentView.GetItem(e.RowIndex).RowObject, ContentView.GetColumn(e.ColumnIndex))); }
void OnTooltipShow(object sender, ToolTipShowingEventArgs e) { e.Text = GetUnderlyingObjectText(e); }
private void Params_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { }
/// <summary> /// /// </summary> /// <param name="e"></param> protected virtual void OnShowing(ToolTipShowingEventArgs e) { if (this.Showing != null) this.Showing(this, e); }