Exemplo n.º 1
0
        internal override void PaintContainerKeyTips(BaseItem container, Rendering.BaseRenderer renderer, KeyTipsRendererEventArgs e)
        {
            base.PaintContainerKeyTips(container, renderer, e);

            if (this.DialogLauncherVisible && this.DialogLauncherKeyTip != "")
            {
                string stack = ((IKeyTipsControl)this).KeyTipsKeysStack;
                string keyTip = this.DialogLauncherKeyTip;
                if (stack != "" && !keyTip.StartsWith(stack))
                    return;
                e.ReferenceObject = this;
                e.KeyTip = keyTip;

                Size padding = KeyTipsPainter.KeyTipsPadding;
                Size size = TextDrawing.MeasureString(e.Graphics, keyTip, e.Font);
                size.Width += padding.Width;
                size.Height += padding.Height;
                Rectangle r = new Rectangle(this.Width - size.Width, this.Height + 4, size.Width, size.Height);
                e.Bounds = r;
                renderer.DrawKeyTips(e);
            }
        }
Exemplo n.º 2
0
        private void PaintItemKeyTip(BaseItem item, Rendering.BaseRenderer renderer, KeyTipsRendererEventArgs e)
        {
            if (!item.Visible || !item.Displayed)
                return;

            if (item.IsContainer)
                PaintContainerKeyTips(item, renderer, e);

            if (item.AccessKey == Char.MinValue && item.KeyTips == "" || m_KeyTipsKeysStack != "" && !item.KeyTips.StartsWith(m_KeyTipsKeysStack)
                || item.KeyTips == "" && m_KeyTipsKeysStack != "")
                return;

            if (item.KeyTips != "")
                e.KeyTip = item.KeyTips;
            else
                e.KeyTip = item.AccessKey.ToString().ToUpper();

            e.Bounds = GetKeyTipRectangle(e.Graphics, item, e.Font, e.KeyTip);
            e.ReferenceObject = item;

            renderer.DrawKeyTips(e);
        }