private void onObjectHotTracked(HotTrackEventArgs e) { var series = e.Series(); var point = e.HitInfo.SeriesPoint; if (series == null || point == null || !point.Values.Any()) { hideToolTip(e); return; } var value = point.Values[0]; var intValue = Math.Ceiling(point.Values[0]); var valueText = _doubleFormatter.Format(point.Values[0]); if (value == intValue) { valueText = _intFormatter.Format(Convert.ToInt32(intValue)); } var superToolTip = _toolTipCreator.CreateToolTip($"{AxisY.Title.Text}: {valueText}", series.Name); var args = new ToolTipControllerShowEventArgs { SuperTip = superToolTip }; ToolTipController.ShowHint(args); }
private void Editor_SelectionChanged(object sender, EventArgs e) { if (View.SelectedObjects.Count > 1 && _gridView != null && SelectedItemSumEnabled()) { var isUnboundColumn = !string.IsNullOrEmpty(_gridView.FocusedColumn.UnboundExpression); var columnName = isUnboundColumn ? _gridView.FocusedColumn.Caption : _gridView.FocusedColumn.FieldName; if (!columnName.Contains("!")) { var columnType = GetColumnType(); switch (columnType.FullName) { case "System.Int32": case "System.Decimal": case "System.Int64": case "System.Single": case "System.Double": var info = Calculate(isUnboundColumn, columnName); string columnMask = GetColumnMask(); _toolTipController.ShowHint(string.Format(columnMask, info.Total, columnName, info.MinTotal, info.Count, info.MaxTotal)); if (!_gridView.OptionsView.ShowFooter) { _gridView.OptionsView.ShowFooter = true; View.Model.IsFooterVisible = true; View.SaveModel(); } break; } } } }
public static void ShowTip(this Control ctl, string content, ToolTipLocation tipLocation = ToolTipLocation.BottomCenter, ToolTipType toolTipType = ToolTipType.Standard, int showTime = 2000, bool isAutoHide = true, ToolTipIconType tipIconType = ToolTipIconType.Application, ImageList imgList = null, int imgIndex = 0) { try { var myToolTipClt = new ToolTipController(); ToolTipControllerShowEventArgs args = myToolTipClt.CreateShowArgs(); myToolTipClt.ImageList = imgList; myToolTipClt.ImageIndex = (imgList == null ? 0 : imgIndex); args.AutoHide = isAutoHide; myToolTipClt.Appearance.BackColor = Color.FromArgb(254, 254, 254); myToolTipClt.ShowBeak = true; myToolTipClt.AllowHtmlText = true; myToolTipClt.ShowShadow = true; myToolTipClt.Rounded = true; myToolTipClt.AutoPopDelay = (showTime == 0 ? 2000 : showTime); myToolTipClt.SetToolTip(ctl, content); myToolTipClt.SetToolTipIconType(ctl, tipIconType); myToolTipClt.Active = true; myToolTipClt.ToolTipType = toolTipType; myToolTipClt.HideHint(); myToolTipClt.ShowHint(content, null, ctl, tipLocation); } catch (Exception ex) { LogUtil.WriteException(ex); } }
private void gbList_RowCellClick(object sender, RowCellClickEventArgs e) { DateTime dateTime; CHBK2014_N9.Common.Class.RowClickEventArgs rowClickEventArg = new CHBK2014_N9.Common.Class.RowClickEventArgs(e.RowHandle, e.Column.ColumnHandle); this.SetMenu(rowClickEventArg); try { this.toolTip1.HideHint(); int num = Convert.ToInt32(this.gbList.GetFocusedRowCellValue(this.colStatus).ToString()); if (num == 0) { ToolTipController toolTipController = this.toolTip1; string[] newLine = new string[] { "Đang thử việc!", Environment.NewLine, "Từ ngày: ", null, null, null, null }; dateTime = Convert.ToDateTime(this.gbList.GetFocusedRowCellValue(this.colTestFromDate).ToString()); newLine[3] = dateTime.ToShortDateString(); newLine[4] = Environment.NewLine; newLine[5] = "Đến ngày: "; dateTime = Convert.ToDateTime(this.gbList.GetFocusedRowCellValue(this.colTestToDate).ToString()); newLine[6] = dateTime.ToShortDateString(); toolTipController.ShowHint(string.Concat(newLine)); } if (num == 3) { ToolTipController toolTipController1 = this.toolTip1; string str = Environment.NewLine; dateTime = Convert.ToDateTime(this.gbList.GetFocusedRowCellValue(this.colEndDate).ToString()); toolTipController1.ShowHint(string.Concat("Đã nghỉ việc!", str, "Từ ngày: ", dateTime.ToShortDateString())); } } catch { } }
public static void ShowHint(ToolTipController toolTipController, Control control, ToolTipIconType icon, string title, string message) { toolTipController.ShowHint( new ToolTipControllerShowEventArgs(control, null, message, title, ToolTipLocation.TopRight, true, false, 0, icon, ToolTipIconSize.Small, null, 0, null, null), control); }
protected override void CheckMouseCursor(LookUpPopupHitTest ht) { if (prevPoint.X != ht.Point.X || prevPoint.Y != ht.Point.Y) { prevPoint = ht.Point; LookUpEditHints le = this.OwnerEdit as LookUpEditHints; LookUpColumnInfo column; int columnPos = -1; for (int i = 0; i < this.OwnerEdit.Properties.Columns.Count; i++) { column = this.OwnerEdit.Properties.Columns[i]; if (column.FieldName == le.Properties.DescriptionField) { columnPos = i; break; } } if (columnPos != -1) { if (ht.HitType == LookUpPopupHitType.Row) { if (ht.Index != prevRowIndex) { tt.HideHint(); prevRowIndex = ht.Index; } tt.ShowHint(dt.Rows[ht.Index][columnPos].ToString()); } } } base.CheckMouseCursor(ht); }
protected override void OnMouseHover(EventArgs e) { int newValue = GetValueUnderPoint(PointToClient(System.Windows.Forms.Cursor.Position).X); if (ToolTipController == null) { ToolTipController = new DevExpress.Utils.ToolTipController(); } ToolTipController.ShowHint((Math.Round((decimal)newValue / this.Properties.Increment) * this.Properties.Increment).ToString()); base.OnMouseHover(e); }
private void chartControl1_MouseMove(object sender, MouseEventArgs e) { ChartHitInfo hitInfo = chartControl1.CalcHitInfo(e.Location); StringBuilder builder = new StringBuilder(); if (hitInfo.SeriesPoint != null) { if (hitInfo.InSeries) { string SeriesName = ((Series)hitInfo.Series).Name; if (SeriesName == "Series 1") { decimal Values = Convert.ToDecimal(hitInfo.SeriesPoint.Values[0].ToString()); decimal precent = Math.Round((Values / sum1 * 100), 2); string str = "对应用户群菜品销量\n"; str += hitInfo.SeriesPoint.Argument.ToString(); str += ":"; str += hitInfo.SeriesPoint.Values[0].ToString(); str += "("; str += precent.ToString(); str += "%"; str += ")"; toolTipController.ShowHint(str, chartControl1.PointToScreen(e.Location)); } else if (SeriesName == "Series 2") { decimal Values = Convert.ToDecimal(hitInfo.SeriesPoint.Values[0].ToString()); decimal precent = Math.Round((Values / sum2 * 100), 2); string str = "顾客占比\n"; str += hitInfo.SeriesPoint.Argument.ToString(); str += ":"; str += hitInfo.SeriesPoint.Values[0].ToString(); str += "("; str += precent.ToString(); str += "%"; str += ")"; toolTipController.ShowHint(str, chartControl1.PointToScreen(e.Location)); } } } }
/// <summary> /// 为BaseEdit 提供即时消息提示; /// </summary> /// <typeparam name="T">泛型</typeparam> /// <param name="control">BaseEdit</param> /// <param name="tip">ToolTipController</param> /// <param name="message">消息</param> public static void PromptTimelyMessage <T>(this T control, ToolTipController tip, string message) where T : BaseEdit { if (control != null && tip != null) { control.MouseEnter += (object sender, EventArgs e) => { T _curControl = sender as T; tip.ShowHint(message, sender as T, ToolTipLocation.RightCenter); }; } }
/// <summary> /// 展现ToolTip /// </summary> /// <typeparam name="T">泛型</typeparam> /// <param name="t">控件</param> /// <param name="toolTip">ToolTipController</param> /// <param name="contnent">ToolTip内容</param> /// <param name="toolTipRule">委托</param> public static void ShowToolTip <T>(this T t, ToolTipController toolTip, string contnent, Action <ToolTipController> toolTipRule) where T : Control { toolTip.ShowBeak = true; toolTip.ShowShadow = true; toolTip.Rounded = true; toolTip.SetToolTipIconType(t, ToolTipIconType.Exclamation); if (toolTipRule != null) { toolTipRule(toolTip); } toolTip.ShowHint(contnent, t, ToolTipLocation.RightCenter); }
/// <summary> /// 自定义ChartControl的Tooltip /// </summary> /// <param name="chart">ChartControl</param> /// <param name="e">MouseEventArgs</param> /// <param name="tooltip">ToolTipController</param> /// <param name="tooltipTitle">ToolTipController的Title</param> /// <param name="paramter">委托</param> public static void CustomToolTip(this ChartControl chart, MouseEventArgs e, ToolTipController tooltip, string tooltipTitle, System.Func <string, double[], string> paramter) { ChartHitInfo _hitInfo = chart.CalcHitInfo(e.X, e.Y); SeriesPoint _point = _hitInfo.SeriesPoint; if (_point != null) { string _msg = paramter(_point.Argument, _point.Values); tooltip.ShowHint(_msg, tooltipTitle); } else { tooltip.HideHint(); } }
public void ShowHint(object editObject, Point location, IObjectSpace objectSpace, ToolTipController toolTipController) { if (Equals(editObject, _editObject)) return; _objectSpace = objectSpace; _editObject = editObject; var info = new ToolTipControlInfo(); var item = new ToolTipItem(); InitToolTipItem(item); item.ImageToTextDistance = 10; info.Object = DateTime.Now.Ticks; info.SuperTip = new SuperToolTip(); info.SuperTip.Items.Add(item); info.ToolTipPosition = parent.PointToScreen(location); toolTipController.ShowHint(info); _hintIsShown = true; }
public static void ShowError(DXErrorProvider errorProvider, BaseEdit control, ToolTipController tipController, string errorMessage) { control.Properties.Appearance.BorderColor = Color.Red; control.Focus(); control.SelectAll(); errorProvider.SetError(control, errorMessage); ToolTipControllerShowEventArgs args = new ToolTipControllerShowEventArgs(); args.ToolTipImage = DXErrorProvider.GetErrorIconInternal(ErrorType.Critical); args.ToolTip = control.ErrorText; args.SelectedControl = control; args.SuperTip = null; // here tipController.ShowHint(args, control.Parent.PointToScreen(control.Location)); }
/// <summary> /// 展现ToolTip /// </summary> /// <typeparam name="T">泛型</typeparam> /// <param name="control">控件</param> /// <param name="toolTip">ToolTipController</param> /// <param name="contnent">ToolTip内容</param> /// <param name="showTooltipFactory">委托</param> public static void ShowToolTip <T>(this T control, ToolTipController toolTip, string contnent, Action <ToolTipController> showTooltipFactory) where T : Control { toolTip.ShowBeak = true; toolTip.ShowShadow = true; toolTip.Rounded = true; toolTip.SetToolTipIconType(control, ToolTipIconType.Exclamation); if (showTooltipFactory != null) { showTooltipFactory(toolTip); } toolTip.ShowHint(contnent, control, ToolTipLocation.RightCenter); }
public static void ShowTooltip(ToolTipController tooltip, string msg, string title = "<b>Hướng dẫn</b>") { var targ = new ToolTipControllerShowEventArgs { Title = title, ToolTip = msg, ShowBeak = true, Rounded = true, RoundRadius = 7, ToolTipType = ToolTipType.SuperTip, IconType = ToolTipIconType.Information, IconSize = ToolTipIconSize.Small }; tooltip.ShowHint(targ); }
/// <summary> /// 展现ToolTip /// </summary> /// <param name="toolTip">ToolTipController</param> /// <param name="title">ToolTip标题</param> /// <param name="contnent">ToolTip内容</param> /// <param name="point">Point</param> /// <param name="toolTipRule">委托</param> public static void ShowToolTip(ToolTipController toolTip, string title, string content, Point point, Action <ToolTipController> toolTipRule) { ToolTipControllerShowEventArgs _args = toolTip.CreateShowArgs(); toolTip.ShowBeak = true; toolTip.ShowShadow = true; toolTip.Rounded = true; _args.Title = title; _args.ToolTip = content; _args.Rounded = true; _args.ToolTipType = ToolTipType.Default; if (toolTipRule != null) { toolTipRule(toolTip); } toolTip.ShowHint(_args, point); }
public static bool ValidarCampoVacio(ComboBoxEdit cmb, string mensaje, ToolTipController tooltip) { bool flag; if (string.IsNullOrEmpty(cmb.Text)) { tooltip.HideHint(); tooltip.ShowHint(mensaje, cmb, DevExpress.Utils.ToolTipLocation.LeftTop); flag = true; } else { flag = false; } return(flag); }
/// <summary> /// ChartControl的Tooltip设置 /// <para>举例</para> /// <code> /// <para> chartControl1.SetToolTip(toolTipController1, "交易详情", (agr, values) =></para> /// <para>{</para> /// <para> return string.Format("时间:{0}\r\n金额:{1}", agr, values[0]);</para> /// <para>});</para> /// </code> /// </summary> /// <param name="chart">ChartControl</param> /// <param name="tooltip">ToolTipController</param> /// <param name="tooltipTitle">ToolTip的Title</param> /// <param name="paramter">委托,参数『Argument,Values』</param> public static void SetToolTip(this ChartControl chart, ToolTipController tooltip, string tooltipTitle, System.Func <string, double[], string> paramter) { chart.MouseMove += (sender, e) => { ChartControl _curChart = sender as ChartControl; ChartHitInfo _hitInfo = _curChart.CalcHitInfo(e.X, e.Y); SeriesPoint _point = _hitInfo.SeriesPoint; if (_point != null) { string _msg = paramter(_point.Argument, _point.Values); tooltip.ShowHint(_msg, tooltipTitle); } else { tooltip.HideHint(); } }; }
public void ShowHint(object editObject, Point location) { if (object.Equals(editObject, this.editObject)) { return; } this.editObject = editObject; ToolTipControlInfo info = new ToolTipControlInfo(); ToolTipItem item = new ToolTipItem(); InitToolTipItem(item); item.ImageToTextDistance = 10; info.Object = DateTime.Now.Ticks; info.SuperTip = new SuperToolTip(); info.SuperTip.Items.Add(item); info.ToolTipPosition = this.parent.PointToScreen(location); controller.ShowHint(info); }
public void ShowHint(object editObject, Point location, IObjectSpace objectSpace, ToolTipController toolTipController) { if (Equals(editObject, _editObject)) { return; } _objectSpace = objectSpace; _editObject = editObject; var info = new ToolTipControlInfo(); var item = new ToolTipItem(); InitToolTipItem(item); item.ImageToTextDistance = 10; info.Object = DateTime.Now.Ticks; info.SuperTip = new SuperToolTip(); info.SuperTip.Items.Add(item); info.ToolTipPosition = _parent.PointToScreen(location); toolTipController.ShowHint(info); _hintIsShown = true; }
/// <summary> /// 设置RepositoryItem是否可编辑 /// </summary> /// <typeparam name="T"></typeparam> /// <typeparam name="TProperty">The type of the property.</typeparam> /// <param name="view">The view.</param> /// <param name="title">当不可编辑的时候,提示标题</param> /// <param name="content">当不可编辑的时候,提示内容</param> /// <param name="toolTip">ToolTipController.</param> /// <param name="keySelector">The key selector.</param> /// <param name="conditonHanlder">The conditon hanlder.</param> /// 创建时间:2015-05-26 13:48 /// 备注说明:<c>null</c> public static void ConditionRepositoryItemEdit <T, TProperty>(this GridView view, string title, string content, ToolTipController toolTip, Expression <Func <T, TProperty> > keySelector, Func <T, bool> conditonHanlder) where T : class { string _filedName = keySelector.GetTPropertyName <T, TProperty>(); view.ShowingEditor += (sender, e) => { GridView _curView = sender as GridView; if (_curView.FocusedColumn.FieldName.Equals(_filedName)) { T _item = (T)view.GetFocusedRow(); if (conditonHanlder(_item)) { e.Cancel = true; Point _mousePoint = Control.MousePosition; toolTip.ShowHint(content, title, _mousePoint); } } }; }
void ShowToolTip(IModelColumnTooltipData modelColumnTooltipData) { var toolTipControlInfo = new ToolTipControlInfo(); var item = new ToolTipItem { ImageToTextDistance = 0 }; var modelTooltipData = modelColumnTooltipData.TooltipData; if (modelTooltipData.DataOnToolTip) { var modelMember = modelColumnTooltipData.ModelMember; if (modelMember.MemberInfo.MemberType == typeof(Image)) { var image = modelMember.MemberInfo.GetValue(GridView.GetRow(HotTrackInfo.RowHandle)) as Image; if (modelTooltipData.MaxWidth > 0 && modelTooltipData.MaxHeight > 0) { image = image.CreateImage(modelTooltipData.MaxWidth, modelTooltipData.MaxHeight); } item.Image = image; } else { item.Text = string.Format("{0}", GridView.GetRowCellValue(HotTrackInfo.RowHandle, HotTrackInfo.Column)); } } else if (!string.IsNullOrEmpty(modelTooltipData.ToolTipText)) { item.Text = modelTooltipData.ToolTipText; } else { var controller = ObjectToolTipController(modelColumnTooltipData); controller.ShowHint(GridView.GetRow(HotTrackInfo.RowHandle), HotTrackInfo.HitPoint, ObjectSpace, _toolTipController); return; } toolTipControlInfo.Object = HotTrackInfo; toolTipControlInfo.SuperTip = new SuperToolTip(); toolTipControlInfo.SuperTip.Items.Add(item); toolTipControlInfo.ToolTipPosition = Cursor.Position; _toolTipController.ShowHint(toolTipControlInfo); }
/// <summary> /// ToolTip消息提示 /// </summary> /// <param name="title">标题</param> /// <param name="content">内容</param> /// <param name="showTime">显示时长</param> /// <param name="isAutoHide">自动隐藏</param> public static void NewToolTip(string title, string content, int showTime, bool isAutoHide) { try { MyToolTipClt = new ToolTipController(); args = MyToolTipClt.CreateShowArgs(); title = string.IsNullOrEmpty(title) ? "温馨提示" : title; args.AutoHide = isAutoHide; MyToolTipClt.ShowBeak = true; MyToolTipClt.ShowShadow = true; MyToolTipClt.Rounded = true; MyToolTipClt.AutoPopDelay = (showTime == 0 ? 2000 : showTime); MyToolTipClt.Active = true; MyToolTipClt.HideHint(); MyToolTipClt.ShowHint(content, title, Control.MousePosition); } catch (Exception ex) { throw ex; } }
public static void MostrarMensajeCampoVacio(TextEdit txt, string mensaje, ToolTipController tooltip) { tooltip.HideHint(); tooltip.ShowHint(mensaje, txt, DevExpress.Utils.ToolTipLocation.LeftTop); }
/// <summary> /// 展现ToolTip /// </summary> /// <param name="toolTip">ToolTipController</param> /// <param name="title">ToolTip标题</param> /// <param name="content">ToolTip内容</param> public static void ShowToolTip(this ToolTipController toolTip, string title, string content) { Point _mousePoint = Control.MousePosition; toolTip.ShowHint(content, title, _mousePoint); }
public static bool ValidarCampoVacio(ComboBoxEdit cmb, string mensaje, ToolTipController tooltip) { bool flag; if (string.IsNullOrEmpty(cmb.Text)) { tooltip.HideHint(); tooltip.ShowHint(mensaje, cmb, DevExpress.Utils.ToolTipLocation.LeftTop); flag = true; } else { flag = false; } return flag; }
public static void MostrarMensajeCampoVacio(TextEdit txt, string mensaje, ToolTipController tooltip) { tooltip.HideHint(); tooltip.ShowHint(mensaje, txt, DevExpress.Utils.ToolTipLocation.LeftTop); }
private void Show(string toolTip, Control control, ToolTipLocation toolTipLocation, int duration) { f_ToolTipControler.AutoPopDelay = 2000; f_ToolTipControler.ShowHint(toolTip, control, toolTipLocation); }
private void _MouseMove(object sender, MouseEventArgs e) { ChartControl chartControl_current = null; ChartHitInfo hitInfo = null; foreach (Control c in xtraTabControl1.TabPages) { if (c is XtraTabPage && ((XtraTabPage)c).Name == "xtraTabPage3") { foreach (Control b in c.Controls) { if (b is ChartControl && ((ChartControl)b).Equals(sender)) { chartControl_current = ((ChartControl)b); hitInfo = chartControl_current.CalcHitInfo(e.Location); } } } } foreach (Control c in xtraTabControl1.TabPages) { if (c is XtraTabPage && ((XtraTabPage)c).Name == "limitAverageXTP") { foreach (Control b in c.Controls) { if (b is ChartControl && ((ChartControl)b).Equals(sender)) { chartControl_current = ((ChartControl)b); hitInfo = chartControl_current.CalcHitInfo(e.Location); } } } } if (hitInfo == null) { return; } StringBuilder builder = new StringBuilder(); if (hitInfo.InDiagram) { builder.AppendLine("In diagram"); } if (hitInfo.InNonDefaultPane) { builder.AppendLine("In non-default pane: " + hitInfo.NonDefaultPane.Name); } if (hitInfo.InAxis) { builder.AppendLine("In axis: " + hitInfo.Axis.Name); if (hitInfo.AxisLabelItem != null) { builder.AppendLine(" Label item: " + hitInfo.AxisLabelItem.Text); } if (hitInfo.AxisTitle != null) { builder.AppendLine(" Axis title: " + hitInfo.AxisTitle.Text); } } if (hitInfo.InChartTitle) { builder.AppendLine("In chart title: " + hitInfo.ChartTitle.Text); } if (hitInfo.InLegend) { builder.AppendLine("In legend"); } if (hitInfo.InSeries) { builder.AppendLine("In series: " + ((Series)hitInfo.Series).Name); } if (hitInfo.InSeriesLabel) { builder.AppendLine("In series label"); builder.AppendLine(" Series: " + ((Series)hitInfo.Series).Name); } if (hitInfo.SeriesPoint != null) { builder.AppendLine(" Argument: " + hitInfo.SeriesPoint.Argument); if (!hitInfo.SeriesPoint.IsEmpty) { builder.AppendLine(" Value: " + hitInfo.SeriesPoint.Values[0]); } } if (builder.Length > 0) { toolTipController.ShowHint("AIO-testing results:\n" + builder.ToString(), chartControl_current.PointToScreen(e.Location)); } else { toolTipController.HideHint(); } }
static void ShowColumnTooltip(GridColumn column, ToolTipControllerShowEventArgs args) { var view = column.View; var viewInfo = (GridViewInfo)view.GetViewInfo(); args.ToolTipLocation = ToolTipLocation.TopRight; args.SelectedControl = view.GridControl; var controller = new ToolTipController(); controller.ShowHint(args, view.GridControl.PointToScreen(viewInfo.ColumnsInfo[column].Bounds.Location)); }
public static void ShowError(DXErrorProvider errorProvider, BaseEdit control, ToolTipController tipController, string errorMessage) { control.Properties.Appearance.BorderColor = Color.Red; control.Focus(); control.SelectAll(); errorProvider.SetError(control, errorMessage); ToolTipControllerShowEventArgs args = new ToolTipControllerShowEventArgs(); args.ToolTipImage = DXErrorProvider.GetErrorIconInternal(ErrorType.Critical); args.ToolTip = control.ErrorText; args.SelectedControl = control; args.SuperTip = null; // here tipController.ShowHint(args, control.Parent.PointToScreen(control.Location)); }