コード例 #1
0
        private void InitializePanel()
        {
            Text = text;
            ButtonMoreVisible = false;
            FlowsTo = RibbonPanelFlowDirection.Right;

            var g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new HintJustifyLeft());
            RibbonHelper.AddButton(g, new HintJustifyCenter());
            RibbonHelper.AddButton(g, new HintJustifyRight());
            RibbonHelper.AddButton(g, new HintJustifyFull());
            CommandManager.Instance.GetCommand(CommandNames.HintJustifyLeft).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintJustifyCenter).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintJustifyRight).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintJustifyFull).Enabled = true;
            RibbonHelper.AddGroup(this, g);

            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new HintOutdent());
            RibbonHelper.AddButton(g, new HintIndent());
            CommandManager.Instance.GetCommand(CommandNames.HintOutdent).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintIndent).Enabled = true;
            RibbonHelper.AddGroup(this, g);

            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new HintUnorderedList());
            RibbonHelper.AddButton(g, new HintOrderedList());
            CommandManager.Instance.GetCommand(CommandNames.HintUnorderedList).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintOrderedList).Enabled = true;
            RibbonHelper.AddGroup(this, g);
        }
コード例 #2
0
        private void InitializePanel()
        {
            Text = text;
            ButtonMoreVisible = false;
            FlowsTo = RibbonPanelFlowDirection.Bottom;

            var g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new HorizontalRule());
            RibbonHelper.AddButton(g, new Break());
            RibbonHelper.AddGroup(this, g);
        }
コード例 #3
0
        private void InitializePanel()
        {
            Text = text;
            ButtonMoreVisible = true;
            FlowsTo = RibbonPanelFlowDirection.Right;

            var g = new RibbonItemGroup
                        {
                            DrawBackground = false
                        };
            var cb = RibbonHelper.AddComboBox(g, new HintFontName(), typeof(HintFontNameComboBox));
            cb.TextBoxWidth = 130;
            cb = RibbonHelper.AddComboBox(g, new HintFontSize(), typeof(HintFontSizeComboBox));
            cb.TextBoxWidth = 50;
            CommandManager.Instance.GetCommand(CommandNames.HintFontName).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintFontSize).Enabled = true;
            RibbonHelper.AddGroup(this, g);
            
            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new HintRemoveFormat());
            CommandManager.Instance.GetCommand(CommandNames.HintRemoveFormat).Enabled = true;
            RibbonHelper.AddGroup(this, g);
            
            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new HintFontSizeUp());
            RibbonHelper.AddButton(g, new HintFontSizeDown());
            //CommandManager.Instance.GetCommand(CommandNames.HintFontSizeUp).Enabled = true;
            //CommandManager.Instance.GetCommand(CommandNames.HintFontSizeDown).Enabled = true;
            RibbonHelper.AddGroup(this, g);

            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new HintBackColor());
            RibbonHelper.AddButton(g, new HintForeColor());
            CommandManager.Instance.GetCommand(CommandNames.HintBackColor).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintForeColor).Enabled = true;
            RibbonHelper.AddGroup(this, g);

            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new HintBold());
            RibbonHelper.AddButton(g, new HintItalic());
            RibbonHelper.AddButton(g, new HintUnderline());
            RibbonHelper.AddButton(g, new HintStrikeThrough());
            RibbonHelper.AddButton(g, new HintInferior());
            RibbonHelper.AddButton(g, new HintAscender());
            CommandManager.Instance.GetCommand(CommandNames.HintBold).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintItalic).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintUnderline).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintStrikeThrough).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintInferior).Enabled = true;
            CommandManager.Instance.GetCommand(CommandNames.HintAscender).Enabled = true;
            RibbonHelper.AddGroup(this, g);

            ButtonMoreClick += FontPanel_ButtonMoreClick;
        }
コード例 #4
0
        private void InitializePanel()
        {
            Text = text;
            ButtonMoreVisible = true;
            FlowsTo = RibbonPanelFlowDirection.Right;

            var g = new RibbonItemGroup
                        {
                            DrawBackground = false
                        };
            var t = typeof(FontNameComboBox);
            var cb = RibbonHelper.AddComboBox(g, new FontName(), t);
            cb.TextBoxWidth = 130;
            t = typeof(FontSizeComboBox);
            cb = RibbonHelper.AddComboBox(g, new FontSize(), t);
            cb.TextBoxWidth = 50;
            RibbonHelper.AddGroup(this, g);

            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new RemoveFormat());
            RibbonHelper.AddGroup(this, g);

            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new FontSizeUp());
            RibbonHelper.AddButton(g, new FontSizeDown());
            RibbonHelper.AddGroup(this, g);

            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new BackColor());
            RibbonHelper.AddButton(g, new ForeColor());
            RibbonHelper.AddGroup(this, g);

            g = new RibbonItemGroup();
            RibbonHelper.AddButton(g, new Bold());
            RibbonHelper.AddButton(g, new Italic());
            RibbonHelper.AddButton(g, new Underline());
            RibbonHelper.AddButton(g, new StrikeThrough());
            RibbonHelper.AddButton(g, new Inferior());
            RibbonHelper.AddButton(g, new Ascender());
            RibbonHelper.AddGroup(this, g);

            ButtonMoreEnabled = false;
            ButtonMoreClick += FontPanel_ButtonMoreClick;
        }
コード例 #5
0
        /// <summary>
        /// Draws the background of the specified  RibbonItemGroup
        /// </summary>
        /// <param name="e"></param>
        /// <param name="?"></param>
        public void DrawItemGroupBorder(RibbonItemRenderEventArgs e, RibbonItemGroup grp)
        {
            var outerR = Rectangle.FromLTRB(
                grp.Bounds.Left,
                grp.Bounds.Top,
                grp.Bounds.Right - 1,
                grp.Bounds.Bottom - 1);

            var innerR = Rectangle.FromLTRB(
                outerR.Left + 1,
                outerR.Top + 1,
                outerR.Right - 1,
                outerR.Bottom - 1);

            var outer = RoundRectangle(outerR, 2);
            var inner = RoundRectangle(innerR, 2);

            using (var dark = new Pen(ColorTable.ItemGroupSeparatorDark))
            {
                using (var light = new Pen(ColorTable.ItemGroupSeparatorLight))
                {
                    foreach (var item in grp.Items)
                    {
                        if (item == grp.LastItem) break;

                        e.Graphics.DrawLine(dark,
                                            new Point(item.Bounds.Right, item.Bounds.Top),
                                            new Point(item.Bounds.Right, item.Bounds.Bottom));

                        e.Graphics.DrawLine(light,
                                            new Point(item.Bounds.Right + 1, item.Bounds.Top),
                                            new Point(item.Bounds.Right + 1, item.Bounds.Bottom));
                    }
                }
            }

            using (var p = new Pen(ColorTable.ItemGroupOuterBorder))
            {
                e.Graphics.DrawPath(p, outer);
            }

            using (var p = new Pen(ColorTable.ItemGroupInnerBorder))
            {
                e.Graphics.DrawPath(p, inner);
            }

            outer.Dispose();
            inner.Dispose();
        }
コード例 #6
0
        /// <summary>
        /// Draws the background of the specified  RibbonItemGroup
        /// </summary>
        /// <param name="e"></param>
        /// <param name="?"></param>
        public void DrawItemGroup(RibbonItemRenderEventArgs e, RibbonItemGroup grp)
        {
            var outerR = Rectangle.FromLTRB(
                grp.Bounds.Left,
                grp.Bounds.Top,
                grp.Bounds.Right - 1,
                grp.Bounds.Bottom - 1);

            var innerR = Rectangle.FromLTRB(
                outerR.Left + 1,
                outerR.Top + 1,
                outerR.Right - 1,
                outerR.Bottom - 1);

            var glossyR = Rectangle.FromLTRB(
                outerR.Left + 1,
                outerR.Top + outerR.Height / 2 + 1,
                outerR.Right - 1,
                outerR.Bottom - 1);

            var outer = RoundRectangle(outerR, 2);
            var inner = RoundRectangle(innerR, 2);
            var glossy = RoundRectangle(glossyR, 2);

            using (var b = new LinearGradientBrush(
                innerR, ColorTable.ItemGroupBgNorth, ColorTable.ItemGroupBgSouth, 90))
            {
                e.Graphics.FillPath(b, inner);
            }

            using (var b = new LinearGradientBrush(
                glossyR, ColorTable.ItemGroupBgGlossy, Color.Transparent, 90))
            {
                e.Graphics.FillPath(b, glossy);
            }

            outer.Dispose();
            inner.Dispose();
        }
 /// <param name="ownerGroup">Group that this collection belongs to</param>
 internal RibbonItemGroupItemCollection(RibbonItemGroup ownerGroup)
 {
     _ownerGroup = ownerGroup;
 }