示例#1
0
        private void ShowMessage(string title, string message, ToolTipIconType icon)
        {
            if (this.isDisposed)
            {
                return;
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new ShowMessageDelegate(this.ShowMessage), title, message, icon);
            }
            else
            {
                var show = DevExpress.Utils.ToolTipController.DefaultController.CreateShowArgs();
                show.Title           = title;
                show.ToolTip         = message;
                show.ToolTipType     = ToolTipType.SuperTip;
                show.IconType        = icon;
                show.IconSize        = ToolTipIconSize.Large;
                show.ToolTipLocation = ToolTipLocation.LeftTop;
                show.AutoHide        = false;
                DevExpress.Utils.ToolTipController.DefaultController.ShowHint(show, this.codeEditor);

                this.AddInformationLine(message);
            }
        }
示例#2
0
        public ToolTipIconType GetIconType(Control control)
        {
            ToolTipIconType type = ToolTipIconType.None;

            if (this.m_controls.Contains(control))
            {
                type = ((ToolTipInfo)this.m_controls[control]).IconType;
            }
            return(type);
        }
示例#3
0
 public ChartControlToolTipHelperBase(ChartControl chart, bool useInitialDelay, ToolTipIconType iconType, DefaultBoolean allowHtmlText)
 {
     if (null == chart)
     {
         throw new ArgumentNullException("chart");
     }
     fChart           = chart;
     fUseInitialDelay = useInitialDelay;
     fIconType        = iconType;
     fAllowHtmlText   = allowHtmlText;
 }
示例#4
0
        public virtual void SetIconType(Control control, ToolTipIconType type)
        {
            bool bNewControl;

            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            bNewControl = !m_controls.ContainsKey(control);

            if (bNewControl)
            {
                if (type != ToolTipIconType.None)
                {
                    var info = new ToolTipInfo("", "", type);
                    m_controls.Add(control, info);
                    control.HandleCreated   += HandleCreated;
                    control.HandleDestroyed += HandleDestroyed;
                    if (control.IsHandleCreated)
                    {
                        HandleCreated(control, EventArgs.Empty);
                    }
                }
            }
            else
            {
                var info = (ToolTipInfo)m_controls[control];
                info.IconType = type;
                if (info.TipText.Length == 0 && info.TipTitle.Length == 0 && info.IconType == ToolTipIconType.None)
                {
                    // Remove the control.
                    m_controls.Remove(control);
                    // unhook events
                    control.HandleCreated   -= HandleCreated;
                    control.HandleDestroyed -= HandleDestroyed;

                    if (m_addedList.Contains(control))
                    {
                        DestroyRegion(control);
                        m_addedList.Remove(control);
                    }
                }
            }
        }
示例#5
0
 public ChartControlToolTipHelper(ChartControl chart, bool useInitialDelay, ToolTipIconType iconType, DefaultBoolean allowHtmlText)
     : base(chart, useInitialDelay, iconType, allowHtmlText)
 {
 }
示例#6
0
 public ChartControlToolTipHelperBase(ChartControl chart, bool useInitialDelay, ToolTipIconType iconType)
     : this(chart, useInitialDelay, iconType, DefaultBoolean.Default)
 {
 }
 /// <summary>
 /// Determines whether the specified tooltip has tooltip.
 /// </summary>
 /// <typeparam name="TProperty">The type of the property.</typeparam>
 /// <typeparam name="TClassType">The type of the type.</typeparam>
 /// <param name="builder">The builder.</param>
 /// <param name="toolTipIconType">The tooltip.</param>
 /// <returns></returns>
 public static IPropertyBuilder <TProperty?, TClassType> HasTooltipIconType <TProperty, TClassType>(this IPropertyBuilder <TProperty?, TClassType> builder, ToolTipIconType toolTipIconType)
 => builder.WithModelDefault("ToolTipIconType", toolTipIconType.ToString());
示例#8
0
 public ToolTipInfo(string text,string title,ToolTipIconType icon)
 {
     m_tooltip = text;
     m_title = title;
     m_iconType = icon;
 }
示例#9
0
        public void SetIconType(Control control,ToolTipIconType type)
        {
            bool bNewControl;

            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            bNewControl = !m_controls.ContainsKey(control);

            if (bNewControl)
            {
                if (type != ToolTipIconType.None)
                {
                    ToolTipInfo info = new ToolTipInfo("","",type);
                    m_controls.Add(control,info);
                    control.HandleCreated += new EventHandler(HandleCreated);
                    control.HandleDestroyed += new EventHandler(HandleDestroyed);
                    if (control.IsHandleCreated)
                    {
                        this.HandleCreated(control,EventArgs.Empty);
                    }
                }
            }
            else
            {
                ToolTipInfo info = (ToolTipInfo)m_controls[control];
                info.IconType = type;
                if (info.TipText.Length == 0 && info.TipTitle.Length == 0 && info.IconType == ToolTipIconType.None)
                {
                    m_controls.Remove(control);
                    control.HandleCreated -= new EventHandler(HandleCreated);
                    control.HandleDestroyed -= new EventHandler(HandleDestroyed);

                    if (m_addedList.Contains(control))
                    {
                        DestroyRegion(control);
                        m_addedList.Remove(control);
                    }
                }
            }
        }
示例#10
0
 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);
     }
 }
示例#11
0
 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);
 }
示例#12
0
 public ToolTipInfo(string text, string title, ToolTipIconType icon)
 {
     m_tooltip  = text;
     m_title    = title;
     m_iconType = icon;
 }
示例#13
0
 /// <summary>
 /// Initializes a new instance of the ToolTipInfo class.
 /// </summary>
 /// <param name="text">ToolTip text</param>
 /// <param name="title">ToolTip title</param>
 /// <param name="icon">ToolTip icon type</param>
 public ToolTipInfo(string text, string title, ToolTipIconType icon)
 {
     TipText  = text;
     TipTitle = title;
     IconType = icon;
 }
示例#14
0
 public ChartControlToolTipHelper(ChartControl chart, bool useInitialDelay, ToolTipIconType iconType)
     : base(chart, useInitialDelay, iconType)
 {
 }
示例#15
0
 /// <summary>
 /// Initializes a new instance of the ToolTipInfo class.
 /// </summary>
 /// <param name="text">ToolTip text</param>
 /// <param name="title">ToolTip title</param>
 /// <param name="icon">ToolTip icon type</param>
 public ToolTipInfo(string text, string title, ToolTipIconType icon)
 {
     TipText = text;
     TipTitle = title;
     IconType = icon;
 }
示例#16
0
 private void SetToolTip(Control control, ToolTipIconType ttIconType, string title, string text)
 {
     toolTip.SetIconType(control, ttIconType);
     toolTip.SetTipTitle(control, title);
     toolTip.SetToolTip(control, text);
 }
示例#17
0
 public void SetToolTip(Control control, string message, ToolTipIconType type)
 {
     ToolTipperManager.SetToolTip(control, message.ToUpper());
     ToolTipperManager.SetToolTipIconType(control, type);
 }