Exemplo n.º 1
0
        protected override void CreateChildElements()
        {
            fill                = new FillPrimitive();
            fill.BackColor      = Color.FromArgb(253, 253, 253);
            fill.BackColor2     = Color.FromArgb(112, 112, 112);
            fill.NumberOfColors = 2;
            fill.GradientStyle  = GradientStyles.Linear;
            fill.GradientAngle  = 90;
            fill.AutoSizeMode   = RadAutoSizeMode.FitToAvailableSize;
            this.Children.Add(fill);

            border = new BorderPrimitive();
            border.GradientStyle = GradientStyles.Solid;
            border.ForeColor     = Color.FromArgb(0, 0, 0);
            border.AutoSizeMode  = RadAutoSizeMode.FitToAvailableSize;

            this.Children.Add(border);

            panel             = new StackLayoutPanel();
            panel.Orientation = System.Windows.Forms.Orientation.Horizontal;
            //panel.Margin = new System.Windows.Forms.Padding(0, 20, 10, 0);
            panel.Alignment           = ContentAlignment.MiddleCenter;
            panel.StretchHorizontally = false;
            this.Children.Add(panel);

            this.items.Owner = panel;
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
 protected override void CreateChildElements()
 {
     this.fill       = new FillPrimitive();
     this.fill.Class = "GripFill";
     this.Children.Add((RadElement)this.fill);
     this.border              = new BorderPrimitive();
     this.border.Class        = "GripBorder";
     this.border.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
     this.Children.Add((RadElement)this.border);
     this.gripItem = new SizeGripItem();
     this.gripItem.StretchHorizontally = false;
     this.gripItem.StretchVertically   = false;
     this.gripItem.Class        = "GripNS";
     this.gripItem.Image.Class  = "GripNSImage";
     this.gripItem.SizingMode   = SizeGripItem.SizingModes.Vertical;
     this.gripItem.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
     this.gripItem.Alignment    = System.Drawing.ContentAlignment.BottomCenter;
     this.Children.Add((RadElement)this.gripItem);
     this.gripItem2 = new SizeGripItem();
     this.gripItem2.StretchHorizontally = false;
     this.gripItem2.StretchVertically   = false;
     this.gripItem2.Class        = "GripNSEW";
     this.gripItem2.Image.Class  = "GripNSEWImage";
     this.gripItem2.SizingMode   = SizeGripItem.SizingModes.Both;
     this.gripItem2.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
     this.gripItem2.RightToLeft  = this.RightToLeft;
     this.gripItem2.Alignment    = System.Drawing.ContentAlignment.MiddleRight;
     this.Children.Add((RadElement)this.gripItem2);
 }
        /// <summary>
        /// Creates child elements.
        /// </summary>
        protected override void CreateChildElements()
        {
            this.overFlowPrimitive = new OverflowPrimitive(ArrowDirection.Down);
            this.overFlowPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.overFlowPrimitive.AutoSize     = false;
            this.overFlowPrimitive.Alignment    = ContentAlignment.BottomLeft;
            this.overFlowPrimitive.Class        = "overFlowButton";

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

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

            this.hiddenItems = new HiddenItemsPrimitive();
            this.hiddenItems.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            this.hiddenItems.AutoSize     = true;
            this.hiddenItems.Class        = "OverFlowArrows";
            this.hiddenItems.Visibility   = ElementVisibility.Hidden;
            this.hiddenItems.BackColor    = Color.White;
            this.hiddenItems.BackColor2   = Color.Black;

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

            this.Children.Add(this.hiddenItems);
            this.Children.Add(this.overFlowPrimitive);
        }
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            this.editorContentElement = new RadCalculatorEditorContentElement(this);
            this.Children.Add((RadElement)this.editorContentElement);
            this.arrowButton           = new RadCalculatorArrowButtonElement();
            this.arrowButton.MinSize   = new Size(RadArrowButtonElement.RadArrowButtonDefaultSize.Width, this.arrowButton.ArrowFullSize.Height);
            this.arrowButton.ClickMode = ClickMode.Press;
            this.arrowButton.Click    += new EventHandler(this.popupOpenButton_Click);
            this.arrowButton.KeyPress += new KeyPressEventHandler(this.arrowButton_KeyPress);
            this.Children.Add((RadElement)this.arrowButton);
            this.calculatorContentElement = new RadCalculatorContentElement(this);
            RadCalculatorContentElement calculatorContentElement = new RadCalculatorContentElement(this);

            calculatorContentElement.Visibility = ElementVisibility.Collapsed;
            this.Children.Add((RadElement)calculatorContentElement);
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "CalculatorBorder";
            this.Children.Add((RadElement)this.borderPrimitive);
            this.fillPrimitive = new FillPrimitive();
            int num1 = (int)this.fillPrimitive.BindProperty(RadElement.AutoSizeModeProperty, (RadObject)this, RadElement.AutoSizeModeProperty, PropertyBindingOptions.TwoWay);

            this.fillPrimitive.Class = "CalculatorFill";
            int num2 = (int)this.fillPrimitive.SetDefaultValueOverride(RadElement.ZIndexProperty, (object)-1);

            this.fillPrimitive.RadPropertyChanged += new RadPropertyChangedEventHandler(this.fillPrimitive_RadPropertyChanged);
            this.Children.Add((RadElement)this.fillPrimitive);
            this.memoryElement = new RadCalculatorMemoryElement();
            this.Children.Add((RadElement)this.memoryElement);
        }
Exemplo n.º 6
0
        protected override void CreateChildElements()
        {
            int num1 = (int)this.SetDefaultValueOverride(RadButtonItem.TextImageRelationProperty, (object)TextImageRelation.ImageBeforeText);

            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add((RadElement)this.fillPrimitive);
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuItemBorderPrimitive";
            this.Children.Add((RadElement)this.borderPrimitive);
            this.layout       = new RadMenuItemLayout();
            this.layout.Class = "RadMenuItemLayout";
            this.Children.Add((RadElement)this.layout);
            int num2  = (int)this.layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num3  = (int)this.layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            int num4  = (int)this.layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            int num5  = (int)this.layout.Checkmark.BindProperty(RadCheckmark.CheckStateProperty, (RadObject)this, RadMenuItem.CheckStateProperty, PropertyBindingOptions.OneWay);
            int num6  = (int)this.layout.Text.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.OneWay);
            int num7  = (int)this.layout.Text.BindProperty(VisualElement.ForeColorProperty, (RadObject)this, VisualElement.ForeColorProperty, PropertyBindingOptions.TwoWay);
            int num8  = (int)this.layout.Description.BindProperty(VisualElement.FontProperty, (RadObject)this, RadMenuItem.DescriptionFontProperty, PropertyBindingOptions.OneWay);
            int num9  = (int)this.layout.Shortcut.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadMenuItem.HintTextProperty, PropertyBindingOptions.OneWay);
            int num10 = (int)this.layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, (RadObject)this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            int num11 = (int)this.layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            int num12 = (int)this.layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            int num13 = (int)this.layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, (RadObject)this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
        }
Exemplo n.º 7
0
        protected override void CreateChildElements()
        {
            // fill
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.Name          = "MenuButtonItemFill";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add(this.fillPrimitive);

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

            this.buttonElement          = new RadButtonElement();
            this.buttonElement.CanFocus = false;
            this.buttonElement.Click   += buttonElement_Click;
            this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            this.buttonElement.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.Children.Add(this.buttonElement);

            this.buttonElement.BindProperty(RadButtonElement.TextProperty, this, RadButtonItem.TextProperty, PropertyBindingOptions.TwoWay);
        }
Exemplo n.º 8
0
        public Form1()
        {
            InitializeComponent();

            border = (BorderPrimitive)this.radPanel1.PanelElement.Children[1];
            fill   = (FillPrimitive)this.radPanel1.PanelElement.Children[0];
        }
Exemplo n.º 9
0
        protected override void CreateChildElements()
        {
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "ButtonGroupBorder";
            this.fillPrimitive         = new FillPrimitive();
            this.fillPrimitive.Class   = "ButtonGroupFill";
            this.layoutPanel           = new StackLayoutPanel();
            this.items = new RadItemOwnerCollection((RadElement)this.layoutPanel);
            this.items.ItemsChanged += new ItemChangedDelegate(this.ItemChanged);
            this.items.ItemTypes     = new System.Type[16]
            {
                typeof(RadButtonElement),
                typeof(RadCheckBoxElement),
                typeof(RadDropDownListElement),
                typeof(RadDropDownButtonElement),
                typeof(RadImageButtonElement),
                typeof(RadLabelElement),
                typeof(RadMaskedEditBoxElement),
                typeof(RadProgressBarElement),
                typeof(RadRadioButtonElement),
                typeof(RadRepeatButtonElement),
                typeof(RadRibbonBarButtonGroup),
                typeof(RadSplitButtonElement),
                typeof(RadTextBoxElement),
                typeof(RadToggleButtonElement),
                typeof(RadTrackBarElement),
                typeof(RibbonBarGroupSeparator)
            };
            int num = (int)this.layoutPanel.BindProperty(StackLayoutPanel.OrientationProperty, (RadObject)this, RadRibbonBarButtonGroup.OrientationProperty, PropertyBindingOptions.OneWay);

            this.Children.Add((RadElement)this.fillPrimitive);
            this.Children.Add((RadElement)this.layoutPanel);
            this.Children.Add((RadElement)this.borderPrimitive);
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Creates child elements
        /// </summary>
        protected override void CreateChildElements()
        {
            this.stripLayout              = new ToolStripElementLayout();
            this.stripLayout.Orientation  = Orientation.Horizontal;
            this.stripLayout.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            this.stripLayout.Class        = "ToolStripElementLayout";

            this.border = new BorderPrimitive();

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

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

            border.Class = "ToolStripElementBorder";

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

            this.items               = new RadItemOwnerCollection();
            this.items.ItemTypes     = new Type[] { typeof(RadToolStripItem) };
            this.items.ItemsChanged += new ItemChangedDelegate(items_ItemsChanged);
            this.items.Owner         = stripLayout;
        }
Exemplo n.º 12
0
        private void setSelectedColor(RadItem selectedItem)
        {
            foreach (RadItem ri in this.ComboBoxElement.ListBoxElement.Items)
            {
                if (ri == selectedItem)
                {
                    FillPrimitive fp = ri.Children[0] as FillPrimitive;
                    fp.Visibility    = ElementVisibility.Visible;
                    fp.GradientStyle = GradientStyles.Linear;
                    //fp.BackColor = Color.Orange;
                    fp.BackColor  = Color.FromArgb(245, 201, 154);
                    fp.BackColor2 = Color.FromArgb(250, 174, 96);
                    fp.BackColor3 = Color.FromArgb(248, 142, 42);
                    fp.BackColor4 = Color.FromArgb(250, 193, 101);

                    BorderPrimitive bp = ri.Children[1] as BorderPrimitive;
                    bp.Visibility = ElementVisibility.Hidden;

                    TextPrimitive tp = ri.Children[2].Children[1].Children[0] as TextPrimitive;
                    tp.ForeColor = Color.Black;
                }
                else
                {
                    FillPrimitive fp = ri.Children[0] as FillPrimitive;
                    //fp.BackColor = Color.White;
                    fp.Visibility = ElementVisibility.Hidden;

                    BorderPrimitive bp = ri.Children[1] as BorderPrimitive;
                    bp.Visibility = ElementVisibility.Hidden;

                    TextPrimitive tp = ri.Children[2].Children[1].Children[0] as TextPrimitive;
                    tp.ForeColor = Color.Black;
                }
            }
        }
Exemplo n.º 13
0
        protected override void CreateChildElements()
        {
            this.scrollPanel = this.CreateScrollLayoutPanel();
            //this.scrollPanel.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.scrollPanel.Scroll                  += delegate(object sender, ScrollPanelEventArgs args) { OnScroll(args); };
            this.scrollPanel.ScrollNeedsChanged      += delegate(object sender, ScrollNeedsEventArgs args) { OnScrollNeedsChanged(args); };
            this.scrollPanel.ScrollParametersChanged += delegate(object sender, RadPanelScrollParametersEventArgs args) { OnScrollParametersChanged(args); };

            this.border       = new BorderPrimitive();
            this.border.Class = "RadScrollViewBorder";

            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadScrollViewFill";
            this.fillPrimitive.GradientAngle = 45f;

            this.Children.Add(this.fillPrimitive);
            this.Children.Add(this.border);
            this.Children.Add(this.scrollPanel);

            this.scrollPanel.AutoSize     = this.AutoSize;
            this.scrollPanel.AutoSizeMode = this.AutoSizeMode;

            this.scrollPanel.BindProperty(RadElement.AutoSizeProperty, this, RadElement.AutoSizeProperty, PropertyBindingOptions.OneWay);
            this.scrollPanel.BindProperty(RadElement.AutoSizeModeProperty, this, RadElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
        }
Exemplo n.º 14
0
        protected override bool ShouldPaintChild(RadElement element)
        {
            if (this.checkMarkPrimitive != null && this.paintSystemSkin.HasValue)
            {
                CheckPrimitive checkElement     = this.checkMarkPrimitive.CheckElement;
                bool?          paintSystemSkin1 = this.paintSystemSkin;
                int            num1             = paintSystemSkin1.GetValueOrDefault() ? 0 : (paintSystemSkin1.HasValue ? 1 : 0);
                checkElement.ShouldPaint = num1 != 0;
                BorderPrimitive border           = this.checkMarkPrimitive.Border;
                bool?           paintSystemSkin2 = this.paintSystemSkin;
                int             num2             = paintSystemSkin2.GetValueOrDefault() ? 0 : (paintSystemSkin2.HasValue ? 1 : 0);
                border.ShouldPaint = num2 != 0;
                FillPrimitive fill             = this.checkMarkPrimitive.Fill;
                bool?         paintSystemSkin3 = this.paintSystemSkin;
                int           num3             = paintSystemSkin3.GetValueOrDefault() ? 0 : (paintSystemSkin3.HasValue ? 1 : 0);
                fill.ShouldPaint = num3 != 0;
            }
            bool?paintSystemSkin = this.paintSystemSkin;

            if ((!paintSystemSkin.GetValueOrDefault() ? 0 : (paintSystemSkin.HasValue ? 1 : 0)) == 0)
            {
                return(base.ShouldPaintChild(element));
            }
            if (element != this.ButtonFillElement)
            {
                return(element != this.BorderElement);
            }
            return(false);
        }
Exemplo n.º 15
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);
        }
Exemplo n.º 16
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            this.arrowButton = this.CreateArrowButtonElement();
            int num1 = (int)this.arrowButton.Border.SetDefaultValueOverride(RadElement.VisibilityProperty, (object)ElementVisibility.Collapsed);

            this.arrowButton.ClickMode           = ClickMode.Press;
            this.arrowButton.Click              += new EventHandler(this.arrow_Click);
            this.arrowButton.ZIndex              = 1;
            this.arrowButton.StretchHorizontally = false;
            this.arrowButton.StretchVertically   = true;
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "DropDownListBorder";
            this.Children.Add((RadElement)this.borderPrimitive);
            this.fillPrimitive                     = new FillPrimitive();
            this.fillPrimitive.Class               = "DropDownFill";
            this.fillPrimitive.ZIndex              = -1;
            this.fillPrimitive.RadPropertyChanged += new RadPropertyChangedEventHandler(this.fillPrimitive_RadPropertyChanged);
            this.Children.Add((RadElement)this.fillPrimitive);
            StackLayoutElement stackLayoutElement = new StackLayoutElement();

            stackLayoutElement.CanFocus            = false;
            stackLayoutElement.StretchVertically   = true;
            stackLayoutElement.StretchHorizontally = true;
            stackLayoutElement.Class = "DropDownListStack";
            stackLayoutElement.FitInAvailableSize = true;
            this.Children.Add((RadElement)stackLayoutElement);
            this.containerElement           = new RadDropDownListEditableAreaElement((RadDropDownListElement)null);
            this.editableElement            = (RadTextBoxElement)this.containerElement.TextBox;
            this.editableElement.Visibility = ElementVisibility.Hidden;
            this.containerElement.DrawText  = true;
            stackLayoutElement.Children.Add((RadElement)this.containerElement);
            stackLayoutElement.Children.Add((RadElement)this.arrowButton);
            int num2 = (int)this.BindProperty(RadItem.TextProperty, (RadObject)this.editableElement, RadItem.TextProperty, PropertyBindingOptions.TwoWay);
        }
Exemplo n.º 17
0
        private void PaintTitleBarExtensions(IGraphics graphics)
        {
            RadRibbonBar ribbonBar = this.GetRibbonBar();

            if (ribbonBar == null)
            {
                return;
            }

            if (ribbonBar.RibbonBarElement.Children.Count > 5)
            {
                FillPrimitive   titleBarFill        = ribbonBar.RibbonBarElement.CaptionFill as FillPrimitive;
                BorderPrimitive fillPrimitiveBorder = ribbonBar.RibbonBarElement.CaptionBorder as BorderPrimitive;

                if (titleBarFill != null)
                {
                    this.PaintExtensionsFill(graphics, titleBarFill);
                }

                if (fillPrimitiveBorder != null &&
                    fillPrimitiveBorder.Visibility == ElementVisibility.Visible)
                {
                    this.PaintExtensionsBorders(graphics, titleBarFill, fillPrimitiveBorder);
                }
            }
        }
Exemplo n.º 18
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());
        }
Exemplo n.º 19
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);
        }
Exemplo n.º 20
0
        private void PaintExtensionsBorders(
            IGraphics graphics,
            FillPrimitive titleBarFill,
            BorderPrimitive fillPrimitiveBorder)
        {
            Rectangle rectangle1 = new Rectangle(new Point(1, titleBarFill.ControlBoundingRectangle.Y + 1), new Size(3, titleBarFill.ControlBoundingRectangle.Height));
            int       y1         = (double)fillPrimitiveBorder.BottomWidth > 1.0 ? (int)((double)rectangle1.Bottom - (double)fillPrimitiveBorder.BottomWidth) : rectangle1.Bottom - 2;
            int       y2         = (double)fillPrimitiveBorder.BottomWidth > 1.0 ? (int)((double)rectangle1.Bottom - (double)fillPrimitiveBorder.BottomWidth / 2.0) : rectangle1.Bottom - 1;
            Point     point1     = new Point(rectangle1.X, y1);
            Point     point2     = new Point(rectangle1.Right, y1);
            Point     point3     = new Point(rectangle1.X, y2);
            Point     point4     = new Point(rectangle1.Right, y2);

            graphics.DrawLine(fillPrimitiveBorder.BottomShadowColor, point1.X, point1.Y, point2.X, point2.Y);
            graphics.DrawLine(fillPrimitiveBorder.BottomColor, point3.X, point3.Y, point4.X, point4.Y);
            Rectangle rectangle2 = new Rectangle(new Point(this.Size.Width - 4, titleBarFill.ControlBoundingRectangle.Y + 1), new Size(3, titleBarFill.ControlBoundingRectangle.Height));
            int       y3         = (double)fillPrimitiveBorder.BottomWidth > 1.0 ? (int)((double)rectangle2.Bottom - (double)fillPrimitiveBorder.BottomWidth) : rectangle2.Bottom - 2;
            int       y4         = (double)fillPrimitiveBorder.BottomWidth > 1.0 ? (int)((double)rectangle2.Bottom - (double)fillPrimitiveBorder.BottomWidth / 2.0) : rectangle2.Bottom - 1;
            Point     point5     = new Point(rectangle2.X, y3);
            Point     point6     = new Point(rectangle2.Right, y3);
            Point     point7     = new Point(rectangle2.X, y4);
            Point     point8     = new Point(rectangle2.Right, y4);

            graphics.DrawLine(fillPrimitiveBorder.BottomShadowColor, point5.X, point5.Y, point6.X, point6.Y);
            graphics.DrawLine(fillPrimitiveBorder.BottomColor, point7.X, point7.Y, point8.X, point8.Y);
        }
Exemplo n.º 21
0
        protected override void CreateChildElements()
        {
            this.SetDefaultValueOverride(TextImageRelationProperty, TextImageRelation.ImageBeforeText);

            // fill
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add(this.fillPrimitive);

            // border
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuItemBorderPrimitive";
            this.Children.Add(this.borderPrimitive);

            // layout
            this.layout       = new RadMenuItemLayout();
            this.layout.Class = "RadMenuItemLayout";
            this.Children.Add(layout);

            // bindings
            layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            layout.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            layout.Checkmark.BindProperty(RadCheckmark.CheckStateProperty, this, RadMenuItem.CheckStateProperty, PropertyBindingOptions.OneWay);
            layout.Text.BindProperty(TextPrimitive.TextProperty, this, RadButtonItem.TextProperty, PropertyBindingOptions.OneWay);
            layout.Description.BindProperty(TextPrimitive.FontProperty, this, RadMenuItem.DescriptionFontProperty, PropertyBindingOptions.OneWay);
            layout.Shortcut.BindProperty(TextPrimitive.TextProperty, this, RadMenuItem.HintTextProperty, PropertyBindingOptions.OneWay);
            layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.DisplayStyleProperty, this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.ImageAlignmentProperty, this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextAlignmentProperty, this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            layout.InternalLayoutPanel.BindProperty(ImageAndTextLayoutPanel.TextImageRelationProperty, this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
        }
Exemplo n.º 22
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.Name          = "MenuButtonItemFill";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add((RadElement)this.fillPrimitive);
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuItemBorderPrimitive";
            this.borderPrimitive.Name  = "MenuButtonItemBorder";
            this.Children.Add((RadElement)this.borderPrimitive);
            this.buttonElement          = new RadButtonElement();
            this.buttonElement.CanFocus = false;
            this.buttonElement.Click   += new EventHandler(this.buttonElement_Click);
            int num1 = (int)this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num2 = (int)this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            int num3 = (int)this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.buttonElement.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.Children.Add((RadElement)this.buttonElement);
            int num4  = (int)this.buttonElement.BindProperty(RadItem.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.TwoWay);
            int num5  = (int)this.SetDefaultValueOverride(RadButtonItem.TextImageRelationProperty, (object)this.buttonElement.TextImageRelation);
            int num6  = (int)this.SetDefaultValueOverride(RadButtonItem.ImageAlignmentProperty, (object)this.buttonElement.ImageAlignment);
            int num7  = (int)this.SetDefaultValueOverride(RadButtonItem.TextAlignmentProperty, (object)this.buttonElement.TextAlignment);
            int num8  = (int)this.buttonElement.BindProperty(RadButtonItem.TextImageRelationProperty, (RadObject)this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.TwoWay);
            int num9  = (int)this.buttonElement.BindProperty(RadButtonItem.ImageAlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.TwoWay);
            int num10 = (int)this.buttonElement.BindProperty(RadButtonItem.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.TwoWay);
        }
Exemplo n.º 23
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);
        }
Exemplo n.º 24
0
        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);
        }
Exemplo n.º 25
0
 protected override void CreateChildElements()
 {
     this.fill   = new FillPrimitive();
     this.border = new BorderPrimitive();
     this.Children.Add((RadElement)this.fill);
     this.Children.Add((RadElement)this.border);
 }
Exemplo n.º 26
0
 private Size GetParentBorderSize()
 {
     if (this.Parent != null)
     {
         foreach (RadElement child in this.Parent.Children)
         {
             BorderPrimitive borderPrimitive = child as BorderPrimitive;
             if (borderPrimitive != null)
             {
                 Padding padding = Padding.Empty;
                 if (borderPrimitive.BoxStyle == BorderBoxStyle.SingleBorder)
                 {
                     padding = new Padding((int)Math.Round((double)borderPrimitive.Width, MidpointRounding.AwayFromZero));
                 }
                 else if (borderPrimitive.BoxStyle == BorderBoxStyle.FourBorders)
                 {
                     padding = new Padding((int)borderPrimitive.LeftWidth, (int)borderPrimitive.TopWidth, (int)borderPrimitive.RightWidth, (int)borderPrimitive.BottomWidth);
                 }
                 else if (borderPrimitive.BoxStyle == BorderBoxStyle.OuterInnerBorders)
                 {
                     int all = (int)borderPrimitive.Width;
                     if (all == 1)
                     {
                         all = 2;
                     }
                     padding = new Padding(all);
                 }
                 return(new Size(padding.Horizontal, padding.Vertical));
             }
         }
     }
     return(Size.Empty);
 }
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            this.arrowButton.Class = "CommandBarSplitButtonArrow";

            this.buttonSeparator = new RadCommandBarVisualElement();
            this.buttonSeparator.NotifyParentOnMouseInput = true;
            this.buttonSeparator.Class               = "CommandBarSplitButtonSeparator";
            this.buttonSeparator.StretchVertically   = true;
            this.buttonSeparator.StretchHorizontally = false;
            this.buttonSeparator.SetDefaultValueOverride(RadElement.MinSizeProperty, new System.Drawing.Size(2, 2));
            this.buttonSeparator.DrawText = false;
            this.buttonSeparator.SetDefaultValueOverride(LightVisualElement.DrawFillProperty, false);
            this.buttonSeparator.SetDefaultValueOverride(LightVisualElement.DrawBorderProperty, true);
            this.buttonSeparator.SetDefaultValueOverride(LightVisualElement.BorderBoxStyleProperty, BorderBoxStyle.FourBorders);
            this.buttonSeparator.SetDefaultValueOverride(LightVisualElement.BorderBottomWidthProperty, 0f);
            this.buttonSeparator.SetDefaultValueOverride(LightVisualElement.BorderTopWidthProperty, 0f);
            this.buttonSeparator.SetDefaultValueOverride(LightVisualElement.BorderLeftWidthProperty, 1f);
            this.buttonSeparator.SetDefaultValueOverride(LightVisualElement.BorderRightWidthProperty, 1f);
            this.Children.Add(this.buttonSeparator);

            this.buttonBorder = new BorderPrimitive();
            this.Children.Add(buttonBorder);
            this.arrowButton.Click += new EventHandler(arrowButton_Click);
        }
Exemplo n.º 28
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.Class = "GroupSeparator";
     this.separatorPrimitive       = new BorderPrimitive();
     this.separatorPrimitive.Class = "SeparatorPrimitive";
     this.Children.Add(this.separatorPrimitive);
 }
Exemplo n.º 29
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);
        }
Exemplo n.º 30
0
        protected override void CreateChildElements()
        {
            // if there is an old reference we clear it.
            this.contextItem = null;

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

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

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


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

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

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


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

            systemButtons.Visibility = ElementVisibility.Collapsed;
        }