public EditRulerForm(LayerRuler.RulerItem rulerItem) { InitializeComponent(); // clone the specified ruler in a new instance that will receive the edited properties mEditedRulerClone = rulerItem.Clone() as LayerRuler.RulerItem; // set the different control with the current state of the ruler // line appearance this.lineThicknessNumericUpDown.Value = (decimal)(rulerItem.LineThickness); this.lineColorPictureBox.BackColor = rulerItem.Color; if (rulerItem is LayerRuler.LinearRuler) this.allowOffsetCheckBox.Checked = (rulerItem as LayerRuler.LinearRuler).AllowOffset; else this.allowOffsetCheckBox.Enabled = false; // guideline appearance this.dashPatternLineNumericUpDown.Value = (decimal)(rulerItem.GuidelineDashPattern[0]); this.dashPatternSpaceNumericUpDown.Value = (decimal)(rulerItem.GuidelineDashPattern[1]); this.guidelineThicknessNumericUpDown.Value = (decimal)(rulerItem.GuidelineThickness); this.guidelineColorPictureBox.BackColor = rulerItem.GuidelineColor; // measure and unit this.displayUnitCheckBox.Checked = rulerItem.DisplayUnit; this.displayMeasureTextCheckBox.Checked = rulerItem.DisplayDistance; this.unitComboBox.SelectedIndex = (int)(rulerItem.CurrentUnit); this.fontColorPictureBox.BackColor = rulerItem.MeasureColor; updateChosenFont(rulerItem.MeasureFont); }
public ScaleRuler(LayerRuler layer, LayerRuler.RulerItem rulerItem, PointF originalPosition, PointF newPosition) { mRulerLayer = layer; mRulerItem = rulerItem; mOriginalPosition = originalPosition; mNewPosition = newPosition; }
public EditRuler(LayerRuler layer, LayerRuler.RulerItem rulerItem, LayerRuler.RulerItem rulerItemTemplateForNewProperties) { mRulerLayer = layer; // memorise the item mRulerItem = rulerItem; // and clone the two templates, for doing undo/redo and keeping the properties when the ruler change mOldRulerItemTemplate = rulerItem.Clone() as LayerRuler.RulerItem; mNewRulerItemTemplate = rulerItemTemplateForNewProperties.Clone() as LayerRuler.RulerItem; }
public MoveRulerControlPoint(LayerRuler layer, LayerRuler.RulerItem rulerItem, PointF originalPosition, PointF newPosition) { mRulerLayer = layer; mRulerItem = rulerItem; mControlPointIndex = rulerItem.CurrentControlPointIndex; mOriginalPosition = originalPosition; mNewPosition = newPosition; // compute the new attach offset if the control point is attached if (rulerItem.IsCurrentControlPointAttached) { LayerBrick.Brick attachedBrick = rulerItem.BrickAttachedToCurrentControlPoint; mAnchor = attachedBrick.getRulerAttachmentAnchor(rulerItem); mOriginalLocalAttachOffset = mAnchor.LocalAttachOffsetFromCenter; mNewLocalAttachOffset = RulerAttachementSet.Anchor.sComputeLocalOffsetFromLayerItem(attachedBrick, newPosition); mAttachedBrickOrientation = attachedBrick.Orientation; } }
public Anchor(LayerRuler.RulerItem ruler, int index, PointF localAttachOffset) { mAttachedRuler = ruler; mAttachedPointIndex = index; mLocalAttachOffsetFromCenter = localAttachOffset; mWorldAttachOffsetFromCenter = localAttachOffset; // initialize with a zero angle }
public AddRuler(LayerRuler layer, LayerRuler.RulerItem rulerItem) { mRulerLayer = layer; mRulerItem = rulerItem; }