예제 #1
0
        public RectangleEditor(CsGraphics parent, Rectangle r)
        {
            InitializeComponent();

            _parent         = parent;
            _parent.Enabled = false;
            _rect           = r;


            widthField.Minimum = 1;
            widthField.Maximum = 200;
            widthField.Value   = _rect.Width;

            heightField.Minimum = 1;
            heightField.Maximum = 200;
            heightField.Value   = _rect.Height;

            originXField.Minimum = -widthField.Value / 2;
            originXField.Maximum = _parent.DrawingPanel.Width - widthField.Value / 2;
            originXField.Value   = _rect.X;

            originYField.Minimum = -heightField.Value / 2;
            originYField.Maximum = _parent.DrawingPanel.Height - heightField.Value / 2;
            originYField.Value   = _rect.Y;

            colorIndicator.BackColor = _rect.Color;

            colorPicker.Color = _rect.Color;
        }
예제 #2
0
        public CircleEditor(CsGraphics parent, Circle c)
        {
            InitializeComponent();

            _parent         = parent;
            _parent.Enabled = false;
            _circle         = c;

            diameterField.Minimum = 2;
            diameterField.Maximum = 200;
            diameterField.Value   = _circle.Diameter;

            originXField.Minimum = -diameterField.Value / 2;
            originXField.Maximum = _parent.DrawingPanel.Width - diameterField.Value / 2;
            originXField.Value   = _circle.X;

            originYField.Minimum = -diameterField.Value / 2;
            originYField.Maximum = _parent.DrawingPanel.Height - diameterField.Value / 2;
            originYField.Value   = _circle.Y;


            colorIndicator.BackColor = _circle.Color;

            colorPicker.Color = _circle.Color;
        }
예제 #3
0
        public GroupEditor(CsGraphics parent, GroupShapes group)
        {
            InitializeComponent();

            _parent         = parent;
            _parent.Enabled = false;
            _group          = group;
            var width  = group.XMax - group.X;
            var height = group.YMax - group.Y;

            originXField.Minimum = -width / 2;
            originXField.Maximum = _parent.DrawingPanel.Width - width / 2;
            originXField.Value   = group.X;

            originYField.Minimum = -height / 2;
            originYField.Maximum = _parent.DrawingPanel.Height - height / 2;
            originYField.Value   = group.Y;

            colorIndicator.BackColor = _group.Color;

            colorPicker.Color = _group.Color;
        }