protected override SizeF ArrangeOverride(SizeF finalSize) { SizeF final = base.ArrangeOverride(finalSize); if (this.Children.Count < 2) { return(final); } BorderPrimitive borderPrimitive = this.Children[1] as BorderPrimitive; if (borderPrimitive == null) { return(final); } int divider = 1; if (Minimum != 0) { divider = Maximum - Minimum; } float fillWidth = (finalSize.Width * Value1) / divider; float fillHeight = (finalSize.Height * Value1) / divider; if (Orientation == ProgressOrientation.Left) { borderPrimitive.Arrange(new RectangleF(1, 0, fillWidth + 1, final.Height - 1)); } return(final); }
protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation) { base.OnChildrenChanged(child, changeOperation); if (child is BorderPrimitive) { this.SynchronizeWithParentBorderThickness(); if (this.childPrimitive == null) { this.childPrimitive = child as BorderPrimitive; } else if (child is BorderPrimitive && this.childPrimitive == child && changeOperation == ItemsChangeOperation.Removed) { this.childPrimitive = null; foreach (RadElement item in this.Children) { if (item is BorderPrimitive) { this.childPrimitive = item as BorderPrimitive; this.SynchronizeWithParentBorderThickness(); break; } } } } }
protected override SizeF ArrangeOverride(SizeF finalSize) { SizeF sizeF = base.ArrangeOverride(finalSize); if (this.Children.Count < 2) { return(sizeF); } BorderPrimitive child = this.Children[1] as BorderPrimitive; if (child == null) { return(sizeF); } int num1 = 1; if (this.Minimum != 0) { num1 = this.Maximum - this.Minimum; } float num2 = finalSize.Width * (float)this.Value1 / (float)num1; double num3 = (double)finalSize.Height * (double)this.Value1 / (double)num1; if (this.Orientation == ProgressOrientation.Left) { child.Arrange(new RectangleF(1f, 0.0f, num2 + 1f, sizeF.Height - 1f)); } return(sizeF); }
protected override void OnChildrenChanged( RadElement child, ItemsChangeOperation changeOperation) { base.OnChildrenChanged(child, changeOperation); if (!(child is BorderPrimitive)) { return; } this.SynchronizeWithParentBorderThickness(); if (this.childPrimitive == null) { this.childPrimitive = child as BorderPrimitive; } else { if (!(child is BorderPrimitive) || this.childPrimitive != child || changeOperation != ItemsChangeOperation.Removed) { return; } this.childPrimitive = (BorderPrimitive)null; foreach (RadElement child1 in this.Children) { if (child1 is BorderPrimitive) { this.childPrimitive = child1 as BorderPrimitive; this.SynchronizeWithParentBorderThickness(); break; } } } }
private void PerformStyle_NotActive() { Telerik.WinControls.Primitives.FillPrimitive prmFill = (Telerik.WinControls.Primitives.FillPrimitive) this.ButtonElement.Children[0]; Telerik.WinControls.Primitives.BorderPrimitive prmBorder = (Telerik.WinControls.Primitives.BorderPrimitive) this.ButtonElement.Children[2]; prmBorder.Visibility = ElementVisibility.Hidden; prmFill.GradientStyle = GradientStyles.OfficeGlassRect; prmFill.BackColor = prmFill.BackColor2 = prmFill.BackColor3 = prmFill.BackColor4 = Color.Transparent; }
private void PerformStyle_Active() { Telerik.WinControls.Primitives.FillPrimitive prmFill = (Telerik.WinControls.Primitives.FillPrimitive) this.ButtonElement.Children[0]; Telerik.WinControls.Primitives.BorderPrimitive prmBorder = (Telerik.WinControls.Primitives.BorderPrimitive) this.ButtonElement.Children[2]; //prmBorder.Visibility = ElementVisibility.Visible; prmFill.GradientStyle = GradientStyles.Linear; prmFill.ResetValue(FillPrimitive.BackColorProperty); prmFill.ResetValue(FillPrimitive.BackColor2Property); prmFill.ResetValue(FillPrimitive.BackColor3Property); prmFill.ResetValue(FillPrimitive.BackColor4Property); }
internal Padding GetBorderThickness() { Padding result = this.ownBorderThickness = this.GetOwnBorderThickness(); for (int i = 0; i < this.Children.Count; i++) { if (this.Children[i] is BorderPrimitive) { BorderPrimitive childBorder = this.Children[i] as BorderPrimitive; result = Padding.Add(result, childBorder.GetBorderThickness()); } } this.BorderThickness = result; return(result); }
public Padding GetBorderThickness() { Padding p1 = this.ownBorderThickness = this.GetOwnBorderThickness(); for (int index = 0; index < this.Children.Count; ++index) { if (this.Children[index] is BorderPrimitive) { BorderPrimitive child = this.Children[index] as BorderPrimitive; p1 = Padding.Add(p1, child.GetBorderThickness()); } } this.BorderThickness = p1; return(p1); }
public CSToggleButton2() { Telerik.WinControls.Primitives.FillPrimitive prmFill = (Telerik.WinControls.Primitives.FillPrimitive) this.ButtonElement.Children[0]; ImageAndTextLayoutPanel imgTxtPanel = (ImageAndTextLayoutPanel)this.ButtonElement.Children[1]; Telerik.WinControls.Primitives.BorderPrimitive prmBorder = (Telerik.WinControls.Primitives.BorderPrimitive) this.ButtonElement.Children[2]; Telerik.WinControls.Primitives.FocusPrimitive prmFocus = (Telerik.WinControls.Primitives.FocusPrimitive) this.ButtonElement.Children[3]; prmFill.GradientStyle = GradientStyles.OfficeGlassRect; prmFill.BackColor = prmFill.BackColor2 = prmFill.BackColor3 = prmFill.BackColor4 = Color.Transparent; prmBorder.Visibility = ElementVisibility.Hidden; prmBorder.Margin = new System.Windows.Forms.Padding(4); prmFocus.Visibility = ElementVisibility.Hidden; this.ToggleStateChanged += new StateChangedEventHandler(CSToggleButton2_ToggleStateChanged); this.MouseEnter += new EventHandler(CSToggleButton2_MouseEnter); this.MouseLeave += new EventHandler(CSToggleButton2_MouseLeave); }
public FocusPrimitive(BorderPrimitive border) { this.border = border; }