Пример #1
0
        /// <summary>
        /// Creates child elements
        /// </summary>
        protected override void CreateChildElements()
        {
            this.stripLayout              = new ToolStripElementLayout();
            this.stripLayout.Orientation  = Orientation.Horizontal;
            this.stripLayout.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            this.stripLayout.Class        = "ToolStripElementLayout";

            this.border = new BorderPrimitive();

            this.stripFill = new FillPrimitive();
            this.stripFill.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.stripFill.Class        = "ToolStripElementFill";

            this.Margin = new Padding(this.Margin.Left, 1, this.Margin.Right, this.Margin.Bottom);
            this.Children.Add(this.stripLayout);

            border.Class = "ToolStripElementBorder";

            border.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.Children.Add(border);

            this.items               = new RadItemOwnerCollection();
            this.items.ItemTypes     = new Type[] { typeof(RadToolStripItem) };
            this.items.ItemsChanged += new ItemChangedDelegate(items_ItemsChanged);
            this.items.Owner         = stripLayout;
        }
Пример #2
0
 protected override void InitializeFields()
 {
     base.InitializeFields();
     this.BitState[8796093022208L] = true;
     this.tools           = new RadItemOwnerCollection();
     this.tools.ItemTypes = new System.Type[3]
     {
         typeof(RadMenuItem),
         typeof(RadMenuButtonItem),
         typeof(RadMenuComboItem)
     };
     this.items           = new RadItemOwnerCollection();
     this.items.ItemTypes = new System.Type[1]
     {
         typeof(RadGalleryItem)
     };
     this.items.ItemsChanged += new ItemChangedDelegate(this.items_ItemsChanged);
     this.groups              = new RadItemOwnerCollection();
     this.groups.ItemTypes    = new System.Type[1]
     {
         typeof(RadGalleryGroupItem)
     };
     this.filters           = new RadItemOwnerCollection();
     this.filters.ItemTypes = new System.Type[1]
     {
         typeof(RadGalleryGroupFilter)
     };
     this.ClipDrawing  = true;
     this.zoomBehavior = new GalleryMouseOverBehavior(this);
     this.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
 }
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.items           = new RadItemOwnerCollection();
            this.items.ItemTypes = new Type[] { typeof(RadButtonElement) };
        }
Пример #4
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.UseNewLayoutSystem = true;
            this.items           = new RadItemOwnerCollection();
            this.items.ItemTypes = new Type[]
            {
                typeof(RadButtonElement),
                typeof(RadCheckBoxElement),
                typeof(RadComboBoxElement),
                typeof(RadDropDownButtonElement),
                typeof(RadDropDownListElement),
                typeof(RadGalleryElement),
                typeof(RadImageButtonElement),
                typeof(RadRadioButtonElement),
                typeof(RadRepeatButtonElement),
                typeof(RadRibbonBarButtonGroup),
                typeof(RadSplitButtonElement),
                typeof(RadTextBoxElement),
                typeof(RadToggleButtonElement)
            };
            this.items.ExcludedTypes = new Type[] { typeof(RadTextBoxElement) };
            this.AutoSize            = true;
            this.MinSize             = defaultMinSize;
            this.MaxSize             = defaultMaxSize;
            this.Margin = defaultMargin;
            this.Shape  = new RoundRectShape(3);
        }
Пример #5
0
 internal void AddRange(RadItemOwnerCollection value)
 {
     for (int index = 0; index < value.Count; ++index)
     {
         this.Add(value[index]);
     }
 }
Пример #6
0
        protected override void CreateChildElements()
        {
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "ButtonGroupBorder";
            this.fillPrimitive         = new FillPrimitive();
            this.fillPrimitive.Class   = "ButtonGroupFill";
            this.layoutPanel           = new StackLayoutPanel();
            this.items = new RadItemOwnerCollection((RadElement)this.layoutPanel);
            this.items.ItemsChanged += new ItemChangedDelegate(this.ItemChanged);
            this.items.ItemTypes     = new System.Type[16]
            {
                typeof(RadButtonElement),
                typeof(RadCheckBoxElement),
                typeof(RadDropDownListElement),
                typeof(RadDropDownButtonElement),
                typeof(RadImageButtonElement),
                typeof(RadLabelElement),
                typeof(RadMaskedEditBoxElement),
                typeof(RadProgressBarElement),
                typeof(RadRadioButtonElement),
                typeof(RadRepeatButtonElement),
                typeof(RadRibbonBarButtonGroup),
                typeof(RadSplitButtonElement),
                typeof(RadTextBoxElement),
                typeof(RadToggleButtonElement),
                typeof(RadTrackBarElement),
                typeof(RibbonBarGroupSeparator)
            };
            int num = (int)this.layoutPanel.BindProperty(StackLayoutPanel.OrientationProperty, (RadObject)this, RadRibbonBarButtonGroup.OrientationProperty, PropertyBindingOptions.OneWay);

            this.Children.Add((RadElement)this.fillPrimitive);
            this.Children.Add((RadElement)this.layoutPanel);
            this.Children.Add((RadElement)this.borderPrimitive);
        }
Пример #7
0
        public RadGalleryPopupElement(RadItemOwnerCollection items,
                                      RadItemOwnerCollection groups,
                                      RadItemOwnerCollection filters,
                                      RadItemOwnerCollection menuItems,
                                      SizeF initialSize,
                                      SizeF minimumSize,
                                      SizingMode dropDownSizingMode

                                      )
        {
            this.galleryItems       = items;
            this.groups             = groups;
            this.menuItems          = menuItems;
            this.newSize            = initialSize;
            this.actualSize         = initialSize;
            this.initialSize        = initialSize;
            this.minimumSize        = minimumSize;
            this.filters            = filters;
            this.dropDownSizingMode = dropDownSizingMode;

            this.BuildPopupContent();//read groups if any

            this.menuElement.MinSize = new Size((int)initialSize.Width, 0);
            this.menuElement.Items.AddRange(this.menuItems);
        }
Пример #8
0
 protected override void CreateChildElements()
 {
     this.caption                               = new LightVisualElement();
     this.caption.Class                         = "Caption";
     this.caption.StretchVertically             = false;
     this.caption.TextAlignment                 = ContentAlignment.TopLeft;
     this.subCaption                            = new LightVisualElement();
     this.subCaption.Class                      = "SubCaption";
     this.subCaption.StretchVertically          = false;
     this.subCaption.TextAlignment              = ContentAlignment.TopLeft;
     this.description                           = new LightVisualElement();
     this.description.Class                     = "Description";
     this.description.StretchVertically         = false;
     this.description.TextAlignment             = ContentAlignment.TopLeft;
     this.elementsLayout                        = new StackLayoutElement();
     this.elementsLayout.Orientation            = Orientation.Horizontal;
     this.elementsLayout.StretchHorizontally    = true;
     this.elementsLayout.StretchVertically      = true;
     this.elementsLayout.ShouldHandleMouseInput = false;
     this.elementsLayout.ClipDrawing            = true;
     this.elementsLayout.FitInAvailableSize     = true;
     this.items               = new RadItemOwnerCollection();
     this.items.Owner         = (RadElement)this.elementsLayout;
     this.items.ItemTypes     = this.GetItemsTypes();
     this.items.DefaultType   = typeof(RatingStarVisualElement);
     this.Orientation         = Orientation.Vertical;
     this.StretchHorizontally = true;
     this.StretchVertically   = true;
     this.Children.Add((RadElement)this.caption);
     this.Children.Add((RadElement)this.subCaption);
     this.Children.Add((RadElement)this.elementsLayout);
     this.Children.Add((RadElement)this.description);
 }
Пример #9
0
 protected override void InitializeFields()
 {
     base.InitializeFields();
     this.ShouldHandleMouseInput = true;
     this.items           = new RadItemOwnerCollection();
     this.items.ItemTypes = new System.Type[12]
     {
         typeof(RadItemsContainer),
         typeof(RadRotatorElement),
         typeof(RadArrowButtonElement),
         typeof(RadDropDownListElement),
         typeof(RadButtonElement),
         typeof(RadWebBrowserElement),
         typeof(RadTextBoxElement),
         typeof(RadImageButtonElement),
         typeof(RadImageItem),
         typeof(RadCheckBoxElement),
         typeof(RadMaskedEditBoxElement),
         typeof(RadLabelElement)
     };
     this.items.ItemsChanged += new ItemChangedDelegate(this.ItemsChanged);
     this.items.Owner         = (RadElement)this;
     this.timer          = new Timer();
     this.timer.Tick    += new EventHandler(this.Animate);
     this.timer.Interval = 2000;
 }
Пример #10
0
        public void InitializeOverflowDropDown(RadTabStripElement tabStripElement, LayoutPanel parent)
        {
            this.items               = tabStripElement.Items;
            this.tabStripElement     = tabStripElement;
            this.items.ItemsChanged += new ItemChangedDelegate(items_ItemsChanged);


            this.dropDownButton = new RadDropDownButtonElement();
            dropDownButton.SetValue(TabLayoutPanel.IsDropDownButtonProperty, true);
            this.DropDownButton.DropDownOpening += new CancelEventHandler(button_DropDownShowing);
            this.DropDownButton.Text             = "";
            this.DropDownButton.ZIndex           = 9000;

            CollapseActionButtonBorder();
            this.DropDownButton.MouseDown += new MouseEventHandler(DropDownButton_MouseDown);

            this.dropDownButton.MinSize                    = new Size(20, 20);
            this.dropDownButton.ArrowButton.MinSize        = new Size(20, 20);
            this.dropDownButton.ArrowButton.Arrow.AutoSize = true;
            this.dropDownButton.Visibility                 = ElementVisibility.Hidden;
            parent.Children.Add(this.dropDownButton);

            if (parent as TabLayoutPanel != null)
            {
                (parent as TabLayoutPanel).DropDownButton = this.dropDownButton;
            }
        }
Пример #11
0
 protected override void InitializeFields()
 {
     base.InitializeFields();
     this.items           = new RadItemOwnerCollection();
     this.items.ItemTypes = new System.Type[14]
     {
         typeof(RadButtonElement),
         typeof(RadCheckBoxElement),
         typeof(RadDropDownButtonElement),
         typeof(RadDropDownListElement),
         typeof(RadGalleryElement),
         typeof(RadImageButtonElement),
         typeof(RadProgressBarElement),
         typeof(RadRepeatButtonElement),
         typeof(RadRadioButtonElement),
         typeof(RadSplitButtonElement),
         typeof(RadTextBoxElement),
         typeof(RadToggleButtonElement),
         typeof(RadTrackBarElement),
         typeof(RadRibbonBarButtonGroup)
     };
     this.items.ExcludedTypes = new System.Type[1]
     {
         typeof(RadTextBoxElement)
     };
     this.AutoSize = true;
     this.MinSize  = RadRibbonBarGroup.defaultMinSize;
     this.MaxSize  = RadRibbonBarGroup.defaultMaxSize;
     this.Margin   = RadRibbonBarGroup.defaultMargin;
     this.Shape    = (ElementShape) new RoundRectShape(3);
 }
Пример #12
0
 internal void AddRange(RadItemOwnerCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add(value[i]);
     }
 }
Пример #13
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.items           = new RadItemOwnerCollection();
            this.items.ItemTypes = new Type[] { typeof(RadGalleryGroupItem) };
        }
Пример #14
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.items               = new RadItemOwnerCollection();
            this.items.ItemTypes     = new Type[] { typeof(RadDropDownButtonElement) };
            this.items.ItemsChanged += new ItemChangedDelegate(items_ItemsChanged);
        }
Пример #15
0
 protected override void InitializeFields()
 {
     base.InitializeFields();
     this.items           = new RadItemOwnerCollection();
     this.items.ItemTypes = new Type[1]
     {
         typeof(RadRibbonBarGroup)
     };
 }
Пример #16
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.items               = new RadItemOwnerCollection();
            this.items.ItemTypes     = new Type[] { typeof(RadMenuItemBase) };
            this.items.DefaultType   = typeof(RadMenuItem);
            this.items.ItemsChanged += new ItemChangedDelegate(this.ItemsChanged);
        }
Пример #17
0
        public RadToolStripItemControl(RadToolStripContainterElement container)
        {
            this.containerElement = container;
            this.containerElement.ContainerForm.SizeChanged += new EventHandler(ContainerForm_SizeChanged);
            this.items = container.Items;

            this.CausesValidation = false;

            this.CreateChildItems(this.RootElement);
        }
Пример #18
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.items           = new RadItemOwnerCollection();
            this.items.ItemTypes = new Type[] { typeof(RadButtonElement), typeof(RadTextBoxElement), typeof(RadComboBoxElement),
                                                typeof(RadToolStripLabelElement), typeof(RadToolStripSeparatorItem), typeof(RadDropDownButtonElement), };
            this.AutoSizeMode        = RadAutoSizeMode.WrapAroundChildren;
            this.items.ItemsChanged += new ItemChangedDelegate(items_ItemsChanged);
        }
Пример #19
0
 public void End()
 {
     this.host           = null;
     this.edSvc          = null;
     this.typeSvc        = null;
     this.defaultFilter  = null;
     this.defaultElement = null;
     this.originalValue  = null;
     this.Reset();
 }
Пример #20
0
 public void End()
 {
     this.host           = (IDesignerHost)null;
     this.edSvc          = (IWindowsFormsEditorService)null;
     this.typeSvc        = (ITypeDiscoveryService)null;
     this.defaultFilter  = (RadGalleryGroupFilter)null;
     this.defaultElement = (RadGalleryElement)null;
     this.originalValue  = (RadItemOwnerCollection)null;
     this.Reset();
 }
Пример #21
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.DrawBorder               = false;
     this.ShouldHandleMouseInput   = false;
     this.NotifyParentOnMouseInput = true;
     this.items       = new RadItemOwnerCollection();
     this.items.Owner = (RadElement)this;
     this.AllowDrop   = true;
 }
Пример #22
0
 public RadGalleryPopupElement(
     RadItemOwnerCollection items,
     RadItemOwnerCollection groups,
     RadItemOwnerCollection filters,
     RadItemOwnerCollection menuItems,
     SizeF initialSize,
     SizeF minimumSize)
     : this(items, groups, filters, menuItems, initialSize, minimumSize, SizingMode.UpDownAndRightBottom)
 {
 }
Пример #23
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.items           = new RadItemOwnerCollection();
            this.items.ItemTypes = new Type[] { typeof(RadRibbonBarGroup) };
#pragma warning disable 0618
            this.items.ExcludedTypes = new Type[] { typeof(RadRibbonBarCommandTab) };
#pragma warning restore 0618
        }
Пример #24
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.items = new RadItemOwnerCollection();
            this.items.ItemsChanged += new ItemChangedDelegate(items_ItemsChanged);

            this.MinSize            = new System.Drawing.Size(0, 20);
            this.UseNewLayoutSystem = true;
        }
Пример #25
0
        protected override void CreateChildElements()
        {
            this.border = new BorderPrimitive();
            this.border.AutoSizeMode  = RadAutoSizeMode.FitToAvailableSize;
            this.border.GradientStyle = GradientStyles.Solid;
            this.border.MinSize       = this.MinSize;
            this.border.Visibility    = ElementVisibility.Hidden;
            this.border.Class         = "ToolStripItemBorder";
            this.Children.Add(this.border);

            this.fill               = new FillPrimitive();
            this.fill.Class         = "ToolStripFill";
            this.fill.AutoSizeMode  = RadAutoSizeMode.FitToAvailableSize;
            this.fill.MinSize       = this.MinSize;
            this.fill.BackColor     = Color.DarkGray;
            this.fill.GradientStyle = GradientStyles.Solid;
            this.Children.Add(this.fill);

            this.gripElement = new RadToolStripGripElement();
            //this.gripElement.MinSize = new Size(10, 0);
            //this.gripElement.Margin = new Padding(5, 0, 0, 0);
            this.gripElement.SetValue(ToolStripItemLayout.IsGripElementProperty, true);
            this.Children.Add(this.gripElement);

            this.itemsLayout = new ToolStripItemLayout();
            //this.itemsLayout.EqualChildrenHeight = true;
            //this.itemsLayout.ForceElementsHeight = true;
            this.itemsLayout.MinSize   = new Size(21, 21);
            this.itemsLayout.Class     = "ToolStripItemLayout";
            this.itemsLayout.Alignment = ContentAlignment.TopLeft;
            this.itemsLayout.ParentToolStripManager = this.ParentToolStripManager;
            this.Children.Add(itemsLayout);

            this.items           = new RadItemOwnerCollection();
            this.items.ItemTypes = new Type[] { typeof(RadButtonElement), typeof(RadToggleButtonElement), typeof(RadRepeatButtonElement),
                                                typeof(RadCheckBoxElement), typeof(RadImageButtonElement),
                                                typeof(RadRadioButtonElement), typeof(RadTextBoxElement), typeof(RadMaskedEditBoxElement), typeof(RadComboBoxElement),
                                                typeof(RadToolStripLabelElement), typeof(RadToolStripSeparatorItem), typeof(RadDropDownButtonElement), typeof(RadSplitButtonElement), };
            this.items.ItemsChanged += new ItemChangedDelegate(items_ItemsChanged);
            this.items.Owner         = itemsLayout;

            this.OverflowManager.InitializeOverflowDropDown(this);
            this.Children.Add(this.OverflowManager.DropDownButton);


            if (this.ParentToolStripManager != null)
            {
                if (!this.ParentToolStripManager.ShowOverFlowButton)
                {
                    this.OverflowManager.DropDownButton.Visibility = ElementVisibility.Hidden;
                }

                this.ParentToolStripManager.RadPropertyChanged += new RadPropertyChangedEventHandler(ParentToolStripManager_RadPropertyChanged);
            }
        }
 protected override void InitializeFields()
 {
     base.InitializeFields();
     base.Shape           = new RoundRectShape(12);
     this.items           = new RadItemOwnerCollection();
     this.items.ItemTypes = new Type[]
     {
         typeof(RadButtonElement)
     };
     this.items.ItemsChanged += new ItemChangedDelegate(this.items_ItemsChanged);
 }
Пример #27
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.items                   = new RadItemOwnerCollection();
            this.items.ItemTypes         = new Type[] { typeof(RadPanelBarGroupElement) };
            this.items.ItemsChanged     += new ItemChangedDelegate(items_ItemsChanged);
            this.DrawBorder              = true;
            this.hiddenGroupsList        = new List <RadPanelBarGroupElement>();
            this.PanelBarGroupCollapsed += new PanelBarGroupEventHandler(RadPanelBarElement_PanelBarGroupCollapsed);
        }
Пример #28
0
 public void Start(IWindowsFormsEditorService edSvc, ITypeDiscoveryService typeSvc, IDesignerHost host,
                   RadItemOwnerCollection collection, RadGalleryGroupFilter filter, RadGalleryElement owner)
 {
     this.host           = host;
     this.edSvc          = edSvc;
     this.typeSvc        = typeSvc;
     this.currentValue   = collection;
     this.originalValue  = collection;
     this.defaultFilter  = filter;
     this.defaultElement = owner;
 }
Пример #29
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) };
 }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                IWindowsFormsEditorService windowsFormsEditorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                ITypeDiscoveryService      typeDiscoveryService      = (ITypeDiscoveryService)provider.GetService(typeof(ITypeDiscoveryService));
                IDesignerHost           designerHost           = (IDesignerHost)provider.GetService(typeof(IDesignerHost));
                IComponentChangeService componentChangeService = (IComponentChangeService)provider.GetService(typeof(IComponentChangeService));
                ISelectionService       selectionService       = (ISelectionService)provider.GetService(typeof(ISelectionService));

                if (windowsFormsEditorService == null)
                {
                    return(value);
                }

                RadItemOwnerCollection collection1 = value as RadItemOwnerCollection;
                RadGalleryGroupFilter  filter      = context.Instance as RadGalleryGroupFilter;
                RadGalleryElement      owner       = null;

                if (collection1 == null ||
                    filter == null)
                {
                    return(value);
                }
                else
                {
                    if (filter.Owner == null && selectionService != null && selectionService.PrimarySelection != null)
                    {
                        filter.Owner = (RadGalleryElement)selectionService.PrimarySelection;
                    }
                    owner = filter.Owner;
                    if (owner == null)
                    {
                        return(value);
                    }
                }
                if (this.filteredItemsUI == null)
                {
                    this.filteredItemsUI = new FilteredItemsEditorUI();
                }
                componentChangeService.OnComponentChanging(context.Instance, TypeDescriptor.GetProperties(context.Instance)["Items"]);
                this.filteredItemsUI.Start(windowsFormsEditorService, typeDiscoveryService, designerHost, collection1, filter, owner);

                if (windowsFormsEditorService.ShowDialog(this.filteredItemsUI) == DialogResult.OK)
                {
                    this.filteredItemsUI.End();
                    value = this.filteredItemsUI.Value;
                    componentChangeService.OnComponentChanged(context.Instance, TypeDescriptor.GetProperties(context.Instance)["Items"], null, null);
                    return(value);
                }
            }
            return(value);
        }
Пример #31
0
 private void ToggleHabilitarMenuItems(RadItemOwnerCollection items)
 {
     foreach (object item in items)
     {
         var subItem = item as RadMenuItem;
         if (subItem != null)
         {
             if (subItem.Items.Any())
             {
                 subItem.Enabled = IsItemEnabled(subItem);
                 ToggleHabilitarMenuItems(subItem.Items);
             }
             else
             {
                 subItem.Enabled = IsItemEnabled(subItem);
             }
         }
     }
 }