Exemplo n.º 1
0
        public override void PaintKeyTips(KeyTipsRendererEventArgs e)
        {
            Rectangle r = e.Bounds;
            Color borderColor = m_ColorTable.KeyTips.KeyTipBorder;
            Color textColor = m_ColorTable.KeyTips.KeyTipText;
            Color backColor = m_ColorTable.KeyTips.KeyTipBackground;
            
            if (e.ReferenceObject is BaseItem && !((BaseItem)e.ReferenceObject).Enabled)
            {
                int alpha = 128;
                backColor = Color.FromArgb(alpha, backColor);
                textColor = Color.FromArgb(alpha, textColor);
                borderColor = Color.FromArgb(alpha, borderColor);
            }

            Graphics g = e.Graphics;
            string keyTip = e.KeyTip;
            Font font = e.Font;

            using (SolidBrush brush = new SolidBrush(backColor))
                DisplayHelp.FillRoundedRectangle(g, brush, r, 2);
            using (Pen pen = new Pen(textColor, 1))
                DisplayHelp.DrawRoundedRectangle(g, pen, r, 2);
            TextDrawing.DrawString(g, keyTip, font, textColor, r, eTextFormat.HorizontalCenter | eTextFormat.VerticalCenter);
        }
Exemplo n.º 2
0
        //internal override bool MenuFocus
        //{
        //    get
        //    {
        //        return base.MenuFocus;
        //    }
        //    set
        //    {
        //        if (this.MenuFocus != value)
        //        {
        //            if (m_CaptionVisible && (m_CaptionContainer.GetHotSubItem() != null || m_CaptionContainer.ExpandedItem()!=null))
        //            {
        //                if (value)
        //                {
        //                    SetMenuFocus(value);
        //                    m_CaptionContainer.SetSystemFocus();
        //                    SetupActiveWindowTimer();
        //                    this.Refresh();
        //                }
        //                else
        //                {
        //                    ReleaseActiveWindowTimer();
        //                    m_CaptionContainer.AutoExpand = false;
        //                    m_CaptionContainer.ReleaseSystemFocus();
        //                    m_CaptionContainer.ContainerLostFocus();
        //                    base.MenuFocus = value;
        //                }
        //            }
        //            else
        //                base.MenuFocus = value;
        //        }
        //    }
        //}

        protected override void PaintKeyTips(Graphics g)
        {
            if (!this.ShowKeyTips)
                return;

            KeyTipsRendererEventArgs e = new KeyTipsRendererEventArgs(g, Rectangle.Empty, "", GetKeyTipFont(), null);

            Rendering.BaseRenderer renderer = GetRenderer();
            PaintContainerKeyTips(m_StripContainer.RibbonStripContainer, renderer, e);
            if (m_CaptionVisible)
                PaintContainerKeyTips(m_StripContainer.CaptionContainer, renderer, e);
        }
Exemplo n.º 3
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.º 4
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);
        }
Exemplo n.º 5
0
        internal virtual void PaintContainerKeyTips(BaseItem container, Rendering.BaseRenderer renderer, KeyTipsRendererEventArgs e)
        {
            foreach (BaseItem item in container.SubItems)
            {
                PaintItemKeyTip(item, renderer, e);
            }

            CaptionItemContainer gc = container as CaptionItemContainer;
            if (gc != null && gc.MoreItems != null && gc.MoreItems.Visible)
            {
                PaintItemKeyTip(gc.MoreItems, renderer, e);
            }
        }
Exemplo n.º 6
0
        protected virtual void PaintKeyTips(Graphics g)
        {
            if (!m_ShowKeyTips)
                return;

            KeyTipsRendererEventArgs e = new KeyTipsRendererEventArgs(g, Rectangle.Empty, "", GetKeyTipFont(), null);
            
            Rendering.BaseRenderer renderer = GetRenderer();
            PaintContainerKeyTips(m_BaseItemContainer, renderer, e);
        }
Exemplo n.º 7
0
 public abstract void PaintKeyTips(KeyTipsRendererEventArgs e);