コード例 #1
0
        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);
        }
コード例 #2
0
 public ScaleRuler(LayerRuler layer, LayerRuler.RulerItem rulerItem, PointF originalPosition, PointF newPosition)
 {
     mRulerLayer = layer;
     mRulerItem = rulerItem;
     mOriginalPosition = originalPosition;
     mNewPosition = newPosition;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
     }
 }
コード例 #5
0
 public Anchor(LayerRuler.RulerItem ruler, int index, PointF localAttachOffset)
 {
     mAttachedRuler = ruler;
     mAttachedPointIndex = index;
     mLocalAttachOffsetFromCenter = localAttachOffset;
     mWorldAttachOffsetFromCenter = localAttachOffset; // initialize with a zero angle
 }
コード例 #6
0
ファイル: AddRuler.cs プロジェクト: henrihs/bluebrick-id-fork
 public AddRuler(LayerRuler layer, LayerRuler.RulerItem rulerItem)
 {
     mRulerLayer = layer;
     mRulerItem = rulerItem;
 }