Exemplo n.º 1
0
        /// <summary>
        /// Moves the current selection to the right.
        /// </summary>
        internal void NavigateRight()
        {
            if (this.selectedItem == null)
            {
                return;
            }

            QuickNavigatorList owningList = this.selectedItem.Owner;
            WrapLayoutPanel    itemsPanel = owningList.ItemsPanel;
            int index = itemsPanel.Children.IndexOf(this.selectedItem);

            int newIndex = index + this.settings.ItemsPerColumn;

            if (newIndex > itemsPanel.Children.Count - 1)
            {
                //move the selection to the document window list
                if (owningList == this.navigatorElement.ToolWindowList &&
                    this.navigatorElement.DocumentWindowList.Visibility == ElementVisibility.Visible)
                {
                    itemsPanel = this.navigatorElement.DocumentWindowList.ItemsPanel;
                    newIndex   = index - (this.docPaneColumns - 1) * this.settings.ItemsPerColumn;
                    newIndex   = Math.Max(0, newIndex);
                    newIndex   = Math.Min(itemsPanel.Children.Count - 1, newIndex);
                }
            }

            if (newIndex >= 0 && newIndex < itemsPanel.Children.Count)
            {
                this.SelectItem((QuickNavigatorListItem)itemsPanel.Children[newIndex]);
            }
        }
Exemplo n.º 2
0
        protected override void CreateChildElements()
        {
            // if there is an old reference we clear it.
            this.contextItem = null;

            this.layoutPanel        = new WrapLayoutPanel();
            this.layoutPanel.ZIndex = 10;
            this.layoutPanel.BindProperty(WrapLayoutPanel.OrientationProperty, this, RadMenuElement.OrientationProperty, PropertyBindingOptions.OneWay);
            //todo:
            //this.layoutPanel.BindProperty(WrapLayoutPanel.Eql, this, RadMenuElement.AllItemsEqualHeightProperty, PropertyBindingOptions.OneWay);

            this.items.Owner = this.layoutPanel;
            this.Children.Add(this.layoutPanel);

            fill = new FillPrimitive();
            fill.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            fill.Visibility   = ElementVisibility.Collapsed;
            fill.Class        = "MenuFill";
            fill.ZIndex       = 5;
            this.Children.Add(fill);


            this.systemButtons                         = new StackLayoutPanel();
            this.systemButtons.Alignment               = ContentAlignment.MiddleRight;
            this.systemButtons.ZIndex                  = 0;
            this.systemButtons.Class                   = "SystemButtonsStackLayoutPanel";
            this.minimizeButton                        = new RadImageButtonElement();
            this.minimizeButton.StretchHorizontally    = false;
            this.minimizeButton.StretchVertically      = false;
            this.minimizeButton.Class                  = "MinimizeButton";
            this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill";
            this.systemButtons.Children.Add(minimizeButton);

            this.maximizeButton = new RadImageButtonElement();
            this.maximizeButton.StretchHorizontally = false;
            this.maximizeButton.StretchVertically   = false;
            this.maximizeButton.Class = "MaximizeButton";
            this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill";
            this.systemButtons.Children.Add(maximizeButton);

            this.closeButton = new RadImageButtonElement();
            this.closeButton.StretchHorizontally = false;
            this.closeButton.StretchVertically   = false;
            this.closeButton.Class = "CloseButton";
            this.closeButton.ButtonFillElement.Name = "CloseButtonFill";
            this.systemButtons.Children.Add(closeButton);
            this.systemButtons.ZIndex = 6;
            this.Children.Add(systemButtons);


            this.border         = new BorderPrimitive();
            border.Class        = "MenuBorder";
            border.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.Children.Add(border);

            systemButtons.Visibility = ElementVisibility.Collapsed;
        }
Exemplo n.º 3
0
 protected override void InitializeFields()
 {
     base.InitializeFields();
     this.Margin              = new System.Windows.Forms.Padding(0, 3, 0, 3);
     this.buttonsLayout       = new WrapLayoutPanel();
     this.buttonsLayout.Class = "ButtonsLayoutPanel";
     this.items             = new RadItemOwnerCollection();
     this.items.Owner       = this.buttonsLayout;
     this.items.ItemTypes   = new Type[] { typeof(RadButtonElement) };
     this.items.SealedTypes = new Type [] { typeof(RadButtonElement) };
 }
Exemplo n.º 4
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.itemsLayoutPanel = new WrapLayoutPanel();
            this.textPrimitive    = new TextPrimitive();
            this.captionElement   = new FillPrimitive();
            this.bodyElement      = new FillPrimitive();
            this.groupLayoutPanel = new ElementWithCaptionLayoutPanel();

            this.NotifyParentOnMouseInput = true;
            this.items           = new RadItemOwnerCollection();
            this.items.ItemTypes = new Type[] { typeof(RadGalleryItem) };
        }
Exemplo n.º 5
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.Orientation                  = Orientation.Vertical;
     this.wrapLayout                   = new WrapLayoutPanel();
     this.wrapLayout.MaxSize           = new Size(130, 0);
     this.wrapLayout.StretchVertically = false;
     this.Children.Add((RadElement)this.wrapLayout);
     this.labelElement = new LightVisualElement();
     this.labelElement.StretchVertically   = false;
     this.labelElement.DrawBorder          = true;
     this.labelElement.BorderGradientStyle = GradientStyles.Solid;
     this.Children.Add((RadElement)this.labelElement);
 }
Exemplo n.º 6
0
        protected override void CreateChildElements()
        {
            this.contextItem        = (RadItem)null;
            this.layoutPanel        = new WrapLayoutPanel();
            this.layoutPanel.ZIndex = 10;
            int num = (int)this.layoutPanel.BindProperty(WrapLayoutPanel.OrientationProperty, (RadObject)this, RadMenuElement.OrientationProperty, PropertyBindingOptions.OneWay);

            this.items.Owner = (RadElement)this.layoutPanel;
            this.Children.Add((RadElement)this.layoutPanel);
            this.fill = new FillPrimitive();
            this.fill.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.fill.Visibility   = ElementVisibility.Collapsed;
            this.fill.Class        = "MenuFill";
            this.fill.ZIndex       = 5;
            this.Children.Add((RadElement)this.fill);
            this.systemButtons                         = new StackLayoutPanel();
            this.systemButtons.Alignment               = ContentAlignment.MiddleRight;
            this.systemButtons.ZIndex                  = 0;
            this.systemButtons.Class                   = "SystemButtonsStackLayoutPanel";
            this.minimizeButton                        = new RadImageButtonElement();
            this.minimizeButton.StretchHorizontally    = false;
            this.minimizeButton.StretchVertically      = false;
            this.minimizeButton.Class                  = "MinimizeButton";
            this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill";
            this.systemButtons.Children.Add((RadElement)this.minimizeButton);
            this.maximizeButton = new RadImageButtonElement();
            this.maximizeButton.StretchHorizontally = false;
            this.maximizeButton.StretchVertically   = false;
            this.maximizeButton.Class = "MaximizeButton";
            this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill";
            this.systemButtons.Children.Add((RadElement)this.maximizeButton);
            this.closeButton = new RadImageButtonElement();
            this.closeButton.StretchHorizontally = false;
            this.closeButton.StretchVertically   = false;
            this.closeButton.Class = "CloseButton";
            this.closeButton.ButtonFillElement.Name = "CloseButtonFill";
            this.systemButtons.Children.Add((RadElement)this.closeButton);
            this.systemButtons.ZIndex = 6;
            this.Children.Add((RadElement)this.systemButtons);
            this.border              = new BorderPrimitive();
            this.border.Class        = "MenuBorder";
            this.border.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.Children.Add((RadElement)this.border);
            this.systemButtons.Visibility = ElementVisibility.Collapsed;
        }
Exemplo n.º 7
0
        private void PopulateItems(QuickNavigatorList list, IEnumerable panes)
        {
            WrapLayoutPanel itemsList = list.ItemsPanel;

            foreach (DockWindow pane in panes)
            {
                QuickNavigatorListItem item = this.CreateListItem(pane);
                item.Owner = list;
                itemsList.Children.Add(item);

                //detect the active item
                if (pane == this.activeWindow)
                {
                    this.navigatorElement.Header.Text = pane.Text;
                    this.selectedItem = item;
                }
            }
        }
Exemplo n.º 8
0
        protected override void CreateChildElements()
        {
            this.leftFillPrimitive        = new FillPrimitive();
            this.leftFillPrimitive.Class  = "RadSubMenuPanelFillPrimitive";
            this.leftFillPrimitive.ZIndex = 1;

            this.leftLayoutPanel                    = new StackLayoutPanel();
            this.leftLayoutPanel.Orientation        = Orientation.Vertical;
            this.leftLayoutPanel.EqualChildrenWidth = true;
            ForceSizeLayoutPanel force1 = new ForceSizeLayoutPanel();

            force1.ForceChildWidthToParent = true;
            force1.Children.Add(leftLayoutPanel);

            this.borderPrimitive = new BorderPrimitive();
            this.borderPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.borderPrimitive.Class        = "RadSubMenuPanelBorderPrimitive";;

            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadSubMenuPanelBackFillPrimitive";;
            this.fillPrimitive.BackColor     = Color.White;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;

            this.wrapperLayoutPanel             = new WrapLayoutPanel();
            this.wrapperLayoutPanel.Orientation = Orientation.Vertical;
            this.wrapperLayoutPanel.ZIndex      = 2;

            this.bottomStripLayoutPanel             = new StackLayoutPanel();
            this.bottomStripLayoutPanel.MinSize     = new Size(0, 10);
            this.bottomStripLayoutPanel.Visibility  = ElementVisibility.Collapsed;
            this.bottomStripLayoutPanel.Orientation = Orientation.Horizontal;
            ForceSizeLayoutPanel force2 = new ForceSizeLayoutPanel();

            force2.ForceChildWidthToParent = true;
            force2.Children.Add(bottomStripLayoutPanel);

            this.wrapperLayoutPanel.Children.Add(force1);
            this.wrapperLayoutPanel.Children.Add(force2);

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(this.leftFillPrimitive);
            this.Children.Add(wrapperLayoutPanel);
            this.Children.Add(this.borderPrimitive);
        }
Exemplo n.º 9
0
 protected override void CreateChildElements()
 {
     this.itemsWrapLayoutPanel            = new WrapLayoutPanel();
     this.itemsBoxLayout                  = new StatusBarBoxLayout();
     this.itemsWrapLayoutPanel.Visibility = ElementVisibility.Collapsed;
     DockLayoutPanel.SetDock((RadElement)this.itemsWrapLayoutPanel, Dock.Right);
     this.items.Owner     = (RadElement)this.itemsBoxLayout;
     this.items.ItemTypes = new System.Type[13]
     {
         typeof(RadLabelElement),
         typeof(CommandBarSeparator),
         typeof(RadButtonElement),
         typeof(RadCheckBoxElement),
         typeof(RadImageButtonElement),
         typeof(RadProgressBarElement),
         typeof(RadRadioButtonElement),
         typeof(RadRepeatButtonElement),
         typeof(RadSplitButtonElement),
         typeof(RadStatusBarPanelElement),
         typeof(RadToggleButtonElement),
         typeof(RadTrackBarElement),
         typeof(RadWaitingBarElement)
     };
     this.fillPrimitive              = new FillPrimitive();
     this.borderPrimitive            = new BorderPrimitive();
     this.borderPrimitive.BoxStyle   = BorderBoxStyle.OuterInnerBorders;
     this.borderPrimitive.Class      = "StatusBarBorder";
     this.borderPrimitive.Width      = 2f;
     this.borderPrimitive.BackColor  = Color.DarkBlue;
     this.borderPrimitive.InnerColor = Color.White;
     this.fillPrimitive              = new FillPrimitive();
     this.fillPrimitive.ShouldUsePaintBufferState = false;
     this.fillPrimitive.Class = "StatusBarFill";
     this.Children.Add((RadElement)this.borderPrimitive);
     this.Children.Add((RadElement)this.fillPrimitive);
     this.Children.Add((RadElement)this.itemsWrapLayoutPanel);
     this.Children.Add((RadElement)this.itemsBoxLayout);
     DockLayoutPanel.SetDock((RadElement)this.itemsWrapLayoutPanel, Dock.Left);
     DockLayoutPanel.SetDock((RadElement)this.itemsBoxLayout, Dock.Left);
     this.grip = new RadGripElement();
     this.Children.Add((RadElement)this.grip);
 }
Exemplo n.º 10
0
        /// <summary>
        /// create elements in the RadStatusBarElement
        /// </summary>
        protected override void CreateChildElements()
        {
            this.itemsWrapLayoutPanel = new WrapLayoutPanel();
            this.itemsBoxLayout       = new StatusBarBoxLayout();
            //hide this panel by default
            this.itemsWrapLayoutPanel.Visibility = ElementVisibility.Collapsed;

            DockLayoutPanel.SetDock(itemsWrapLayoutPanel, Dock.Right);

            this.items.Owner     = this.itemsBoxLayout;
            this.items.ItemTypes = new Type[] { typeof(RadButtonElement), typeof(RadToggleButtonElement), typeof(RadRepeatButtonElement), typeof(RadCheckBoxElement), typeof(RadImageButtonElement),
                                                typeof(RadRadioButtonElement), typeof(RadLabelElement), typeof(RadProgressBarElement), typeof(RadStatusBarPanelElement), typeof(RadToolStripSeparatorItem),
                                                typeof(RadTrackBarElement), typeof(RadSplitButtonElement) };
            this.fillPrimitive = new FillPrimitive();


            this.borderPrimitive            = new BorderPrimitive();
            this.borderPrimitive.BoxStyle   = BorderBoxStyle.OuterInnerBorders;
            this.borderPrimitive.Class      = "StatusBarBorder";
            this.borderPrimitive.Width      = 2f;
            this.borderPrimitive.BackColor  = Color.DarkBlue;
            this.borderPrimitive.InnerColor = Color.White;

            this.fillPrimitive       = new FillPrimitive();
            this.fillPrimitive.Class = "StatusBarFill";



            this.Children.Add(borderPrimitive);
            this.Children.Add(fillPrimitive);

            this.Children.Add(itemsWrapLayoutPanel);
            this.Children.Add(itemsBoxLayout);

            DockLayoutPanel.SetDock(itemsWrapLayoutPanel, Dock.Left);
            DockLayoutPanel.SetDock(itemsBoxLayout, Dock.Left);

            this.grip = new RadGripElement();
            this.Children.Add(grip);
        }
Exemplo n.º 11
0
        private void ModifySelectedIndex(int correction)
        {
            QuickNavigatorList owningList = this.selectedItem.Owner;
            WrapLayoutPanel    itemsPanel = owningList.ItemsPanel;
            int index = itemsPanel.Children.IndexOf(this.selectedItem);

            int newIndex = index + correction;

            if (newIndex < 0)
            {
                newIndex = itemsPanel.Children.Count - 1;
            }
            else if (newIndex > itemsPanel.Children.Count - 1)
            {
                newIndex = 0;
            }

            if (newIndex >= 0 && newIndex < itemsPanel.Children.Count)
            {
                this.SelectItem((QuickNavigatorListItem)itemsPanel.Children[newIndex]);
            }
        }