示例#1
0
        public override bool CanCollapseToStep(int nextStep)
        {
            if (nextStep < this.CollapseStep)
            {
                return(false);
            }
            switch (nextStep)
            {
            case 1:
                return(true);

            case 2:
                if (this.button.Children.Count < 2)
                {
                    return(false);
                }
                ImageAndTextLayoutPanel child = this.button.Children[1] as ImageAndTextLayoutPanel;
                return(child != null && child.Children.Count >= 2 && this.button.DisplayStyle == DisplayStyle.ImageAndText);

            case 3:
                return(this.button.SmallImage != null || this.button.SmallImageIndex != -1 || !(this.button.SmallImageKey == string.Empty));

            default:
                return(false);
            }
        }
示例#2
0
        private bool ChangeTextVisibility(ImageAndTextLayoutPanel imageAndTextPanel, bool display)
        {
            if (imageAndTextPanel.DisplayStyle != DisplayStyle.ImageAndText)
            {
                return(false);
            }

            if ((button.Image == null) && (button.ImageIndex == -1) && (button.ImageKey == string.Empty))
            {
                return(false);
            }

            RadElement textElement = imageAndTextPanel.Children[1];

            if (display && (textElement.Visibility == ElementVisibility.Collapsed))
            {
                textElement.Visibility = ElementVisibility.Visible;
                textElement.InvalidateMeasure();
                return(true);
            }
            if (!display && (textElement.Visibility == ElementVisibility.Visible))
            {
                textElement.Visibility = ElementVisibility.Collapsed;
                textElement.InvalidateMeasure();
                return(true);
            }
            return(false);
        }
示例#3
0
        private RadElement CreateHeaderColumnElement()
        {
            headerElement            = new RadElement();
            headerElement.Visibility = ElementVisibility.Collapsed;

            // fill
            headerColumnFill       = new FillPrimitive();
            headerColumnFill.Class = "RadSubMenuPanelHeaderFill";
            headerElement.Children.Add(headerColumnFill);

            // border
            headerColumnBorder       = new BorderPrimitive();
            headerColumnBorder.Class = "RadSubMenuPanelHeaderBorder";
            headerElement.Children.Add(headerColumnBorder);

            headerColumnElement                = new ImageAndTextLayoutPanel();
            headerColumnElement.Class          = "RadSubMenuPanelHeaderColumn";
            headerColumnElement.ZIndex         = 1;
            headerColumnElement.AngleTransform = 270;
            headerElement.Children.Add(headerColumnElement);

            // text
            headerColumnText = new TextPrimitive();
            headerColumnText.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            headerColumnText.Class = "RadMenuItemTextPrimitive";
            headerColumnElement.Children.Add(headerColumnText);

            // image
            headerColumnImage = new ImagePrimitive();
            headerColumnImage.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);
            headerColumnImage.Class = "RadMenuItemImagePrimitive";
            headerColumnElement.Children.Add(this.headerColumnImage);

            return(headerElement);
        }
示例#4
0
        private RadElement CreateHeaderColumnElement()
        {
            this.headerElement            = new RadElement();
            this.headerElement.Visibility = ElementVisibility.Collapsed;
            this.headerColumnFill         = new FillPrimitive();
            this.headerColumnFill.Class   = "RadSubMenuPanelHeaderFill";
            this.headerElement.Children.Add((RadElement)this.headerColumnFill);
            this.headerColumnBorder       = new BorderPrimitive();
            this.headerColumnBorder.Class = "RadSubMenuPanelHeaderBorder";
            this.headerElement.Children.Add((RadElement)this.headerColumnBorder);
            this.headerColumnElement                = new ImageAndTextLayoutPanel();
            this.headerColumnElement.Class          = "RadSubMenuPanelHeaderColumn";
            this.headerColumnElement.ZIndex         = 1;
            this.headerColumnElement.AngleTransform = 270f;
            this.headerElement.Children.Add((RadElement)this.headerColumnElement);
            this.headerColumnText = new TextPrimitive();
            int num1 = (int)this.headerColumnText.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);

            this.headerColumnText.Class = "RadMenuItemTextPrimitive";
            this.headerColumnElement.Children.Add((RadElement)this.headerColumnText);
            this.headerColumnImage = new ImagePrimitive();
            int num2 = (int)this.headerColumnImage.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);

            this.headerColumnImage.Class = "RadMenuItemImagePrimitive";
            this.headerColumnElement.Children.Add((RadElement)this.headerColumnImage);
            return(this.headerElement);
        }
示例#5
0
        public override bool CanExpandToStep(int nextStep)
        {
            if (nextStep == this.CollapseStep && nextStep != this.CollapseMaxSteps)
            {
                return(false);
            }
            switch (nextStep)
            {
            case 1:
                return(true);

            case 2:
                if (this.button.Children.Count < 2)
                {
                    return(false);
                }
                ImageAndTextLayoutPanel child = this.button.Children[1] as ImageAndTextLayoutPanel;
                return(child != null && child.Children.Count >= 2 && (this.button.DisplayStyle == DisplayStyle.ImageAndText && this.button.TextImageRelation != TextImageRelation.ImageAboveText) && this.button.TextImageRelation != TextImageRelation.TextAboveImage);

            case 3:
                if (this.button.SmallImage == null && this.button.SmallImageIndex == -1)
                {
                    return(!(this.button.SmallImageKey == string.Empty));
                }
                return(true);

            default:
                return(false);
            }
        }
示例#6
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive         = new FillPrimitive();
            fillPrimitive.Class        = "ListBoxItemSelectionFill";
            fillPrimitive.Visibility   = ElementVisibility.Hidden;
            fillPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

            this.borderElement              = new BorderPrimitive();
            this.borderElement.Class        = "ListBoxItemSelectionBorder";
            this.borderElement.Visibility   = ElementVisibility.Hidden;
            this.borderElement.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

            this.imagePrimitive = new ImagePrimitive();
            this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadListBoxItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadListBoxItem.ImageProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadListBoxItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.textPrimitive             = new TextPrimitive();
            this.textPrimitive.Class       = "ListBoxItemText";
            this.textPrimitive.UseMnemonic = false;
            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadListBoxItem.TextProperty, PropertyBindingOptions.OneWay);
            this.textPrimitive.BindProperty(TextPrimitive.AlignmentProperty, this, RadListBoxItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);

            this.descriptionTextPrimitive             = new TextPrimitive();
            this.descriptionTextPrimitive.Class       = "ListBoxItemDescriptionText";
            this.descriptionTextPrimitive.UseMnemonic = false;
            this.descriptionTextPrimitive.BindProperty(TextPrimitive.FontProperty, this, RadListBoxItem.DescriptionFontProperty, PropertyBindingOptions.OneWay);

            StackLayoutPanel textPanel = new StackLayoutPanel();

            textPanel.Orientation        = Orientation.Vertical;
            textPanel.EqualChildrenWidth = true;
            textPanel.Children.Add(this.textPrimitive);

            textSeparator = new RadMenuSeparatorItem();
            textSeparator.NotifyParentOnMouseInput = true;
            textSeparator.Class        = "ListBoxItemTextSeparator";
            textSeparator.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            textSeparator.Visibility   = ElementVisibility.Collapsed;

            textPanel.Children.Add(textSeparator);
            textPanel.Children.Add(this.descriptionTextPrimitive);
            textPanel.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);

            this.layoutPanel = new ImageAndTextLayoutPanel();
            this.layoutPanel.StretchHorizontally = false;
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadListBoxItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadListBoxItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadListBoxItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadListBoxItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.Children.Add(this.imagePrimitive);
            this.layoutPanel.Children.Add(textPanel);

            this.Children.Add(fillPrimitive);
            this.Children.Add(this.borderElement);
            this.Children.Add(this.layoutPanel);
        }
示例#7
0
        protected override void CreateChildElements()
        {
            this.internalLayoutPanel       = (ImageAndTextLayoutPanel) new MenuImageAndTextLayout();
            this.internalLayoutPanel.Class = "RadMenuItemInternalLayoutPanel";
            this.Children.Add((RadElement)this.internalLayoutPanel);
            this.checkmark = new RadMenuCheckmark();
            int num1 = (int)this.checkmark.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);

            this.checkmark.Alignment = ContentAlignment.MiddleCenter;
            this.checkmark.CheckElement.Alignment = ContentAlignment.MiddleCenter;
            this.checkmark.CheckElement.Class     = "RadMenuItemCheckPrimitive";
            this.internalLayoutPanel.Children.Add((RadElement)this.checkmark);
            this.imagePrimitive = new ImagePrimitive();
            int num2 = (int)this.imagePrimitive.SetValue(RadCheckmark.IsImageProperty, (object)true);

            this.imagePrimitive.Class     = "RadMenuItemImagePrimitive";
            this.imagePrimitive.Alignment = ContentAlignment.MiddleCenter;
            this.imagePrimitive.ZIndex    = this.checkmark.ZIndex + 1;
            this.checkmark.Children.Add((RadElement)this.imagePrimitive);
            this.textPanel = new StackLayoutPanel();
            this.textPanel.StretchHorizontally = false;
            this.textPanel.StretchVertically   = false;
            this.textPanel.Class              = "RadMenuItemTextPanel";
            this.textPanel.Orientation        = Orientation.Vertical;
            this.textPanel.EqualChildrenWidth = true;
            int num3 = (int)this.textPanel.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);

            this.internalLayoutPanel.Children.Add((RadElement)this.textPanel);
            this.textPrimitive = new TextPrimitive();
            int num4 = (int)this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);

            this.textPrimitive.Class = "RadMenuItemTextPrimitive";
            this.textPanel.Children.Add((RadElement)this.textPrimitive);
            this.textSeparator            = new LinePrimitive();
            this.textSeparator.Class      = "RadMenuItemTextSeparator";
            this.textSeparator.Visibility = ElementVisibility.Collapsed;
            this.textPanel.Children.Add((RadElement)this.textSeparator);
            this.descriptionTextPrimitive       = new TextPrimitive();
            this.descriptionTextPrimitive.Class = "RadMenuItemDescriptionText";
            this.textPanel.Children.Add((RadElement)this.descriptionTextPrimitive);
            this.shortcutTextPrimitive            = new TextPrimitive();
            this.shortcutTextPrimitive.Class      = "RadMenuItemShortcutPrimitive";
            this.shortcutTextPrimitive.Visibility = ElementVisibility.Collapsed;
            this.Children.Add((RadElement)this.shortcutTextPrimitive);
            this.arrowPrimitive               = new ArrowPrimitive();
            this.arrowPrimitive.Visibility    = ElementVisibility.Hidden;
            this.arrowPrimitive.Direction     = this.RightToLeft ? Telerik.WinControls.ArrowDirection.Left : Telerik.WinControls.ArrowDirection.Right;
            this.arrowPrimitive.Alignment     = ContentAlignment.MiddleLeft;
            this.arrowPrimitive.Class         = "RadMenuItemArrowPrimitive";
            this.arrowPrimitive.SmoothingMode = SmoothingMode.Default;
            this.arrowPrimitive.MinSize       = Size.Empty;
            this.arrowPrimitive.MaxSize       = Size.Empty;
            this.Children.Add((RadElement)this.arrowPrimitive);
        }
示例#8
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive              = new FillPrimitive();
            this.fillPrimitive.Class        = "ButtonFill";
            this.fillPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

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

            this.textPrimitive = new TextPrimitive();
            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadButtonItem.TextProperty, PropertyBindingOptions.OneWay);

            this.imagePrimitive = new ImagePrimitive();
            this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.UseSmallImageListProperty, this, RadButtonElement.UseSmallImageListProperty, PropertyBindingOptions.TwoWay);

            this.layoutPanel = new ImageAndTextLayoutPanel();
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.AutoSizeModeProperty, this, RadButtonItem.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(RadElement.StretchHorizontallyProperty, this, RadElement.StretchHorizontallyProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(RadElement.StretchVerticallyProperty, this, RadElement.StretchVerticallyProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.Children.Add(this.imagePrimitive);
            this.layoutPanel.Children.Add(this.textPrimitive);
            //p.p. 6.4.2009 fix bug with text layout
            this.textPrimitive.BindProperty(RadElement.AlignmentProperty, this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.imagePrimitive.BindProperty(RadElement.AlignmentProperty, this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            //end add
            this.borderPrimitive.ZIndex = 2;
            this.borderPrimitive.BindProperty(RadElement.IsItemFocusedProperty, this, RadElement.IsFocusedProperty, PropertyBindingOptions.OneWay);

            FocusPrimitive focusPrimitive = new FocusPrimitive(this.borderPrimitive);

            focusPrimitive.ZIndex     = 4;
            focusPrimitive.Visibility = ElementVisibility.Hidden;
            focusPrimitive.Class      = "ButtonFocus";
            this.layoutPanel.ZIndex   = 3;

            focusPrimitive.BindProperty(RadElement.IsItemFocusedProperty, this, RadElement.IsFocusedProperty, PropertyBindingOptions.OneWay);

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(this.layoutPanel);
            this.Children.Add(this.borderPrimitive);
            this.Children.Add(focusPrimitive);
        }
示例#9
0
        override public bool CanExpandToStep(int nextStep)
        {
            if (nextStep == this.CollapseStep && nextStep != this.CollapseMaxSteps)
            {
                return(false);
            }

            if (nextStep == 1)
            {
                return(true);
            }

            if (nextStep == (int)ChunkVisibilityState.SmallImages)
            {
                return(!(((button.SmallImage == null) &&
                          (button.SmallImageIndex == -1) &&
                          (button.SmallImageKey == string.Empty))));
            }

            if (nextStep == (int)ChunkVisibilityState.NoText)
            {
                if (button.Children.Count < 2)
                {
                    return(false);
                }

                ImageAndTextLayoutPanel imageAndTextPanel = button.Children[1] as ImageAndTextLayoutPanel;

                if (imageAndTextPanel == null)
                {
                    return(false);
                }

                if (imageAndTextPanel.Children.Count < 2)
                {
                    return(false);
                }

                if (button.DisplayStyle != DisplayStyle.ImageAndText)
                {
                    return(false);
                }

                if ((imageAndTextPanel.TextImageRelation != TextImageRelation.ImageBeforeText) &&
                    (imageAndTextPanel.TextImageRelation != TextImageRelation.TextBeforeImage))
                {
                    return(false);
                }
                return(true);
            }
            return(false);
        }
示例#10
0
        override public bool CanCollapseToStep(int nextStep)
        {
            if (nextStep < this.CollapseStep)
            {
                return(false);
            }

            if (nextStep == (int)ChunkVisibilityState.Expanded)
            {
                return(true);
            }

            if (nextStep == (int)ChunkVisibilityState.SmallImages)
            {
                bool result = !((button.SmallImage == null) &&
                                (button.SmallImageIndex == -1) &&
                                (button.SmallImageKey == string.Empty));

                return(result);
            }

            if (nextStep == (int)ChunkVisibilityState.NoText)
            {
                if (button.Children.Count < 2)
                {
                    return(false);
                }

                ImageAndTextLayoutPanel imageAndTextPanel = button.Children[1] as ImageAndTextLayoutPanel;

                if (imageAndTextPanel == null)
                {
                    return(false);
                }

                if (imageAndTextPanel.Children.Count < 2)
                {
                    return(false);
                }

                if (button.DisplayStyle != DisplayStyle.ImageAndText)
                {
                    return(false);
                }


                return(true);
            }
            return(false);
        }
示例#11
0
        protected override void CreateChildElements()
        {
            this.borderPrimitive = new BorderPrimitive();
            this.borderPrimitive.FitToSizeMode = RadFitToSizeMode.FitToParentContent;
            this.borderPrimitive.Visibility    = ElementVisibility.Hidden;

            this.fillPrimitive            = new FillPrimitive();
            this.fillPrimitive.BackColor  = Color.Transparent;
            this.fillPrimitive.BackColor2 = Color.Transparent;
            this.fillPrimitive.BackColor3 = Color.Transparent;
            this.fillPrimitive.BackColor4 = Color.Transparent;

            this.textPrimitive           = new TextPrimitive();
            this.textPrimitive.Alignment = ContentAlignment.TopLeft;
            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadLabelElement.TextProperty, PropertyBindingOptions.TwoWay);
            this.textPrimitive.BindProperty(AlignmentProperty, this, RadLabelElement.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.textPrimitive.AutoEllipsis = true;
            this.textPrimitive.TextWrap     = true;

            this.imagePrimitive = new ImagePrimitive();
            this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadLabelElement.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadLabelElement.ImageProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadLabelElement.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.layoutPanel = new ImageAndTextLayoutPanel();
            this.layoutPanel.UseNewLayoutSystem = this.UseNewLayoutSystem;
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.AutoSizeModeProperty, this, RadLabelElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(RadElement.StretchHorizontallyProperty, this, RadElement.StretchHorizontallyProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(RadElement.StretchVerticallyProperty, this, RadElement.StretchVerticallyProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadLabelElement.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.TextAlignment = (this.RightToLeft) ? ContentAlignment.TopRight : ContentAlignment.TopLeft;

            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadLabelElement.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadLabelElement.TextImageRelationProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.Children.Add(this.imagePrimitive);
            this.layoutPanel.Children.Add(this.textPrimitive);

            this.borderPrimitive.ZIndex = 2;
            this.borderPrimitive.BindProperty(RadElement.IsItemFocusedProperty, this, RadElement.IsFocusedProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.ZIndex = 3;

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(this.borderPrimitive);
            this.Children.Add(this.layoutPanel);
        }
示例#12
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            this.textPrimitive      = new TextPrimitive();
            this.imagePrimitive     = new ImagePrimitive();
            this.imageAndTextLayout = new ImageAndTextLayoutPanel();
            int num1 = (int)this.BindProperty(RadItem.TextProperty, (RadObject)this.textPrimitive, RadItem.TextProperty, PropertyBindingOptions.TwoWay);
            int num2 = (int)this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);
            int num3 = (int)this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);

            this.imageAndTextLayout.Children.Add((RadElement)this.imagePrimitive);
            this.imageAndTextLayout.Children.Add((RadElement)this.textPrimitive);
            this.Children.Add((RadElement)this.imageAndTextLayout);
            this.Class = nameof(GroupBoxHeader);
        }
示例#13
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            this.textPrimitive      = new TextPrimitive();
            this.imagePrimitive     = new ImagePrimitive();
            this.imageAndTextLayout = new ImageAndTextLayoutPanel();
            int num1 = (int)this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);
            int num2 = (int)this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);

            this.imageAndTextLayout.Children.Add((RadElement)this.imagePrimitive);
            this.imageAndTextLayout.Children.Add((RadElement)this.textPrimitive);
            this.Children.Add((RadElement)this.imageAndTextLayout);
            this.Class      = nameof(GroupBoxFooter);
            this.Visibility = ElementVisibility.Collapsed;
        }
示例#14
0
        protected override void CreateChildElements()
        {
            fillPrimitive              = new FillPrimitive();
            fillPrimitive.Class        = "GalleryItemSelectionFill";
            fillPrimitive.Visibility   = ElementVisibility.Hidden;
            fillPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

            borderPrimitive              = new BorderPrimitive();
            borderPrimitive.Class        = "GalleryItemSelectionBorder";
            borderPrimitive.Visibility   = ElementVisibility.Hidden;
            borderPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

            this.imagePrimitive = new ImagePrimitive();
            this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadGalleryItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadGalleryItem.ImageProperty, PropertyBindingOptions.TwoWay);
            this.imagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadGalleryItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            textPrimitive       = new TextPrimitive();
            textPrimitive.Class = "GalleryItemText";
            textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadGalleryItem.TextProperty, PropertyBindingOptions.OneWay);
            textPrimitive.BindProperty(TextPrimitive.AlignmentProperty, this, RadGalleryItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);

            this.descriptionTextPrimitive       = new TextPrimitive();
            this.descriptionTextPrimitive.Class = "GalleryItemDescriptionText";
            this.descriptionTextPrimitive.BindProperty(TextPrimitive.FontProperty, this, RadGalleryItem.DescriptionFontProperty, PropertyBindingOptions.OneWay);

            StackLayoutPanel textPanel = new StackLayoutPanel();

            textPanel.Orientation        = Orientation.Vertical;
            textPanel.EqualChildrenWidth = true;
            textPanel.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            textPanel.Children.Add(textPrimitive);
            textPanel.Children.Add(this.descriptionTextPrimitive);


            this.layoutPanel = new ImageAndTextLayoutPanel();
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadGalleryItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadGalleryItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadGalleryItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadGalleryItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.Children.Add(imagePrimitive);
            this.layoutPanel.Children.Add(textPanel);

            this.Children.Add(fillPrimitive);
            this.Children.Add(borderPrimitive);
            this.Children.Add(this.layoutPanel);
        }
示例#15
0
        protected override void CreateChildElements()
        {
            this.contentPanel         = new RadTabStripContentPanel();
            this.contentPanel.Visible = false;
            this.contentPanel.SetAssociatedItem(this);
            this.contentPanelHost = new RadHostItem(contentPanel);
            this.contentPanelHost.SetDefaultValueOverride(RadElement.AutoSizeModeProperty, RadAutoSizeMode.FitToAvailableSize);

            // When the docking is being shown for the first time an exception in TabItem was thrown.
            this.textPrimitive = new TextPrimitive();
            this.image         = new ImagePrimitive();

            this.fill       = new FillPrimitive();
            this.fill.Class = "TabFill";
            this.Children.Add(this.fill);

            this.tabBorder              = new BorderPrimitive();
            this.tabBorder.Class        = "TabItemBorder";
            this.tabBorder.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.Children.Add(this.tabBorder);

            this.layout = new ImageAndTextLayoutPanel();
            this.layout.UseNewLayoutSystem  = this.UseNewLayoutSystem;
            this.layout.StretchHorizontally = true;
            this.layout.StretchVertically   = true;

            this.layout.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, TabItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.layout.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, TabItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layout.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, TabItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layout.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, TabItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);

            this.Children.Add(this.layout);

            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadItem.TextProperty, PropertyBindingOptions.OneWay);
            this.textPrimitive.Class    = "TabItemText";
            this.textPrimitive.AutoSize = true;
            this.layout.Children.Add(this.textPrimitive);

            this.image.Class = "TabItemImage";
            this.image.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);

            this.image.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.image.BindProperty(ImagePrimitive.ImageProperty, this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            this.image.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.layout.Children.Add(image);
        }
示例#16
0
        private void LocalizeForm()
        {
            RadGridLocalizationProvider currentProvider = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider;

            this.Text = string.Format(currentProvider.GetLocalizedString("CustomFilterDialogCaption"), (object)this.column.HeaderText);
            this.radLabelFormTitle.Text      = currentProvider.GetLocalizedString("CustomFilterDialogLabel");
            this.radioButtonAndOperator.Text = currentProvider.GetLocalizedString("CustomFilterDialogRbAnd");
            this.radioButtonOrOperator.Text  = currentProvider.GetLocalizedString("CustomFilterDialogRbOr");
            this.radButtonOK.Text            = currentProvider.GetLocalizedString("CustomFilterDialogBtnOk");
            this.radButtonCancel.Text        = currentProvider.GetLocalizedString("CustomFilterDialogBtnCancel");
            this.rchbNot.Text = currentProvider.GetLocalizedString("CustomFilterDialogCheckBoxNot");
            ImageAndTextLayoutPanel child = this.groupBox.RootElement.Children[0].Children[1].Children[2] as ImageAndTextLayoutPanel;

            (child.Children[1] as TextPrimitive).Text = "      " + this.rchbNot.Text;
            child.Visibility = ElementVisibility.Hidden;
        }
示例#17
0
        protected override void CreateChildElements()
        {
            this.borderPrimitive = new BorderPrimitive();
            this.borderPrimitive.FitToSizeMode = RadFitToSizeMode.FitToParentContent;
            this.borderPrimitive.Visibility    = ElementVisibility.Hidden;
            this.borderPrimitive.SmoothingMode = SmoothingMode.Default;
            this.fillPrimitive            = new FillPrimitive();
            this.fillPrimitive.BackColor  = Color.Transparent;
            this.fillPrimitive.BackColor2 = Color.Transparent;
            this.fillPrimitive.BackColor3 = Color.Transparent;
            this.fillPrimitive.BackColor4 = Color.Transparent;
            this.textPrimitive            = new TextPrimitive();
            this.textPrimitive.Alignment  = ContentAlignment.MiddleLeft;
            int num1 = (int)this.textPrimitive.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.TwoWay);
            int num2 = (int)this.textPrimitive.BindProperty(RadElement.AlignmentProperty, (RadObject)this, RadLabelElement.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            int num3 = (int)this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);

            this.textPrimitive.AutoEllipsis = true;
            this.textPrimitive.TextWrap     = true;
            this.imagePrimitive             = new ImagePrimitive();
            int num4 = (int)this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);
            int num5 = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadLabelElement.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num6 = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadLabelElement.ImageProperty, PropertyBindingOptions.TwoWay);
            int num7 = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadLabelElement.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.layoutPanel = new ImageAndTextLayoutPanel();
            int num8  = (int)this.layoutPanel.BindProperty(RadElement.StretchHorizontallyProperty, (RadObject)this, RadElement.StretchHorizontallyProperty, PropertyBindingOptions.OneWay);
            int num9  = (int)this.layoutPanel.BindProperty(RadElement.StretchVerticallyProperty, (RadObject)this, RadElement.StretchVerticallyProperty, PropertyBindingOptions.OneWay);
            int num10 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, (RadObject)this, RadLabelElement.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            int num11 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, (RadObject)this, RadLabelElement.TextAlignmentProperty, PropertyBindingOptions.TwoWay);
            int num12 = (int)this.layoutPanel.BindProperty(RadLabelElement.TextAlignmentProperty, (RadObject)this, RadLabelElement.TextAlignmentProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.ClipDrawing = true;
            int num13 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, (RadObject)this, RadLabelElement.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            int num14 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, (RadObject)this, RadLabelElement.TextImageRelationProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.Children.Add((RadElement)this.imagePrimitive);
            this.layoutPanel.Children.Add((RadElement)this.textPrimitive);
            this.borderPrimitive.ZIndex = 2;
            int num15 = (int)this.borderPrimitive.BindProperty(RadElement.IsItemFocusedProperty, (RadObject)this, RadElement.IsFocusedProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.ZIndex = 3;
            this.Children.Add((RadElement)this.fillPrimitive);
            this.Children.Add((RadElement)this.borderPrimitive);
            this.Children.Add((RadElement)this.layoutPanel);
        }
示例#18
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive                = new FillPrimitive();
            this.fillPrimitive.Class          = "GalleryItemSelectionFill";
            this.fillPrimitive.Visibility     = ElementVisibility.Hidden;
            this.fillPrimitive.AutoSizeMode   = RadAutoSizeMode.FitToAvailableSize;
            this.borderPrimitive              = new BorderPrimitive();
            this.borderPrimitive.Class        = "GalleryItemSelectionBorder";
            this.borderPrimitive.Visibility   = ElementVisibility.Hidden;
            this.borderPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.borderPrimitive.ZIndex       = 100;
            this.imagePrimitive               = new ImagePrimitive();
            int num1 = (int)this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);
            int num2 = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num3 = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            int num4 = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.textPrimitive       = new TextPrimitive();
            this.textPrimitive.Class = "GalleryItemText";
            int num5 = (int)this.textPrimitive.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.OneWay);
            int num6 = (int)this.textPrimitive.BindProperty(RadElement.AlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);

            this.descriptionTextPrimitive       = new TextPrimitive();
            this.descriptionTextPrimitive.Class = "GalleryItemDescriptionText";
            int num7 = (int)this.descriptionTextPrimitive.BindProperty(VisualElement.FontProperty, (RadObject)this, RadGalleryItem.DescriptionFontProperty, PropertyBindingOptions.OneWay);
            StackLayoutPanel stackLayoutPanel = new StackLayoutPanel();

            stackLayoutPanel.Orientation        = Orientation.Vertical;
            stackLayoutPanel.EqualChildrenWidth = true;
            int num8 = (int)stackLayoutPanel.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);

            stackLayoutPanel.Children.Add((RadElement)this.textPrimitive);
            stackLayoutPanel.Children.Add((RadElement)this.descriptionTextPrimitive);
            this.layoutPanel = new ImageAndTextLayoutPanel();
            int num9  = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, (RadObject)this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            int num10 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            int num11 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            int num12 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, (RadObject)this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.Children.Add((RadElement)this.imagePrimitive);
            this.layoutPanel.Children.Add((RadElement)stackLayoutPanel);
            this.Children.Add((RadElement)this.fillPrimitive);
            this.Children.Add((RadElement)this.borderPrimitive);
            this.Children.Add((RadElement)this.layoutPanel);
        }
示例#19
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive          = new FillPrimitive();
            this.fillPrimitive.Class    = "ButtonFill";
            this.borderPrimitive        = new BorderPrimitive();
            this.borderPrimitive.Class  = "ButtonBorder";
            this.borderPrimitive.ZIndex = 2;
            int num1 = (int)this.borderPrimitive.BindProperty(RadElement.IsItemFocusedProperty, (RadObject)this, RadElement.IsFocusedProperty, PropertyBindingOptions.OneWay);

            this.textPrimitive = new TextPrimitive();
            int num2 = (int)this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);
            int num3 = (int)this.textPrimitive.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.OneWay);
            int num4 = (int)this.textPrimitive.BindProperty(TextPrimitive.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);

            this.imagePrimitive = new ImagePrimitive();
            int num5  = (int)this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);
            int num6  = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num7  = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            int num8  = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            int num9  = (int)this.imagePrimitive.BindProperty(ImagePrimitive.UseSmallImageListProperty, (RadObject)this, RadButtonElement.UseSmallImageListProperty, PropertyBindingOptions.TwoWay);
            int num10 = (int)this.imagePrimitive.BindProperty(RadElement.AlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel        = new ImageAndTextLayoutPanel();
            this.layoutPanel.ZIndex = 3;
            int num11 = (int)this.layoutPanel.BindProperty(RadElement.StretchHorizontallyProperty, (RadObject)this, RadElement.StretchHorizontallyProperty, PropertyBindingOptions.OneWay);
            int num12 = (int)this.layoutPanel.BindProperty(RadElement.StretchVerticallyProperty, (RadObject)this, RadElement.StretchVerticallyProperty, PropertyBindingOptions.OneWay);
            int num13 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, (RadObject)this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            int num14 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            int num15 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            int num16 = (int)this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, (RadObject)this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);

            this.layoutPanel.Children.Add((RadElement)this.imagePrimitive);
            this.layoutPanel.Children.Add((RadElement)this.textPrimitive);
            this.focusPrimitive            = new FocusPrimitive(this.borderPrimitive);
            this.focusPrimitive.Class      = "ButtonFocus";
            this.focusPrimitive.ZIndex     = 4;
            this.focusPrimitive.Visibility = ElementVisibility.Hidden;
            int num17 = (int)this.focusPrimitive.BindProperty(RadElement.IsItemFocusedProperty, (RadObject)this, RadElement.IsFocusedProperty, PropertyBindingOptions.OneWay);

            this.Children.Add((RadElement)this.fillPrimitive);
            this.Children.Add((RadElement)this.layoutPanel);
            this.Children.Add((RadElement)this.borderPrimitive);
            this.Children.Add((RadElement)this.focusPrimitive);
        }
示例#20
0
        /// <summary>
        /// Creates child elements. Please refer to TPF documentation for more information.
        /// </summary>
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.textPrimitive      = new TextPrimitive();
            this.imagePrimitive     = new ImagePrimitive();
            this.imageAndTextLayout = new ImageAndTextLayoutPanel();
            this.imageAndTextLayout.UseNewLayoutSystem = true;
            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);

            this.imageAndTextLayout.Children.Add(imagePrimitive);
            this.imageAndTextLayout.Children.Add(textPrimitive);
            this.Children.Add(imageAndTextLayout);

            this.Class = "GroupBoxFooter";

            this.Visibility = ElementVisibility.Collapsed;
        }
示例#21
0
        private bool ChangeItemVisibility(bool display, bool changeImages)
        {
            bool visibilityChanged = false;

            if (button == null)
            {
                return(visibilityChanged);
            }

            if (!changeImages && (button.DisplayStyle != DisplayStyle.ImageAndText))
            {
                return(visibilityChanged);
            }

            if (button.Children.Count < 2)
            {
                return(visibilityChanged);
            }

            ImageAndTextLayoutPanel imageAndTextPanel = button.Children[1] as ImageAndTextLayoutPanel;

            if (imageAndTextPanel == null)
            {
                return(visibilityChanged);
            }

            if (imageAndTextPanel.Children.Count < 2)
            {
                return(visibilityChanged);
            }

            if (!changeImages && ChangeTextVisibility(imageAndTextPanel, display))
            {
                visibilityChanged = true;
            }

            if (changeImages && ChangeImages(display))
            {
                visibilityChanged = true;
            }

            return(visibilityChanged);
        }
示例#22
0
        public CSToggleButton2()
        {
            Telerik.WinControls.Primitives.FillPrimitive prmFill = (Telerik.WinControls.Primitives.FillPrimitive) this.ButtonElement.Children[0];
            ImageAndTextLayoutPanel imgTxtPanel = (ImageAndTextLayoutPanel)this.ButtonElement.Children[1];

            Telerik.WinControls.Primitives.BorderPrimitive prmBorder = (Telerik.WinControls.Primitives.BorderPrimitive) this.ButtonElement.Children[2];
            Telerik.WinControls.Primitives.FocusPrimitive  prmFocus  = (Telerik.WinControls.Primitives.FocusPrimitive) this.ButtonElement.Children[3];

            prmFill.GradientStyle = GradientStyles.OfficeGlassRect;
            prmFill.BackColor     = prmFill.BackColor2 = prmFill.BackColor3 = prmFill.BackColor4 = Color.Transparent;

            prmBorder.Visibility = ElementVisibility.Hidden;
            prmBorder.Margin     = new System.Windows.Forms.Padding(4);

            prmFocus.Visibility = ElementVisibility.Hidden;

            this.ToggleStateChanged += new StateChangedEventHandler(CSToggleButton2_ToggleStateChanged);
            this.MouseEnter         += new EventHandler(CSToggleButton2_MouseEnter);
            this.MouseLeave         += new EventHandler(CSToggleButton2_MouseLeave);
        }
示例#23
0
        private bool ChangeTextVisibility(ImageAndTextLayoutPanel imageAndTextPanel, bool display)
        {
            if (imageAndTextPanel.DisplayStyle != DisplayStyle.ImageAndText || this.button.Image == null && this.button.ImageIndex == -1 && this.button.ImageKey == string.Empty)
            {
                return(false);
            }
            RadElement child = imageAndTextPanel.Children[1];

            if (display && child.Visibility == ElementVisibility.Collapsed)
            {
                child.Visibility = ElementVisibility.Visible;
                child.InvalidateMeasure();
                return(true);
            }
            if (display || child.Visibility != ElementVisibility.Visible)
            {
                return(false);
            }
            child.Visibility = ElementVisibility.Collapsed;
            child.InvalidateMeasure();
            return(true);
        }
示例#24
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.textPrimitive             = new TextPrimitive();
            this.textPrimitive.UseMnemonic = false;

            this.imagePrimitive = new ImagePrimitive();


            this.imageAndTextLayout = new ImageAndTextLayoutPanel();
            this.BindProperty(RadItem.TextProperty, this.textPrimitive, RadItem.TextProperty, PropertyBindingOptions.TwoWay);
            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.imagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);

            imageAndTextLayout.Children.Add(imagePrimitive);
            imageAndTextLayout.Children.Add(textPrimitive);

            this.Children.Add(imageAndTextLayout);

            this.Class = "GroupBoxHeader";
        }
示例#25
0
        private bool ChangeItemVisibility(bool display, bool changeImages)
        {
            bool flag = false;

            if (this.button == null || !changeImages && this.button.DisplayStyle != DisplayStyle.ImageAndText || this.button.Children.Count < 2)
            {
                return(flag);
            }
            ImageAndTextLayoutPanel child = this.button.Children[1] as ImageAndTextLayoutPanel;

            if (child == null || child.Children.Count < 2)
            {
                return(flag);
            }
            if (!changeImages && this.ChangeTextVisibility(child, display))
            {
                flag = true;
            }
            if (changeImages && this.ChangeImages(display))
            {
                flag = true;
            }
            return(flag);
        }
示例#26
0
        protected override void CreateChildElements()
        {
            // text image relation
            this.internalLayoutPanel       = new MenuImageAndTextLayout();
            this.internalLayoutPanel.Class = "RadMenuItemInternalLayoutPanel";
            this.Children.Add(this.internalLayoutPanel);

            // checkbox
            this.checkmark = new RadMenuCheckmark();
            this.checkmark.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, true);
            this.checkmark.Alignment = ContentAlignment.MiddleCenter;
            this.checkmark.CheckElement.Alignment = ContentAlignment.MiddleCenter;
            this.checkmark.CheckElement.Class     = "RadMenuItemCheckPrimitive";
            this.internalLayoutPanel.Children.Add(this.checkmark);

            // image
            this.imagePrimitive = new ImagePrimitive();
            this.imagePrimitive.SetValue(RadCheckmark.IsImageProperty, true);
            this.imagePrimitive.Class     = "RadMenuItemImagePrimitive";
            this.imagePrimitive.Alignment = ContentAlignment.MiddleCenter;
            this.imagePrimitive.ZIndex    = this.checkmark.ZIndex + 1;
            this.checkmark.Children.Add(this.imagePrimitive);

            // menu text + separator + description in a vertical stack panel
            textPanel = new StackLayoutPanel();
            textPanel.StretchHorizontally = false;
            textPanel.StretchVertically   = false;
            textPanel.Class              = "RadMenuItemTextPanel";
            textPanel.Orientation        = Orientation.Vertical;
            textPanel.EqualChildrenWidth = true;
            textPanel.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.internalLayoutPanel.Children.Add(textPanel);

            // text
            this.textPrimitive = new TextPrimitive();
            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.textPrimitive.Class = "RadMenuItemTextPrimitive";
            textPanel.Children.Add(textPrimitive);

            // separator
            textSeparator            = new LinePrimitive();
            textSeparator.Class      = "RadMenuItemTextSeparator";
            textSeparator.Visibility = ElementVisibility.Collapsed;
            textPanel.Children.Add(textSeparator);

            // description
            this.descriptionTextPrimitive       = new TextPrimitive();
            this.descriptionTextPrimitive.Class = "RadMenuItemDescriptionText";
            textPanel.Children.Add(this.descriptionTextPrimitive);

            // shortcuttext
            this.shortcutTextPrimitive            = new TextPrimitive();
            this.shortcutTextPrimitive.Class      = "RadMenuItemShortcutPrimitive";
            this.shortcutTextPrimitive.Visibility = ElementVisibility.Collapsed;
            this.Children.Add(this.shortcutTextPrimitive);

            // arrow
            this.arrowPrimitive               = new ArrowPrimitive();
            this.arrowPrimitive.Visibility    = ElementVisibility.Hidden;
            this.arrowPrimitive.Direction     = (this.RightToLeft) ? ArrowDirection.Left : ArrowDirection.Right;
            this.arrowPrimitive.Alignment     = ContentAlignment.MiddleLeft;
            this.arrowPrimitive.Class         = "RadMenuItemArrowPrimitive";
            this.arrowPrimitive.SmoothingMode = SmoothingMode.Default;
            this.arrowPrimitive.MinSize       = Size.Empty;
            this.arrowPrimitive.MaxSize       = Size.Empty;
            this.Children.Add(this.arrowPrimitive);
        }