Ejemplo n.º 1
0
        protected override void CreateChildItems(RadElement parent)
        {
            this.panelBarElement = new RadPanelBarElement();
            parent.Children.Add(this.panelBarElement);
            this.panelBarElement.CaptionChanged               += delegate(object sender, EventArgs args) { OnCaptionChanged(args); };
            this.panelBarElement.BottomOffsetChanged          += delegate(object sender, EventArgs args) { OnBottomOffsetChanged(args); };
            this.panelBarElement.TopOffsetChanged             += delegate(object sender, EventArgs args) { OnTopOffsetChanged(args); };
            this.panelBarElement.LeftOffsetChanged            += delegate(object sender, EventArgs args) { OnLeftOffsetChanged(args); };
            this.panelBarElement.RightOffsetChanged           += delegate(object sender, EventArgs args) { OnRightOffsetChanged(args); };
            this.panelBarElement.SpacingBetweenColumnsChanged += delegate(object sender, EventArgs args) { OnSpacingBetweenColumnsChanged(args); };
            this.panelBarElement.SpacingBetweenItemsChanged   += delegate(object sender, EventArgs args) { OnSpacingBetweenItemsChanged(args); };
            this.panelBarElement.SpacingBetweenGroupsChanged  += delegate(object sender, EventArgs args) { OnSpacingBetweenGroupsChanged(args); };
            this.panelBarElement.NumberOfColumnsChanged       += delegate(object sender, EventArgs args) { OnNumberOfColumnsChanged(args); };
            this.panelBarElement.PanelBarStyleChanged         += delegate(object sender, EventArgs args) { OnPanelBarStyleChanged(args); };

            this.panelBarElement.PanelBarGroupCollapsed   += delegate(object sender, PanelBarGroupEventArgs args) { OnPanelBarGroupCollapsed(args); };
            this.panelBarElement.PanelBarGroupExpanded    += delegate(object sender, PanelBarGroupEventArgs args) { OnPanelBarGroupExpanded(args); };
            this.panelBarElement.PanelBarGroupExpanding   += delegate(object sender, PanelBarGroupCancelEventArgs args) { OnPanelBarGroupExpanding(args); };
            this.panelBarElement.PanelBarGroupCollapsing  += delegate(object sender, PanelBarGroupCancelEventArgs args) { OnPanelBarGroupCollapsing(args); };
            this.panelBarElement.PanelBarGroupUnSelected  += delegate(object sender, PanelBarGroupEventArgs args) { OnPanelBarGroupUnSelected(args); };
            this.panelBarElement.PanelBarGroupSelected    += delegate(object sender, PanelBarGroupEventArgs args) { OnPanelBarGroupSelected(args); };
            this.panelBarElement.PanelBarGroupSelecting   += delegate(object sender, PanelBarGroupCancelEventArgs args) { OnPanelBarGroupSelecting(args); };
            this.panelBarElement.PanelBarGroupUnSelecting += delegate(object sender, PanelBarGroupCancelEventArgs args) { OnPanelBarGroupUnSelecting(args); };

            this.ThemeNameChanged += new ThemeNameChangedEventHandler(RadPanelBar_ThemeNameChanged);

            this.ElementTree.PerformInnerLayout(true, 0, 0, this.DefaultSize.Width, this.DefaultSize.Height);
        }
Ejemplo n.º 2
0
        protected override System.Drawing.SizeF ArrangeOverride(System.Drawing.SizeF finalSize)
        {
            //base.ArrangeOverride(finalSize);
            float finalHeight = 0;

            RadPanelBarElement panelBar = (RadPanelBarElement)this.Parent;

            float y = 0;
            float x = 1;

            for (int i = 0; i < this.Children.Count; i++)
            {
                RadPanelBarGroupElement group = (RadPanelBarGroupElement)this.Children[i];

                PointF groupLocation = new PointF(x, y);

                SizeF groupSize = new SizeF(
                    finalSize.Width - 2,
                    group.DesiredSize.Height);

                y += group.DesiredSize.Height - 1;

                RectangleF groupBounds = new RectangleF(groupLocation, groupSize);

                group.Arrange(groupBounds);

                finalHeight += y;
            }

            this.OnArrangeModified(EventArgs.Empty);
            return(finalSize);
        }
Ejemplo n.º 3
0
        protected override SizeF MeasureOverride(SizeF availableSize)
        {
            float finalHeight = 0;

            RadPanelBarElement panelBar = (RadPanelBarElement)this.Parent;

            float y = 0;
            float x = 1;

            for (int i = 0; i < this.Children.Count; i++)
            {
                RadPanelBarGroupElement group = (RadPanelBarGroupElement)this.Children[i];

                PointF groupLocation = new PointF(x, y);

                SizeF groupSize = new SizeF(
                    availableSize.Width - 2,
                    availableSize.Height);

                RectangleF groupBounds = new RectangleF(groupLocation, groupSize);

                group.Measure(groupBounds.Size);

                finalHeight += y;
            }

            this.OnMeasureModified(EventArgs.Empty);

            return(availableSize);
        }
Ejemplo n.º 4
0
        protected override System.Drawing.SizeF ArrangeOverride(System.Drawing.SizeF finalSize)
        {
            //base.ArrangeOverride(finalSize);
            float finalHeight = 0;

            RadPanelBarElement panelBar = (RadPanelBarElement)this.Parent;

            if (panelBar == null)
            {
                return(base.ArrangeOverride(finalSize));
            }

            float y       = panelBar.TopOffset;
            float x       = 1 + panelBar.LeftOffset;
            int   counter = 0;

            for (int i = 0; i < this.Children.Count; i++)
            {
                RadPanelBarGroupElement group = (RadPanelBarGroupElement)this.Children[i];

                PointF groupLocation = new PointF(x, y);

                SizeF groupSize = new SizeF(
                    (finalSize.Width - 2 - panelBar.LeftOffset - panelBar.RightOffset - ((panelBar.NumberOfColumns - 1) * panelBar.SpacingBetweenColumns)) / panelBar.NumberOfColumns,
                    group.DesiredSize.Height);


                if (counter >= panelBar.NumberOfColumns)
                {
                    x       = 1 + panelBar.LeftOffset;
                    counter = 0;

                    float maxHeight = 0;
                    for (int j = i - panelBar.NumberOfColumns; j < i; j++)
                    {
                        RadPanelBarGroupElement searchingGroup = (RadPanelBarGroupElement)this.Children[j];

                        maxHeight = Math.Max(maxHeight, searchingGroup.DesiredSize.Height - 1);
                    }

                    y            += maxHeight + panelBar.SpacingBetweenGroups;
                    groupLocation = new PointF(x, y);
                    x            += groupSize.Width + panelBar.SpacingBetweenColumns;
                }
                else
                {
                    x += groupSize.Width + panelBar.SpacingBetweenColumns;
                }

                RectangleF groupBounds = new RectangleF(groupLocation, groupSize);

                group.Arrange(groupBounds);

                finalHeight += y;
                counter++;
            }

            this.OnArrangeModified(EventArgs.Empty);
            return(finalSize);           // new SizeF(finalSize.Width, Math.Max(finalSize.Height, finalHeight));
        }
Ejemplo n.º 5
0
        public radNavigationPaneOptions(RadPanelBarElement panelBarElement)
        {
            InitializeComponent();
            this.BackColor     = Color.FromArgb(242, 242, 242);
            this.StartPosition = FormStartPosition.CenterScreen;
            this.ShowInTaskbar = false;
            this.MinimizeBox   = false;
            this.MaximizeBox   = false;

            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.Text            = "Navigation Panel Options";
            this.panelBarElement = panelBarElement;
        }
Ejemplo n.º 6
0
        public OutlookStyle(RadPanelBarElement panelBar, RadTabStripContentPanel contentPanel, RadPanelBarContentControl itemsControl) : base(panelBar)
        {
            //this.panelBar = panelBar;
            this.contentPanel = contentPanel;
            this.itemsControl = itemsControl;

            if (itemsControl == null)
            {
                this.itemsControl = new RadPanelBarContentControl();
            }

            if (this.contentPanel != null)
            {
                this.contentPanelHost      = new RadHostItem(this.contentPanel);
                this.contentPanel.AutoSize = false;
//                this.contentPanel.AutoScroll = false;
////				this.contentPanelHost.AutoSize = false;
//                this.contentPanel.Size = new Size(50, 50);
//                this.contentPanelHost.Size = new Size(50, 50);
                this.contentPanel.Visible                 = false;
                this.contentPanelHost.Visibility          = ElementVisibility.Hidden;
                this.contentPanelHost.StretchHorizontally = true;
                this.contentPanelHost.StretchVertically   = true;
                this.contentPanel.Location                = this.contentPanelHost.LocationToControl();
            }
            else
            {
                this.contentPanelHost            = new RadHostItem(this.itemsControl);
                this.contentPanelHost.AutoSize   = false;
                this.contentPanelHost.Size       = new Size(50, 50);
                this.contentPanelHost.Visibility = ElementVisibility.Hidden;
                this.itemsControl.MaximumSize    = new Size(this.contentPanelHost.Bounds.Width, this.contentPanelHost.Size.Height);
                //    this.itemsControl.Bounds = new Rectangle(this.contentPanelHost.Bounds.X, 0, this.contentPanelHost.Bounds.Width, this.contentPanelHost.Bounds.Height);
                this.itemsControl.Bounds = this.contentPanelHost.Bounds;
                this.contentPanelHost.StretchHorizontally = false;
                this.contentPanelHost.StretchVertically   = false;
            }

            this.collapsedGroups = new List <RadPanelBarGroupElement>();
        }
Ejemplo n.º 7
0
 public VS2005Style(RadPanelBarElement panelBar) : base(panelBar)
 {
     //this.panelBar = panelBar;
 }
Ejemplo n.º 8
0
 protected PanelBarStyleBase(RadPanelBarElement panelBar)
 {
     this.panelBar = panelBar;
 }
Ejemplo n.º 9
0
 public ExplorerBarStyle(RadPanelBarElement panelBar) : base(panelBar)
 {
     //this.panelBar = panelBar;
 }
Ejemplo n.º 10
0
        protected override SizeF MeasureOverride(SizeF availableSize)
        {
            float finalHeight = 0;

            RadPanelBarElement panelBar = (RadPanelBarElement)this.Parent;

            if (panelBar == null)
            {
                return(base.MeasureOverride(availableSize));
            }

            base.MeasureOverride(availableSize);

            float y       = panelBar.TopOffset;
            float x       = 1 + panelBar.LeftOffset;
            int   counter = 0;

            for (int i = 0; i < this.Children.Count; i++)
            {
                RadPanelBarGroupElement group = (RadPanelBarGroupElement)this.Children[i];

                PointF groupLocation = new PointF(x, y);


                SizeF groupSize = new SizeF(
                    (availableSize.Width - 2 - panelBar.LeftOffset - panelBar.RightOffset - ((panelBar.NumberOfColumns - 1) * panelBar.SpacingBetweenColumns)) / panelBar.NumberOfColumns,
                    availableSize.Height);


                //	group.Measure(availableSize);

                if (counter >= panelBar.NumberOfColumns)
                {
                    x       = 1 + panelBar.LeftOffset;
                    counter = 0;

                    float maxHeight = 0;
                    for (int j = i - panelBar.NumberOfColumns; j < i; j++)
                    {
                        RadPanelBarGroupElement searchingGroup = (RadPanelBarGroupElement)this.Children[j];

                        maxHeight = Math.Max(maxHeight, searchingGroup.DesiredSize.Height);
                    }


                    y            += maxHeight + panelBar.SpacingBetweenGroups;
                    groupLocation = new PointF(x, y);
                }
                else
                {
                    x += groupSize.Width + panelBar.SpacingBetweenColumns;
                }

                int captionSize = (int)group.GetCaptionElement().DesiredSize.Height;

                RectangleF groupBounds = new RectangleF(groupLocation, groupSize);
                group.Measure(groupBounds.Size);

                if (group.ContentPanel.Height + captionSize > groupBounds.Height)
                {
                    double calculatedHeight = captionSize + group.ContentPanel.Height;

                    groupBounds = new RectangleF(groupLocation, new SizeF(groupSize.Width, (float)calculatedHeight));
                    group.Measure(groupBounds.Size);
                }


                finalHeight += group.DesiredSize.Height;
                counter++;
            }

            this.OnMeasureModified(EventArgs.Empty);


            return(new SizeF(availableSize.Width, finalHeight));
        }
Ejemplo n.º 11
0
 public ListBarStyle(RadPanelBarElement panelBar) : base(panelBar)
 {
     //this.panelBar = panelBar;
 }