private void olvChecks_CellToolTipShowing(object sender, BrightIdeasSoftware.ToolTipShowingEventArgs e) { // Show Rationale as tooltip for column Description if (e.ColumnIndex == this.olvColName.Index) { var check = e.Model as Check; if (check != null) { e.Text = check.Rationale; } } }
private void olvValidations_CellToolTipShowing(object sender, BrightIdeasSoftware.ToolTipShowingEventArgs e) { // Show Proposed Solution as tooltip on Item Name if (e.ColumnIndex == this.olvColItemName.Index) { Validation validation = (Validation)e.Model; Check check = this.controller.checks.FirstOrDefault(x => x.CheckId == validation.CheckId); if (check != null) { e.Text = check.ProposedSolution; } } }
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; } }
public virtual bool HandleGetDispInfo(ref Message msg) { this.SetMaxWidth(); ToolTipShowingEventArgs e = new ToolTipShowingEventArgs { ToolTipControl = this }; this.OnShowing(e); if (string.IsNullOrEmpty(e.Text)) { return(false); } this.ApplyEventFormatting(e); BrightIdeasSoftware.NativeMethods.NMTTDISPINFO lParam = (BrightIdeasSoftware.NativeMethods.NMTTDISPINFO)msg.GetLParam(typeof(BrightIdeasSoftware.NativeMethods.NMTTDISPINFO)); lParam.lpszText = e.Text; lParam.hinst = IntPtr.Zero; if (e.RightToLeft == RightToLeft.Yes) { lParam.uFlags |= 4; } Marshal.StructureToPtr(lParam, msg.LParam, false); return(true); }
/// <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; }
/// <summary> /// Allow the HeaderControl to call back into HandleHeaderToolTipShowing without making that method public /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal void HeaderToolTipShowingCallback(object sender, ToolTipShowingEventArgs e) { this.HandleHeaderToolTipShowing(sender, e); }
protected string GetUnderlyingObjectText(ToolTipShowingEventArgs e) { return GetUnderlyingObjectText(ContentView.GetItem(e.RowIndex).RowObject, ContentView.GetColumn(e.ColumnIndex)); }
/// <summary> /// CellToolTipShowing /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ListView_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { OLVColumn col = e.Column ?? e.ListView.GetColumn(0); string stringValue = col.GetStringValue(e.Model); e.IsBalloon = !ObjectListView.IsVistaOrLater; // balloons don't work reliably on vista e.ToolTipControl.SetMaxWidth(400); e.Title = String.Empty; //"Strings"; e.StandardIcon = ToolTipControl.StandardIcons.InfoLarge; e.BackColor = System.Drawing.Color.AliceBlue; e.ForeColor = System.Drawing.Color.IndianRed; e.AutoPopDelay = 25000; e.Font = new System.Drawing.Font("Tahoma", 10.0f); e.Text = stringValue; }
/// <summary> /// The cell tooltip control wants information about the tool tip that it should show. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void HandleCellToolTipShowing(object sender, ToolTipShowingEventArgs e) { this.BuildCellEvent(e, this.PointToClient(Cursor.Position)); if (e.Item != null) { e.Text = this.GetCellToolTip(e.ColumnIndex, e.RowIndex); this.OnCellToolTip(e); } }
/// <summary> /// /// </summary> /// <param name="args"></param> protected virtual void OnHeaderToolTip(ToolTipShowingEventArgs args) { if (this.HeaderToolTipShowing != null) this.HeaderToolTipShowing(this, args); }
private void list_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { if (e.ColumnIndex == msgCol.Index) ShowWindow(e.ToolTipControl.Handle, 0); }
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); } }
private void list_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { string tooltip = ""; var row_idx = e.RowIndex; if (row_idx >= 0) { var i = model_.item_at(row_idx); var col_idx = e.Column.fixed_index(); string text = log_view_cell.cell_value(i, col_idx) ; var cell = i.override_print(this, text, col_idx, column_formatter_base.format_cell.location_type.view); int char_idx = 0; using (Graphics g = CreateGraphics()) { var widths = render.text_widths(g, text); int offset_x = list.GetItem(row_idx).GetSubItemBounds(e.ColumnIndex).X; for (int idx = 0; idx < widths.Count; ++idx) widths[idx] += offset_x; var mouse = list.PointToClient( Cursor.Position); char_idx = widths.FindLastIndex(x => x < mouse.X); if (widths.Count == 0 || widths.Last() < mouse.X) char_idx = widths.Count; if (char_idx < 0) char_idx = 0; } if ( char_idx >= 0 && char_idx < cell.format_text. text.Length) tooltip = formatter.get_tooltip(cell, char_idx); } if (tooltip != "") e.Text = tooltip; else ShowWindow(e.ToolTipControl.Handle, 0); }
private void objectListView1_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { ContestantListLine modelItem = (ContestantListLine)objectListView1.GetModelObject(e.Item.Index); if (modelItem is RoundDivider && (roundContestantCounts[Convert.ToInt32(e.Item.SubItems[0].Text)-1] > MaximumRoundSize)) { e.Title = "Varoitus"; e.StandardIcon = ToolTipControl.StandardIcons.Warning; e.Text = "Erässä on liikaa kilpailijoita"; } }
/// <summary> /// /// </summary> /// <param name="args"></param> protected virtual void OnCellToolTip(ToolTipShowingEventArgs args) { if (CellToolTipShowing != null) CellToolTipShowing(this, args); }
protected virtual void OnShowing(ToolTipShowingEventArgs e) { if (this.Showing != null) this.Showing(this, e); }
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; }
private void objectListView_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { var col = e.Column ?? e.ListView.GetColumn(0); Movie movie = e.Model as Movie; if (movie != null) e.Text = movie.Name; }
/// <summary> /// Allow the HeaderControl to call back into HandleHeaderToolTipShowing without making that method public /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal void headerToolTip_Showing(object sender, ToolTipShowingEventArgs e) { this.HandleHeaderToolTipShowing(sender, e); }
private void list_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { // 1.6.6+ - I think this is wrong! if (e.ColumnIndex == msgCol.fixed_index()) ShowWindow(e.ToolTipControl.Handle, 0); }
/// <summary> /// The header tooltip control wants information about the tool tip that it should show. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void HandleHeaderToolTipShowing(object sender, ToolTipShowingEventArgs e) { e.ColumnIndex = this.HeaderControl.ColumnIndexUnderCursor; if (e.ColumnIndex < 0) return; e.RowIndex = -1; e.Model = null; e.Column = this.GetColumn(e.ColumnIndex); e.Text = this.GetHeaderToolTip(e.ColumnIndex); e.ListView = this; this.OnHeaderToolTip(e); }
void OnTooltipShow(object sender, ToolTipShowingEventArgs e) { e.Text = GetUnderlyingObjectText(e); }