Exemplo n.º 1
0
        private void CreateLinkButton(BackstageViewPage page, bool haschild = false, bool child = false)
        {
            if (!page.Show)
            {
                return;
            }

            string label       = page.LinkText;
            int    heightextra = 0;

            if (haschild)
            {
                label = ">> " + label;
            }
            if (child)
            {
                int count = label.Split('\n').Count();
                label       = "      " + label.Replace("\n", "\n      ");
                heightextra = 15 * (count - 1);
            }

            var lnkButton = new BackstageViewButton
            {
                Text = label,
                Tag  = page,
                Top  = ButtonTopPos,
                // Top = _items.TakeWhile(i => i != page).Sum(i => i.Spacing),
                Width               = this.pnlMenu.Width,
                Height              = ButtonHeight + heightextra,
                ContentPageColor    = this.BackColor,
                PencilBorderColor   = _buttonsAreaPencilColor,
                SelectedTextColor   = _selectedTextColor,
                UnSelectedTextColor = _unSelectedTextColor,
                HighlightColor1     = _highlightColor1,
                HighlightColor2     = _highlightColor2,
                //Dock = DockStyle.Bottom
            };

            pnlMenu.Controls.Add(lnkButton);
            lnkButton.Click       += this.ButtonClick;
            lnkButton.DoubleClick += lnkButton_DoubleClick;

            ButtonTopPos += lnkButton.Height;
            pnlMenu.Invalidate();
        }
Exemplo n.º 2
0
        private void CreateLinkButton(BackstageViewPage page, bool haschild = false, bool child = false)
        {
            string label = page.LinkText;

            if (haschild)
            {
                label = ">> " + label;
            }
            if (child)
            {
                label = "      " + label;
            }

            var lnkButton = new BackstageViewButton
            {
                Text = label,
                Tag  = page,
                Top  = ButtonTopPos,
                // Top = _items.TakeWhile(i => i != page).Sum(i => i.Spacing),
                Width               = this.pnlMenu.Width,
                Height              = ButtonHeight,
                ContentPageColor    = this.BackColor,
                PencilBorderColor   = _buttonsAreaPencilColor,
                SelectedTextColor   = _selectedTextColor,
                UnSelectedTextColor = _unSelectedTextColor,
                HighlightColor1     = _highlightColor1,
                HighlightColor2     = _highlightColor2,
                //Dock = DockStyle.Bottom
            };

            pnlMenu.Controls.Add(lnkButton);
            lnkButton.Click       += this.ButtonClick;
            lnkButton.DoubleClick += lnkButton_DoubleClick;

            ButtonTopPos += lnkButton.Height;
        }
Exemplo n.º 3
0
        private void CreateLinkButton(BackstageViewPage page, bool haschild = false, bool child = false)
        {
            if (!page.Show)
                return;

            string label = page.LinkText;
            int heightextra = 0;

            if (haschild)
            {
                label = ">> " + label;
            }
            if (child)
            {
                int count = label.Split('\n').Count();
                label = "      " + label.Replace("\n", "\n      ");
                heightextra = 15 * (count - 1);
            }

            var lnkButton = new BackstageViewButton
                                {
                                    Text = label,
                                    Tag = page,
                                    Top = ButtonTopPos,
                                    // Top = _items.TakeWhile(i => i != page).Sum(i => i.Spacing),
                                    Width = this.pnlMenu.Width,
                                    Height = ButtonHeight + heightextra,
                                    ContentPageColor = this.BackColor,
                                    PencilBorderColor = _buttonsAreaPencilColor,
                                    SelectedTextColor = _selectedTextColor,
                                    UnSelectedTextColor = _unSelectedTextColor,
                                    HighlightColor1 = _highlightColor1,
                                    HighlightColor2 = _highlightColor2,
                                    //Dock = DockStyle.Bottom
                                };

            pnlMenu.Controls.Add(lnkButton);
            lnkButton.Click += this.ButtonClick;
            lnkButton.DoubleClick += lnkButton_DoubleClick;

            ButtonTopPos += lnkButton.Height;
        }