예제 #1
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;
            }
        }
예제 #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;
            }
        }