示例#1
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);
        }
        /// <summary>
        /// create child items
        /// </summary>
        protected override void CreateChildElements()
        {
            this.borderPrimitive          = new BorderPrimitive();
            this.borderPrimitive.Class    = "RadPanelBorder";
            this.borderPrimitive.BoxStyle = BorderBoxStyle.OuterInnerBorders;

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

            this.textPrimitive           = new TextPrimitive();
            this.textPrimitive.Alignment = ContentAlignment.MiddleLeft;
            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadItem.TextProperty, PropertyBindingOptions.TwoWay);

            this.imagePrimitive           = new ImagePrimitive();
            this.imagePrimitive.Alignment = ContentAlignment.MiddleLeft;


            this.Children.Add(this.fillPrimitive);
            this.Children.Add(this.borderPrimitive);
            this.Children.Add(this.textPrimitive);
            this.Children.Add(this.imagePrimitive);
        }
示例#3
0
        protected override void CreateChildElements()
        {
            // fill
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuHeaderItemFillPrimitive";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.fillPrimitive.Name          = "MenuHeaderItemFill";
            this.Children.Add(this.fillPrimitive);

            // border
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuHeaderItemBorderPrimitive";
            this.borderPrimitive.Name  = "MenuHeaderItemBorder";
            this.Children.Add(this.borderPrimitive);

            // image
            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.Class = "RadMenuHeaderItemImagePrimitive";
            this.Children.Add(this.imagePrimitive);

            this.textPrimitive       = new TextPrimitive();
            this.textPrimitive.Class = "RadMenuHeaderItemText";
            this.Children.Add(this.textPrimitive);

            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadButtonItem.TextProperty, PropertyBindingOptions.TwoWay);
        }
示例#4
0
        /// <summary>
        /// Draw an image primitive and merge the result to the image mesh.
        /// </summary>
        /// <param name="primitive"></param>
        /// <param name="brush"></param>
        public void DrawImage(ImagePrimitive primitive, Brush brush)
        {
            var offset = primitive.Offset;

            //TODO check if we need to add a new draw command
            //add a new draw command
            DrawCommand cmd = new DrawCommand();

            cmd.ClipRect    = Rect.Big;
            cmd.TextureData = null;
            this.ImageMesh.CommandBuffer.Add(cmd);

            var texture = new OSImplentation.Windows.OpenGLTexture();

            texture.LoadImage(primitive.Image.Data, primitive.Image.Width, primitive.Image.Height);

            //construct and merge the mesh of this Path into ShapeMesh
            var uvMin = new Point(0, 0);
            var uvMax = new Point(1, 1);

            this.ImageMesh.PrimReserve(6, 4);
            AddImageRect(
                (Point)primitive.Offset,
                (Point)primitive.Offset + new Vector(primitive.Image.Width, primitive.Image.Height),
                uvMin, uvMax, brush.FillColor);
        }
        protected override void CreateChildElements()
        {
            this.arrow           = new ArrowPrimitive(ArrowDirection.Down);
            this.arrow.Class     = "RadArrowButtonArrow";
            this.arrow.AutoSize  = false;
            this.arrow.Alignment = ContentAlignment.MiddleCenter;

            this.overflowArrow            = new OverflowPrimitive(ArrowDirection.Down);
            this.overflowArrow.Class      = "RadArrowButtonOverflowArrow";
            this.overflowArrow.AutoSize   = false;
            this.overflowArrow.Alignment  = ContentAlignment.MiddleCenter;
            this.overflowArrow.Visibility = ElementVisibility.Collapsed;

            this.fillPrimitive              = new FillPrimitive();
            this.fillPrimitive.Class        = "RadArrowButtonFill";
            this.fillPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

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

            this.imagePrimitive              = new ImagePrimitive();
            this.imagePrimitive.Class        = "RadArrowButtonImage";
            this.imagePrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.imagePrimitive.Alignment    = ContentAlignment.MiddleCenter;

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(this.borderPrimitive);
            this.Children.Add(this.arrow);
            this.Children.Add(this.overflowArrow);
            this.Children.Add(this.imagePrimitive);
        }
 public void DrawSlicedImagePrimitive(Mesh imageMesh,
                                      ImagePrimitive imagePrimitive, Rect rect, StyleRuleSet style, Vector offset)
 {
     this.SetImageMesh(imageMesh);
     this.DrawSlicedImage(imagePrimitive, Rect.Offset(rect, offset), style);
     this.SetImageMesh(null);
 }
示例#7
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);
        }
示例#8
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.Name          = "MenuComboItemFill";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add((RadElement)this.fillPrimitive);
            this.borderPrimitive            = new BorderPrimitive();
            this.borderPrimitive.Visibility = ElementVisibility.Collapsed;
            this.borderPrimitive.Class      = "RadMenuComboItemBorderPrimitive";
            this.borderPrimitive.Name       = "MenuComboItemBorder";
            this.Children.Add((RadElement)this.borderPrimitive);
            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.imagePrimitive.Class = "RadMenuComboItemImagePrimitive";
            this.Children.Add((RadElement)this.imagePrimitive);
            this.comboBoxElement                = new RadDropDownListElement();
            this.comboBoxElement.MinSize        = new Size(100, 20);
            this.comboBoxElement.BindingContext = new BindingContext();
            this.Children.Add((RadElement)this.comboBoxElement);
            if (!this.DesignMode)
            {
                return;
            }
            this.comboBoxElement.ArrowButton.RoutedEventBehaviors.Add((RoutedEventBehavior) new RadMenuComboItem.CancelMouseBehavior());
        }
        public void DrawBoxModel(ImagePrimitive imagePrimitive, Rect rect, StyleRuleSet style)
        {
            GetBoxes(rect, style, out var borderBoxRect, out var paddingBoxRect, out var contentBoxRect);

            this.DrawBackground(style, paddingBoxRect);

            //Content
            //Content-box
            if (contentBoxRect.TopLeft.X < contentBoxRect.TopRight.X)//content should not be visible when contentBoxRect.TopLeft.X > contentBoxRect.TopRight.X
            {
                if (imagePrimitive != null)
                {
                    this.DrawImage(imagePrimitive, contentBoxRect, style);
                }
            }

            this.DrawBorder(style, borderBoxRect, paddingBoxRect);
            this.DrawOutline(style, borderBoxRect);

#if DrawPaddingBox
            PathRect(paddingBoxRect.TopLeft, paddingBoxRect.BottomRight);
            PathStroke(Color.Rgb(0, 100, 100), true, 1);
#endif

#if DrawContentBox
            PathRect(contentBoxRect.TopLeft, cbr);
            PathStroke(Color.Rgb(100, 0, 100), true, 1);
#endif
        }
示例#10
0
        /// <summary>
        /// initializes and adds the child elements
        /// </summary>
        protected override void CreateChildElements()
        {
            this.fillPrimitive              = new FillPrimitive();
            this.fillPrimitive.Class        = "radioButtonFill";
            this.fillPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "radioButtonBorder";

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

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

            this.layoutPanel = new ImageAndTextLayoutPanel();
            this.layoutPanel.UseNewLayoutSystem = this.UseNewLayoutSystem;
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadRadioButtonElement.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadRadioButtonElement.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadRadioButtonElement.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadRadioButtonElement.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.SetValue(CheckBoxLayoutPanel.IsBodyProperty, true);
            this.layoutPanel.Children.Add(this.textPrimitive);
            this.layoutPanel.Children.Add(this.imagePrimitive);

            RadioPrimitive radioPrimitive = new RadioPrimitive();

            radioPrimitive.SetValue(RadRadiomark.IsCheckmarkProperty, true);
            radioPrimitive.Class = "radioButtonPrimitive";

            ImagePrimitive radioImagePrimitive = new ImagePrimitive();

            radioImagePrimitive.SetValue(RadRadiomark.IsImageProperty, true);
            radioImagePrimitive.Class = "radioButtonImagePrimitive";

            this.checkMarkPrimitive = new RadRadiomark();
            this.checkMarkPrimitive.SetValue(CheckBoxLayoutPanel.IsCheckmarkProperty, true);
            this.checkMarkPrimitive.BindProperty(RadRadiomark.CheckStateProperty, this, RadCheckBoxElement.ToggleStateProperty, PropertyBindingOptions.OneWay);
            this.checkMarkPrimitive.Children.Add(radioPrimitive);
            this.checkMarkPrimitive.Children.Add(radioImagePrimitive);
            this.checkMarkPrimitive.NotifyParentOnMouseInput = true;
            this.checkMarkPrimitive.ShouldHandleMouseInput   = false;

            CheckBoxLayoutPanel radioButtonPanel = new CheckBoxLayoutPanel();

            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            radioButtonPanel.BindProperty(CheckBoxLayoutPanel.AutoSizeModeProperty, this, RadRadioButtonElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            radioButtonPanel.BindProperty(CheckBoxLayoutPanel.CheckAlignmentProperty, this, RadRadioButtonElement.RadioCheckAlignmentProperty, PropertyBindingOptions.OneWay);
            radioButtonPanel.Children.Add(layoutPanel);
            radioButtonPanel.Children.Add(this.checkMarkPrimitive);

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(radioButtonPanel);
            this.Children.Add(this.borderPrimitive);
        }
示例#11
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuHeaderItemFillPrimitive";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.fillPrimitive.Name          = "MenuHeaderItemFill";
            this.Children.Add((RadElement)this.fillPrimitive);
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuHeaderItemBorderPrimitive";
            this.borderPrimitive.Name  = "MenuHeaderItemBorder";
            this.Children.Add((RadElement)this.borderPrimitive);
            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.imagePrimitive.Class = "RadMenuHeaderItemImagePrimitive";
            this.Children.Add((RadElement)this.imagePrimitive);
            this.textPrimitive       = new TextPrimitive();
            this.textPrimitive.Class = "RadMenuHeaderItemText";
            this.Children.Add((RadElement)this.textPrimitive);
            int num5 = (int)this.textPrimitive.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.TwoWay);
            int num6 = (int)this.textPrimitive.BindProperty(VisualElement.FontProperty, (RadObject)this, VisualElement.FontProperty, PropertyBindingOptions.TwoWay);
        }
示例#12
0
 protected override void CreateChildElements()
 {
     this.imagePrimitive             = new ImagePrimitive();
     this.imagePrimitive.ImageLayout = ImageLayout.Zoom;
     this.Children.Add((RadElement)this.imagePrimitive);
     this.imagePrimitive.AutoSizeMode  = RadAutoSizeMode.FitToAvailableSize;
     this.imagePrimitive.FitToSizeMode = RadFitToSizeMode.FitToParentBounds;
 }
示例#13
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);
        }
        public void DrawImagePrimitive(Vector offset, Mesh imageMesh,
                                       ImagePrimitive imagePrimitive, Rect rect, StyleRuleSet style)
        {
            imageMesh.Clear();

            this.SetImageMesh(imageMesh);
            this.DrawImage(imagePrimitive, Rect.Offset(rect, offset), style);
            this.SetImageMesh(null);
        }
示例#15
0
 public Symbol(WheelType type)
 {
     this._image           = new ImagePrimitive();
     this._image.Width     = 32;
     this._image.Height    = 32;
     this._random          = new Random();
     this._image.YPosition = 50;
     this.Randomize();
     this.SetPosition(type);
 }
示例#16
0
 private void EnsureImageElement()
 {
     //no foreign image is set, create our own instance
     if (this.imageElement == null)
     {
         this.imageElement           = new ImagePrimitive();
         this.imageElement.Alignment = ContentAlignment.MiddleCenter;
         this.Children.Add(this.imageElement);
     }
 }
示例#17
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.image                     = new ImagePrimitive();
     this.image.ImageLayout         = System.Windows.Forms.ImageLayout.Zoom;
     this.image.StretchVertically   = false;
     this.image.StretchHorizontally = false;
     this.image.MaxSize             = new Size(0, 20);
     this.Children.Insert(0, this.image);
 }
示例#18
0
 private void EnsureImageElement()
 {
     if (this.imageElement != null)
     {
         return;
     }
     this.imageElement           = new ImagePrimitive();
     this.imageElement.Alignment = ContentAlignment.MiddleCenter;
     this.Children.Add((RadElement)this.imageElement);
 }
示例#19
0
		public Symbol(WheelType type)
		{
			this._image = new ImagePrimitive();
			this._image.Width = 32;
			this._image.Height = 32;
			this._random = new Random();
			this._image.YPosition = 50;
			this.Randomize();
			this.SetPosition(type);
		}
示例#20
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.textPrimitive = new TextPrimitive();
            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            this.textPrimitive.BindProperty(TextPrimitive.TextProperty, this, RadCheckBoxElement.TextProperty, PropertyBindingOptions.TwoWay);

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

            this.layoutPanel = new ImageAndTextLayoutPanel();
            this.layoutPanel.UseNewLayoutSystem = this.UseNewLayoutSystem;
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadCheckBoxElement.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadCheckBoxElement.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadCheckBoxElement.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadCheckBoxElement.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.SetValue(CheckBoxLayoutPanel.IsBodyProperty, true);

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

            ImagePrimitive checkImagePrimitive = new ImagePrimitive();

            checkImagePrimitive.SetValue(RadCheckmark.IsImageProperty, true);
            checkImagePrimitive.Class = "RadCheckBoxCheckImage";

            this.checkMarkPrimitive       = new RadCheckmark();
            this.checkMarkPrimitive.Class = "CheckMark";
            this.checkMarkPrimitive.SetValue(CheckBoxLayoutPanel.IsCheckmarkProperty, true);
            this.checkMarkPrimitive.BindProperty(RadCheckmark.CheckStateProperty, this, RadCheckBoxElement.ToggleStateProperty, PropertyBindingOptions.OneWay);
            this.checkMarkPrimitive.CheckElement.Class = "RadCheckBoxCheckPrimitive";
            this.checkMarkPrimitive.Children.Add(checkImagePrimitive);

            CheckBoxLayoutPanel checkBoxPanel = new CheckBoxLayoutPanel();

            this.textPrimitive.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, true);
            checkBoxPanel.BindProperty(CheckBoxLayoutPanel.AutoSizeModeProperty, this, RadCheckBoxElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            checkBoxPanel.BindProperty(CheckBoxLayoutPanel.CheckAlignmentProperty, this, RadCheckBoxElement.CheckAlignmentProperty, PropertyBindingOptions.OneWay);
            checkBoxPanel.Children.Add(layoutPanel);
            checkBoxPanel.Children.Add(checkMarkPrimitive);

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(checkBoxPanel);
            this.Children.Add(this.borderPrimitive);
        }
示例#21
0
            public void DrawOriginalImage()
            {
                var primitive    = new ImagePrimitive(@"assets\images\logo.png");
                var styleRuleSet = new StyleRuleSet {
                    BackgroundColor = Color.White
                };

                CheckExpectedImage(primitive, 300, 400,
                                   new Rect(10, 10, primitive.Image.Width, primitive.Image.Height), styleRuleSet,
                                   @"GraphicsImplementation\Builtin\images\BuiltinPrimitiveRendererFacts.DrawImage.DrawOriginalImage.png");
            }
示例#22
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);
        }
示例#23
0
            public void DrawOneImage()
            {
                var primitive    = new ImagePrimitive(@"assets\images\button.png");
                var styleRuleSet = new StyleRuleSet {
                    BorderImageSlice = (83, 54, 54, 54)
                };

                CheckExpectedImage(primitive, 300, 400,
                                   new Rect(2, 2, primitive.Image.Width + 50, primitive.Image.Height + 100), styleRuleSet,
                                   @"GraphicsImplementation\Builtin\images\BuiltinPrimitiveRendererFacts.DrawSlicedImage.DrawOneImage.png");
            }
示例#24
0
        protected override void CreateChildElements()
        {
            this.ButtonFillElement              = new FillPrimitive();
            this.ButtonFillElement.Class        = "radioButtonFill";
            this.ButtonFillElement.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.BorderElement       = new BorderPrimitive();
            this.BorderElement.Class = "radioButtonBorder";
            this.TextElement         = new TextPrimitive();
            int num1 = (int)this.TextElement.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);
            int num2 = (int)this.TextElement.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.TwoWay);

            this.ImagePrimitive = new ImagePrimitive();
            int num3 = (int)this.ImagePrimitive.SetValue(ImageAndTextLayoutPanel.IsImagePrimitiveProperty, (object)true);
            int num4 = (int)this.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num5 = (int)this.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            int num6 = (int)this.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.ImagePrimitive.Class = "radioButtonLayoutImagePrimitive";
            this.LayoutPanel          = new ImageAndTextLayoutPanel();
            int num7  = (int)this.LayoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, (RadObject)this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            int num8  = (int)this.LayoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            int num9  = (int)this.LayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            int num10 = (int)this.LayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, (RadObject)this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            int num11 = (int)this.LayoutPanel.SetValue(CheckBoxLayoutPanel.IsBodyProperty, (object)true);

            this.LayoutPanel.Children.Add((RadElement)this.TextElement);
            this.LayoutPanel.Children.Add((RadElement)this.ImagePrimitive);
            RadioPrimitive radioPrimitive = new RadioPrimitive();
            int            num12          = (int)radioPrimitive.SetValue(RadRadiomark.IsCheckmarkProperty, (object)true);

            radioPrimitive.Class = "radioButtonPrimitive";
            ImagePrimitive imagePrimitive = new ImagePrimitive();
            int            num13          = (int)imagePrimitive.SetValue(RadRadiomark.IsImageProperty, (object)true);

            imagePrimitive.Class    = "radioButtonImagePrimitive";
            this.checkMarkPrimitive = new RadRadiomark();
            int num14 = (int)this.checkMarkPrimitive.SetValue(CheckBoxLayoutPanel.IsCheckmarkProperty, (object)true);
            int num15 = (int)this.checkMarkPrimitive.BindProperty(RadRadiomark.CheckStateProperty, (RadObject)this, RadToggleButtonElement.ToggleStateProperty, PropertyBindingOptions.OneWay);

            this.checkMarkPrimitive.Children.Add((RadElement)radioPrimitive);
            this.checkMarkPrimitive.Children.Add((RadElement)imagePrimitive);
            this.checkMarkPrimitive.NotifyParentOnMouseInput = true;
            this.checkMarkPrimitive.ShouldHandleMouseInput   = false;
            CheckBoxLayoutPanel checkBoxLayoutPanel = new CheckBoxLayoutPanel();
            int num16 = (int)this.TextElement.SetValue(ImageAndTextLayoutPanel.IsTextPrimitiveProperty, (object)true);
            int num17 = (int)checkBoxLayoutPanel.BindProperty(RadElement.AutoSizeModeProperty, (RadObject)this, RadElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            int num18 = (int)checkBoxLayoutPanel.BindProperty(CheckBoxLayoutPanel.CheckAlignmentProperty, (RadObject)this, RadRadioButtonElement.RadioCheckAlignmentProperty, PropertyBindingOptions.OneWay);

            checkBoxLayoutPanel.Children.Add((RadElement)this.LayoutPanel);
            checkBoxLayoutPanel.Children.Add((RadElement)this.checkMarkPrimitive);
            this.Children.Add((RadElement)this.ButtonFillElement);
            this.Children.Add((RadElement)checkBoxLayoutPanel);
            this.Children.Add((RadElement)this.BorderElement);
        }
示例#25
0
 protected override void OnChildrenChanged(
     RadElement child,
     ItemsChangeOperation changeOperation)
 {
     if ((this.imageElement == null || this.checkElement == null) && (changeOperation == ItemsChangeOperation.Inserted && (bool)child.GetValue(RadCheckmark.IsImageProperty)))
     {
         this.imageElement = child as ImagePrimitive;
         this.SetCheckState();
     }
     base.OnChildrenChanged(child, changeOperation);
 }
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.imagePrimitive = new ImagePrimitive();
            this.Children.Add(this.imagePrimitive);

            this.reflectionPrimitive = new ReflectionPrimitive(this.imagePrimitive);
            this.reflectionPrimitive.ItemReflectionPercentage = 0.5;
            this.Children.Add(this.reflectionPrimitive);
        }
示例#27
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);
        }
示例#28
0
        protected override void CreateChildElements()
        {
            this.imagePrimitive = new ImagePrimitive();
            this.imagePrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            int num = (int)this.imagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadImageItem.ImageProperty, PropertyBindingOptions.TwoWay);

            this.Children.Add((RadElement)this.imagePrimitive);
            this.borderPrimitive              = new BorderPrimitive();
            this.borderPrimitive.Visibility   = ElementVisibility.Hidden;
            this.borderPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.Children.Add((RadElement)this.borderPrimitive);
        }
示例#29
0
 protected override void CreateChildElements()
 {
     this.fill       = new FillPrimitive();
     this.fill.Class = "GripItemFill";
     this.Children.Add((RadElement)this.fill);
     this.border       = new BorderPrimitive();
     this.border.Class = "GripItemBorder";
     this.Children.Add((RadElement)this.border);
     this.image         = new ImagePrimitive();
     this.image.MinSize = new Size(8, 7);
     this.Children.Add((RadElement)this.image);
 }
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
     this.fill         = new FillPrimitive();
     this.fill.Class   = "TitleFill";
     this.Children.Add((RadElement)this.fill);
     this.layout = new DockLayoutPanel();
     this.layout.StretchVertically   = true;
     this.layout.StretchHorizontally = true;
     this.layout.LastChildFill       = false;
     this.Children.Add((RadElement)this.layout);
     this.systemButtons                         = new StackLayoutPanel();
     this.systemButtons.ZIndex                  = 10;
     this.systemButtons.Alignment               = ContentAlignment.MiddleRight;
     this.minimizeButton                        = (RadButtonElement) new RadImageButtonElement();
     this.minimizeButton.StretchHorizontally    = false;
     this.minimizeButton.StretchVertically      = false;
     this.minimizeButton.Class                  = "MinimizeButton";
     this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill";
     this.minimizeButton.CanFocus               = false;
     this.minimizeButton.ThemeRole              = "MDIStripMinimizeButton";
     this.systemButtons.Children.Add((RadElement)this.minimizeButton);
     this.maximizeButton = (RadButtonElement) new RadImageButtonElement();
     this.maximizeButton.StretchHorizontally = false;
     this.maximizeButton.StretchVertically   = false;
     this.maximizeButton.Class = "MaximizeButton";
     this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill";
     this.maximizeButton.CanFocus  = false;
     this.maximizeButton.ThemeRole = "MDIStripMaximizeButton";
     this.systemButtons.Children.Add((RadElement)this.maximizeButton);
     this.closeButton = (RadButtonElement) new RadImageButtonElement();
     this.closeButton.StretchHorizontally = false;
     this.closeButton.StretchVertically   = false;
     this.closeButton.Class = "CloseButton";
     this.closeButton.ButtonFillElement.Name = "CloseButtonFill";
     this.closeButton.CanFocus  = false;
     this.closeButton.ThemeRole = "MDIStripCloseButton";
     this.systemButtons.Children.Add((RadElement)this.closeButton);
     this.mdiFormIcon       = new ImagePrimitive();
     this.mdiFormIcon.Class = "MdiStripIcon";
     this.mdiFormIcon.StretchHorizontally = false;
     this.mdiFormIcon.StretchVertically   = false;
     this.mdiFormIcon.CanFocus            = false;
     this.mdiFormIcon.Margin      = new Padding(1, 1, 0, 0);
     this.mdiFormIcon.MaxSize     = new Size(16, 16);
     this.mdiFormIcon.ImageLayout = ImageLayout.Stretch;
     this.layout.Children.Add((RadElement)this.mdiFormIcon);
     this.layout.Children.Add((RadElement)this.systemButtons);
     DockLayoutPanel.SetDock((RadElement)this.systemButtons, Dock.Right);
     DockLayoutPanel.SetDock((RadElement)this.mdiFormIcon, Dock.Left);
 }
示例#31
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);
        }
    public TreeExampleUserControl() {
      var resources = new ComponentResourceManager(typeof(TreeExampleUserControl));
      InitializeComponent(resources);

      foreach (var image in new[] {"level1", "level2", "level3" } )
        _level.Add(((Bitmap) (resources.GetObject(image))));

      ThemeResolutionService.ApplyThemeToControlTree(this, "TelerikMetroBlue");

      var item = new RadMenuItem("None");
      item.Click += item_Click;
      radDropDownButton1.Items.Add(item);

      item = new RadMenuItem("Alphabetically");
      item.Click += item_Click;
      radDropDownButton1.Items.Add(item);

      var searchIcon = new ImagePrimitive { Image = ((Image) (resources.GetObject("TV_search"))), Alignment = ContentAlignment.MiddleRight };
      radTextBox1.TextBoxElement.Children.Add(searchIcon);
      radTextBox1.TextBoxElement.TextBoxItem.Alignment = ContentAlignment.MiddleLeft;
      radTextBox1.TextBoxElement.TextBoxItem.PropertyChanged += TextBoxItem_PropertyChanged;
      radTreeView1.TreeViewElement.AllowAlternatingRowColor = true;
      radTreeView1.AllowEdit = false;
      radTreeView1.AllowAdd = false;
      radTreeView1.AllowRemove = false;
      radTreeView1.ItemHeight = 34;
      radTreeView1.AllowDefaultContextMenu = false;

      AutoScroll = false;

      radPanel3.PanelElement.PanelFill.BackColor = Color.White;
      radPanel3.BackColor = Color.White;
      radPanel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
      radPanel3.PanelElement.PanelBorder.TopColor = Color.FromArgb(196, 199, 182);
      radPanel3.PanelElement.PanelBorder.LeftColor = Color.FromArgb(196, 199, 182);
      radPanel3.PanelElement.PanelBorder.RightColor = Color.FromArgb(196, 199, 182);
      radPanel3.PanelElement.PanelBorder.BottomColor = Color.White;
      radPanel3.PanelElement.PanelBorder.BoxStyle = BorderBoxStyle.FourBorders;
      radPanel3.PanelElement.PanelBorder.BorderDrawMode = BorderDrawModes.VerticalOverHorizontal;
      radPanel3.PanelElement.PanelBorder.GradientStyle = GradientStyles.Solid;

      radPanel1.PanelElement.PanelFill.BackColor = Color.FromArgb(26, 93, 192);
      radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
      radPanel1.PanelElement.PanelBorder.Visibility = ElementVisibility.Collapsed;
      radPanel1.PanelElement.Font = new Font("Segoe UI Light", 20, FontStyle.Regular);
      radPanel1.ForeColor = Color.White;
      radPanel1.PanelElement.Padding = new Padding(8, 2, 2, 2);
      radPanel1.Text = @"Music Collection";
    }