Exemplo n.º 1
0
        /// <summary>
        /// Close this Control's tool tip.
        /// </summary>
        /// <owner alias="HillaryM" />
        internal virtual void CloseToolTip()
        {
            if (!CUIUtility.IsNullOrUndefined(_root))
            {
                // clear launching timer
                Browser.Window.ClearInterval(_root.TooltipLauncherTimer);
            }
            
            if (!CUIUtility.IsNullOrUndefined(_toolTip))
            {
                _toolTip.Hide();

                _toolTipLaunched = false;
                OnToolTipClosed();
                
                // Remove the tooltip floating div from the DOM            
                UIUtility.RemoveNode(_toolTip.ElementInternal);
                _toolTip = null;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Launch this Control's ToolTip.
        /// </summary>        
        /// <owner alias="HillaryM" />
        protected void LaunchToolTip()
        {
            if (CUIUtility.IsNullOrUndefined(Root))
            {
                return;
            }

            // clear the tooltip launching timer
            Browser.Window.ClearInterval(Root.TooltipLauncherTimer);
            
            // If the tooltip is already launched, don't launch it twice            
            if (_toolTipLaunched)
                return;

            // if there is currently an open tooltip and it was not launched by this control, close it
            if ((!CUIUtility.IsNullOrUndefined(Root.TooltipLauncher)) &&
                    (Root.TooltipLauncher.Id != this.Id)) 
            {
                Root.CloseOpenTootips();
            }

            // If there is no ToolTip title, we don't launch the ToolTip
            if (string.IsNullOrEmpty(_properties.ToolTipTitle))
                return;

            _toolTip = new ToolTip(Root, Id + "_ToolTip", _properties.ToolTipTitle, _properties.ToolTipDescription, _properties);
                        
            if (!Enabled)
            {
                // Show message indicating that the control is disabled and give reason.               
                DisabledCommandInfoProperties disabledInfo = new DisabledCommandInfoProperties();
                disabledInfo.Icon = Root.Properties.ToolTipDisabledCommandImage16by16;
                disabledInfo.IconClass = Root.Properties.ToolTipDisabledCommandImage16by16Class;
                disabledInfo.IconTop = Root.Properties.ToolTipDisabledCommandImage16by16Top;
                disabledInfo.IconLeft = Root.Properties.ToolTipDisabledCommandImage16by16Left;
                disabledInfo.Title = Root.Properties.ToolTipDisabledCommandTitle;
                disabledInfo.Description = Root.Properties.ToolTipDisabledCommandDescription;
                disabledInfo.HelpKeyWord = Root.Properties.ToolTipDisabledCommandHelpKey;
                _toolTip.DisabledCommandInfo = disabledInfo;
            }

            ControlComponent comp = DisplayedComponent;

            if (!CUIUtility.IsNullOrUndefined(comp))
            {
                comp.EnsureChildren();
                comp.AddChild(_toolTip);
                _toolTip.Display();
                _toolTipLaunched = true;
                Root.TooltipLauncher = this;
                OnToolTipOpenned();
            }
            else
            {
                _toolTip = null;
            }
        }