public MovementPlayShip(
     GraphicsProperties gp,
     string model_s = GameConstants.content_m_ship,
     float scale = GameConstants.mov_ship_scale)
     : base(gp,model_s,scale)
 {
 }
示例#2
0
 public Bullets(GraphicsProperties gp,
     int max,
     string model = GameConstants.content_m_bullet,
     float scale = 1)
     : base(gp, max, model, scale)
 {
 }
 //public StaticPlayScreen Parent;
 public StaticPlayShip(
     GraphicsProperties gp,
     string model_s = GameConstants.content_m_ship,
     float scale = 10f)
     : base(gp, model_s, scale)
 {
     //Parent = parent;
 }
 public SingleObject(
     GraphicsProperties gp, string model_s, float scale = 1)
     : base(gp, model_s, scale)
 {
     RotationMatrix = Matrix.CreateRotationX(MathHelper.PiOver2);
     velocity = Vector3.Zero;
     alpha = 1;
     world = new Matrix();
 }
示例#5
0
 public Ship(
     GraphicsProperties gp,string model_s, float scale = 1)
     : base(gp,model_s, scale)
 {
     this.bulletsfront = new Objects.Bullets(gp,GameConstants.mov_maxBullets);
     this.bulletsback = new Objects.Bullets(gp, GameConstants.mov_maxBullets);
     this.drawingComponents = new DrawingComponents(gp);
     this.shipfront = new Objects.TestSphere(gp,Color.Blue);
     this.shipback = new Objects.TestSphere(gp,Color.Red);
 }
示例#6
0
 /// <summary>
 /// Sets the background color property to the given graphics object in the hashtable. If the element doesn't exist, then it adds the graphic element to the hashtable with the given background color.
 /// </summary>
 /// <param name="graphic">Graphic element to search or add</param>
 /// <param name="color">Background color to set</param>
 public void SetBackColor(System.Drawing.Graphics graphic, System.Drawing.Color color)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).BackColor = color;
     }
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.BackColor = color;
         Add(graphic, tempProps);
     }
 }
示例#7
0
 /// <summary>
 /// This method set the TextBackgroundColor of a Graphics instace
 /// </summary>
 /// <param name="graphic">The graphics instace</param>
 /// <param name="color">The System.Color to set the TextBackgroundColor</param>
 public void SetTextBackgroundColor(Graphics graphic, Color color)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).TextBackgroundColor = color;
     }
     else
     {
         var tempProps = new GraphicsProperties {
             TextBackgroundColor = color
         };
         Add(graphic, tempProps);
     }
 }
示例#8
0
 /// <summary>
 /// Sets the GraphicFont property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given Font.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="font">Font to set</param>
 public void SetFont(Graphics graphic, Font font)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).GraphicFont = font;
     }
     else
     {
         var tempProps = new GraphicsProperties {
             GraphicFont = font
         };
         Add(graphic, tempProps);
     }
 }
示例#9
0
 /// <summary>
 /// Sets the GraphicPen property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given Pen.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="pen">Pen to set</param>
 public void SetPen(Graphics graphic, Pen pen)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).GraphicPen = pen;
     }
     else
     {
         var tempProps = new GraphicsProperties {
             GraphicPen = pen
         };
         Add(graphic, tempProps);
     }
 }
示例#10
0
 public LaserHoleSize()
 {
     resources          = new ComponentResourceManager(typeof(LaserHoleSize));
     this.ShowIndex     = 8;
     this.CtrlType      = CtrlType.LaserHoleSize;
     graphicsProperties = graphicsPropertiesManager.GetPropertiesByName("Circle");
     InitializeComponent();
     InitializeSlider();
     InitializeChartSeries();
     InitializeHolePulsePoints();
     this.holeSizeCtrl.UpdownClickHandler += UpdownClickHandler;
     serialPortCom       = SerialPortManager.GetInstance();
     this.btnSave.Click += BtnSave_Click;
 }
示例#11
0
 /// <summary>
 /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given GraphicBrush.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="brush">GraphicBrush to set</param>
 public void SetBrush(Graphics graphic, SolidBrush brush)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).GraphicBrush = brush;
     }
     else
     {
         var tempProps = new GraphicsProperties {
             GraphicBrush = brush
         };
         Add(graphic, tempProps);
     }
 }
示例#12
0
 /// <summary>
 /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given GraphicBrush.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="brush">GraphicBrush to set</param>
 public void SetPaint(Graphics graphic, Brush brush)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).PaintBrush = brush;
     }
     else
     {
         var tempProps = new GraphicsProperties {
             PaintBrush = brush
         };
         Add(graphic, tempProps);
     }
 }
示例#13
0
 /// <summary>
 /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the element doesn't exist, then it adds the graphic element to the hashtable with the given GraphicBrush.
 /// </summary>
 /// <param name="graphic">Graphic element to search or add</param>
 /// <param name="color">Color to set</param>
 public void SetPaint(System.Drawing.Graphics graphic, System.Drawing.Color color)
 {
     System.Drawing.Brush brush = new System.Drawing.SolidBrush(color);
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).PaintBrush = brush;
     }
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.PaintBrush = brush;
         Add(graphic, tempProps);
     }
 }
        /// <summary>
        /// Set to default values
        /// </summary>
        private void btnDefault_Click(object sender, EventArgs e)
        {
            _properties = new GraphicsProperties();
            if (ChangeLast)
            {
                GraphicsProperties.LastProperties = Properties;
            }
            btnFillColor.CenterColor = _properties.FillColor;
            cmbFillTransparent.Text  = _properties.FillColorAlpha.ToString();
            btnLineColor.CenterColor = _properties.BorderColor;
            cmbLineWeight.Text       = _properties.PenWidth.ToString() + " pt";

            this.Refresh();
        }
示例#15
0
        private void GraphicsPropertiesChangedHandler(DrawObject drawObject, GraphicsProperties graphicsProperties)
        {
            float pulseSize = SysConfig.GetSysConfig().LaserConfig.PulseSize;

            activeCircle.OutterCircleSize = new SizeF(this.GraphicsProperties.ExclusionSize + pulseSize,
                                                      this.GraphicsProperties.ExclusionSize + pulseSize);
            activeCircle.InnerCircleSize = new SizeF(pulseSize, pulseSize);

            for (int i = 0; i < activeCircle.InnerCircles.Count; i++)
            {
                activeCircle.InnerCircles[i] = new Circle(activeCircle.InnerCircles[i].CenterPoint, activeCircle.InnerCircleSize);
                activeCircle.OutterCircle[i] = new Circle(activeCircle.OutterCircle[i].CenterPoint, activeCircle.OutterCircleSize);
            }
            this.pictureBox.Invalidate();
        }
示例#16
0
 public LaserAppearanceCtrl(RichPictureBox pictureBox) : base()
 {
     resources          = new ComponentResourceManager(typeof(LaserAppearanceCtrl));
     this.ShowIndex     = 3;
     this.CtrlType      = CtrlType.LaserAppreance;
     graphicsProperties = graphicsPropertiesManager.GetPropertiesByName("Circle");
     InitializeComponent();
     this.pictureBox               = pictureBox;
     this.sliderTargetSize.Value   = graphicsProperties.TargetSize;
     this.sliderThickness.Value    = graphicsProperties.PenWidth;
     this.sliderTransparency.Value = (int)(graphicsProperties.Alpha * 100 / 255f);
     this.sliderZoneSize.Value     = graphicsProperties.ExclusionSize;
     this.sliderZoneColour.Value   = graphicsProperties.ColorIndex() * 10;
     this.InitializeThumbCustomShape();
 }
示例#17
0
                /// <summary>
                /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given GraphicBrush.
                /// </summary>
                /// <param name="graphic">Graphic Element to search or Add</param>
                /// <param name="color">Color to set</param>
                public void SetPaint(Graphics graphic, Color color)
                {
                    Brush brush = new SolidBrush(color);

                    if (this[graphic] != null)
                    {
                        ((GraphicsProperties)this[graphic]).PaintBrush = brush;
                    }
                    else
                    {
                        var tempProps = new GraphicsProperties {
                            PaintBrush = brush
                        };
                        Add(graphic, tempProps);
                    }
                }
示例#18
0
 public void SetColor(Graphics graphic, Color color)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).GraphicPen.Color   = color;
         ((GraphicsProperties)this[graphic]).GraphicBrush.Color = color;
         ((GraphicsProperties)this[graphic]).color = color;
     }
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.GraphicPen.Color   = color;
         tempProps.GraphicBrush.Color = color;
         tempProps.color = color;
         Add(graphic, tempProps);
     }
 }
示例#19
0
        public MainForm()
        {
            InitializeComponent();

            g = this.CreateGraphics();

            DocManagerData data = new DocManagerData();

            data.FormOwner        = this;
            data.UpdateTitle      = true;
            data.FileDialogFilter = "DrawTools files (*.dtl)|*.dtl|All Files (*.*)|*.*";
            data.NewDocName       = "Untitled.dtl";

            docManager = new DocManager(data);
            docManager.RegisterFileType("dtl", "dtlfile", "DrawTools File");

            this.Cursor = Cursors.Cross;

            drawArea.Location = new System.Drawing.Point(0, 0);
            drawArea.Size     = new System.Drawing.Size(200, 200);
            drawArea.Owner    = this;
            drawArea.Visible  = false;
            drawArea.Initialize(this, docManager);

            GraphicsProperties graphicProperties = drawArea.GraphicsList.GetProperties();

            this.myColorPicker.SelectedColor    = DrawSettings.LastUsedColor;
            this.myColorPicker.PenWidth         = graphicProperties.PenWidth;
            this.drawArea.ToolTextBox.ForeColor = DrawSettings.LastUsedColor;

            this.myColorPicker.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
            {
                GraphicsProperties p = new GraphicsProperties();
                p.Color    = e.Color;
                p.PenWidth = e.Width;
                this.drawArea.ToolTextBox.ForeColor = e.Color.Value;
                this.drawArea.ToolTextBox.Font      = new System.Drawing.Font("Arial Narrow", e.TextSize);

                if (drawArea.GraphicsList.ShowColorPickerPanel(drawArea, p))
                {
                    drawArea.SetDirty();
                    drawArea.Refresh();
                }
            };
        }
示例#20
0
 /// <summary>
 /// Sets the color properties for a given Graphics object. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the color properties set with the given value.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="color">Color value to set</param>
 public void SetColor(Graphics graphic, Color color)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).GraphicPen.Color   = color;
         ((GraphicsProperties)this[graphic]).GraphicBrush.Color = color;
         ((GraphicsProperties)this[graphic]).Color = color;
     }
     else
     {
         var tempProps = new GraphicsProperties
         {
             GraphicPen   = { Color = color },
             GraphicBrush = { Color = color },
             Color        = color
         };
         Add(graphic, tempProps);
     }
 }
示例#21
0
 public LaserCtrl(RichPictureBox richPictureBox) : base()
 {
     resources           = new ComponentResourceManager(typeof(LaserCtrl));
     this.richPictureBox = richPictureBox;
     holePulsePoints     = Program.SysConfig.LaserConfig.HolePulsePoints;
     this.ShowIndex      = 5;
     this.CtrlType       = CtrlType.LaserCtrl;
     graphicsProperties  = graphicsPropertiesManager.GetPropertiesByName("Circle");
     InitializeComponent();
     InitializeSlider();
     this.sliderCtrl.Slider.Value    = (int)(Program.SysConfig.LaserConfig.PulseWidth * 10);
     this.sliderCtrl.Slider.MouseUp += Slider_MouseUp;
     serialPortCom       = SerialPortManager.GetInstance();
     savedPulseWidthList = Program.SysConfig.LaserConfig.SavedPulseWidth;
     InitializeSavedPulseWidthList();
     this.comboBoxEx1.SelectedValueChanged += ComboBoxEx1_SelectedValueChanged;
     this.holesSlider.Visible   = false;
     this.lblHoleNumber.Visible = false;
 }
示例#22
0
 protected override void OnVisibleChanged(EventArgs e)
 {
     if (this.Visible)
     {
         if (pictureBox.GraphicsList != null && pictureBox.GraphicsList.Count > 0)
         {
             for (int i = 0; i < this.cmboxRuler.Items.Count; i++)
             {
                 if (this.cmboxRuler.Items[i].ToString() == pictureBox.GraphicsList[0].ObjectType.ToString())
                 {
                     this.cmboxRuler.SelectedItem = this.cmboxRuler.Items[i];
                     graphicsProperties           = graphicsPropertiesManager.GetPropertiesByName(this.cmboxRuler.Items[i].ToString());
                     SetSliderValue();
                     break;
                 }
             }
         }
     }
     this.pictureBox.InvokeMouseWheel = !this.Visible;
 }
示例#23
0
        /// <summary>
        /// Submit changed data
        /// </summary>
        private void btnOK_Click(object sender, EventArgs e)
        {
            // information
            if (!_multi)
            {
                // check remain id
                int    rid;
                String error = "";

                // check valid input
                if (!Int32.TryParse(txtRBangou.Text, out rid))
                {
                    error = String.Format(MkaMessage.ErrNumberRequest, GetLblText(lblRBangou));
                    txtRBangou.Focus();
                    MkaMessage.ShowError(error);
                    return;
                }

                // check duplication
                if (rid != MokkanProperty.RBangou && MokkanList.CheckDuplexRID(rid))
                {
                    error = String.Format(MkaMessage.ErrDublication, GetLblText(lblRBangou));
                    txtRBangou.Focus();
                    MkaMessage.ShowError(error);
                    return;
                }

                MokkanProperty.RBangou = rid;
            }
            MokkanProperty.KariShakubun         = txtKariShakubun.Text;
            MokkanProperty.GaihouShoshuuJyouhou = txtGaihouShoshuuJyouhou.Text;
            MokkanProperty.ShasinBangouJyouhou  = txtShashinBangouJyouhou.Text;
            MokkanProperty.Bikou = txtBikou.Text;

            // graphics
            Properties = mkaGraphicsProperties.Properties;
            Properties.RShowPosition = (ShowPosition)cmbRShowPosition.SelectedItem;

            DialogResult = DialogResult.OK;
        }
示例#24
0
        /// <summary>
        /// Get properties from selected objects and fill GraphicsProperties instance
        /// </summary>
        /// <returns></returns>
        private GraphicsProperties GetProperties()
        {
            GraphicsProperties properties = new GraphicsProperties();

            //int n = SelectionCount;

            //if (n < 1)
            //    return properties;

            //DrawObject o = GetSelectedObject(0);

            //int firstColor = o.Color.ToArgb();
            //int firstPenWidth = o.PenWidth;

            //bool allColorsAreEqual = true;
            //bool allWidthAreEqual = true;

            //for (int i = 1; i < n; i++)
            //{
            //    if (GetSelectedObject(i).Color.ToArgb() != firstColor)
            //        allColorsAreEqual = false;

            //    if (GetSelectedObject(i).PenWidth != firstPenWidth)
            //        allWidthAreEqual = false;
            //}

            //if (allColorsAreEqual)
            //{
            //    properties.ColorDefined = true;
            //    properties.Color = Color.FromArgb(firstColor);
            //}

            //if (allWidthAreEqual)
            //{
            //    properties.PenWidthDefined = true;
            //    properties.PenWidth = firstPenWidth;
            //}

            return(properties);
        }
示例#25
0
        /// <summary>
        /// Show Properties dialog. Return true if list is changed
        /// </summary>
        /// <param name="parent"></param>
        /// <returns></returns>
        public bool ShowPropertiesDialog(IWin32Window parent)
        {
            if (SelectionCount < 1)
            {
                return(false);
            }

            GraphicsProperties properties = GetProperties();
            PropertiesDialog   dlg        = new PropertiesDialog();

            dlg.Properties = properties;

            if (dlg.ShowDialog(parent) !=
                DialogResult.OK)
            {
                return(false);
            }

            ApplyProperties();

            return(true);
        }
示例#26
0
 public System.Drawing.Graphics GetGraphics(System.Windows.Forms.Control control)
 {
     System.Drawing.Graphics graphic;
     if (control.Visible == true)
     {
         graphic = control.CreateGraphics();
         if (this[graphic] == null)
         {
             GraphicsProperties tempProps = new GraphicsProperties();
             tempProps.color       = control.ForeColor;
             tempProps.BackColor   = control.BackColor;
             tempProps.TextColor   = control.ForeColor;
             tempProps.GraphicFont = control.Font;
             Add(graphic, tempProps);
         }
     }
     else
     {
         graphic = null;
     }
     return(graphic);
 }
        /// <summary>
        /// Initialize graphical control
        /// </summary>
        private void uctrlGraphics_Load(object sender, EventArgs e)
        {
            foreach (float weight in MkaDefine.LineWeight)
            {
                cmbLineWeight.Items.Add(weight.ToString() + " pt");
            }

            foreach (int transparent in MkaDefine.Transparency)
            {
                cmbFillTransparent.Items.Add(transparent.ToString());
            }

            //if (_properties == null)
            //    _properties = new GraphicsProperties();

            _properties = GraphicsProperties.LastProperties;

            btnFillColor.CenterColor = _properties.FillColor;
            cmbFillTransparent.Text  = _properties.FillColorAlpha.ToString();
            btnLineColor.CenterColor = _properties.BorderColor;
            cmbLineWeight.Text       = _properties.PenWidth.ToString() + " pt";
        }
示例#28
0
 /// <summary>
 /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given GraphicBrush.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="brush">GraphicBrush to set</param>
 public void SetBrush(Graphics graphic, SolidBrush brush)
 {
     if (this[graphic] != null)
         ((GraphicsProperties) this[graphic]).GraphicBrush = brush;
     else
     {
         var tempProps = new GraphicsProperties {GraphicBrush = brush};
         Add(graphic, tempProps);
     }
 }
示例#29
0
 public Graphics GetGraphics(Control control)
 {
     Graphics graphic;
     if (control.Visible == true)
     {
         graphic = control.CreateGraphics();
         if (this[graphic] == null)
         {
             GraphicsProperties tempProps = new GraphicsProperties();
             tempProps.color = control.ForeColor;
             tempProps.BackColor = control.BackColor;
             tempProps.TextColor = control.ForeColor;
             tempProps.GraphicFont = control.Font;
             Add(graphic, tempProps);
         }
     }
     else
     {
         graphic = null;
     }
     return graphic;
 }
示例#30
0
 /// <summary>
 /// Sets the background color property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given background color.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="color">Background color to set</param>
 public void SetBackColor(Graphics graphic, Color color)
 {
     if (this[graphic] != null)
         ((GraphicsProperties) this[graphic]).BackColor = color;
     else
     {
         var tempProps = new GraphicsProperties {BackColor = color};
         Add(graphic, tempProps);
     }
 }
示例#31
0
 /// <summary>
 /// This method set the TextBackgroundColor of a Graphics instace
 /// </summary>
 /// <param name="graphic">The graphics instace</param>
 /// <param name="color">The System.Color to set the TextBackgroundColor</param>
 public void SetTextBackgroundColor(Graphics graphic, Color color)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties) this[graphic]).TextBackgroundColor = color;
     }
     else
     {
         var tempProps = new GraphicsProperties {TextBackgroundColor = color};
         Add(graphic,tempProps);
     }
 }
示例#32
0
 /// <summary>
 /// Sets the GraphicPen property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given Pen.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="pen">Pen to set</param>
 public void SetPen(Graphics graphic, Pen pen)
 {
     if (this[graphic] != null)
         ((GraphicsProperties) this[graphic]).GraphicPen = pen;
     else
     {
         var tempProps = new GraphicsProperties {GraphicPen = pen};
         Add(graphic, tempProps);
     }
 }
示例#33
0
 /// <summary>
 /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given GraphicBrush.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="color">Color to set</param>
 public void SetPaint(Graphics graphic, Color color)
 {
     Brush brush = new SolidBrush(color);
     if (this[graphic] != null)
         ((GraphicsProperties) this[graphic]).PaintBrush = brush;
     else
     {
         var tempProps = new GraphicsProperties {PaintBrush = brush};
         Add(graphic, tempProps);
     }
 }
示例#34
0
 /// <summary>
 /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given GraphicBrush.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="brush">GraphicBrush to set</param>
 public void SetPaint(Graphics graphic, Brush brush)
 {
     if (this[graphic] != null)
         ((GraphicsProperties) this[graphic]).PaintBrush = brush;
     else
     {
         var tempProps = new GraphicsProperties {PaintBrush = brush};
         Add(graphic, tempProps);
     }
 }
示例#35
0
 /// <summary>
 /// Sets the GraphicFont property to the given graphics object in the hashtable. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the given Font.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="font">Font to set</param>
 public void SetFont(Graphics graphic, Font font)
 {
     if (this[graphic] != null)
         ((GraphicsProperties) this[graphic]).GraphicFont = font;
     else
     {
         var tempProps = new GraphicsProperties {GraphicFont = font};
         Add(graphic,tempProps);
     }
 }
示例#36
0
 /// <summary>
 /// Sets the color properties for a given Graphics object. If the Element doesn't exist, then it adds the graphic Element to the hashtable with the color properties set with the given value.
 /// </summary>
 /// <param name="graphic">Graphic Element to search or Add</param>
 /// <param name="color">Color value to set</param>
 public void SetColor(Graphics graphic, Color color)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties) this[graphic]).GraphicPen.Color = color;
         ((GraphicsProperties) this[graphic]).GraphicBrush.Color = color;
         ((GraphicsProperties) this[graphic]).Color = color;
     }
     else
     {
         var tempProps = new GraphicsProperties
                             {
                                 GraphicPen = {Color = color},
                                 GraphicBrush = {Color = color},
                                 Color = color
                             };
         Add(graphic,tempProps);
     }
 }
示例#37
0
 /// <summary>
 /// Sets the color properties for a given Graphics object. If the element doesn't exist, then it adds the graphic element to the hashtable with the color properties set with the given value.
 /// </summary>
 /// <param name="graphic">Graphic element to search or add</param>
 /// <param name="color">Color value to set</param>
 public void SetColor(System.Drawing.Graphics graphic, System.Drawing.Color color)
 {
     if (this[graphic] != null)
     {
         ((GraphicsProperties)this[graphic]).GraphicPen.Color = color;
         ((GraphicsProperties)this[graphic]).GraphicBrush.Color = color;
         ((GraphicsProperties)this[graphic]).color = color;
     }
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.GraphicPen.Color = color;
         tempProps.GraphicBrush.Color = color;
         tempProps.color = color;
         Add(graphic, tempProps);
     }
 }
示例#38
0
 /// <summary>
 /// Sets the GraphicFont property to the given graphics object in the hashtable. If the element doesn't exist, then it adds the graphic element to the hashtable with the given Font.
 /// </summary>
 /// <param name="graphic">Graphic element to search or add</param>
 /// <param name="Font">Font to set</param>
 public void SetFont(System.Drawing.Graphics graphic, System.Drawing.Font font)
 {
     if (this[graphic] != null)
         ((GraphicsProperties)this[graphic]).GraphicFont = font;
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.GraphicFont = font;
         Add(graphic, tempProps);
     }
 }
示例#39
0
        private void cmboxRuler_SelectedIndexChanged(object sender, EventArgs e)
        {
            var name = this.cmboxRuler.SelectedItem.ToString();

            graphicsProperties = graphicsPropertiesManager.GetPropertiesByName(name);
        }
示例#40
0
 /// <summary>
 /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the element doesn't exist, then it adds the graphic element to the hashtable with the given GraphicBrush.
 /// </summary>
 /// <param name="graphic">Graphic element to search or add</param>
 /// <param name="color">Color to set</param>
 public void SetPaint(System.Drawing.Graphics graphic, System.Drawing.Color color)
 {
     System.Drawing.Brush brush = new System.Drawing.SolidBrush(color);
     if (this[graphic] != null)
         ((GraphicsProperties)this[graphic]).PaintBrush = brush;
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.PaintBrush = brush;
         Add(graphic, tempProps);
     }
 }
示例#41
0
 /// <summary>
 /// Sets the GraphicPen property to the given graphics object in the hashtable. If the element doesn't exist, then it adds the graphic element to the hashtable with the given Pen.
 /// </summary>
 /// <param name="graphic">Graphic element to search or add</param>
 /// <param name="pen">Pen to set</param>
 public void SetPen(System.Drawing.Graphics graphic, System.Drawing.Pen pen)
 {
     if (this[graphic] != null)
         ((GraphicsProperties)this[graphic]).GraphicPen = pen;
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.GraphicPen = pen;
         Add(graphic, tempProps);
     }
 }
示例#42
0
 public void GraphicsPropertiesChangedHandler(DrawObject drawObject, GraphicsProperties graphicsProperties)
 {
     this.Invalidate();
 }
示例#43
0
 /// <summary>
 /// Sets the GraphicBrush property to the given graphics object in the hashtable. If the element doesn't exist, then it adds the graphic element to the hashtable with the given GraphicBrush.
 /// </summary>
 /// <param name="graphic">Graphic element to search or add</param>
 /// <param name="brush">GraphicBrush to set</param>
 public void SetBrush(System.Drawing.Graphics graphic, System.Drawing.SolidBrush brush)
 {
     if (this[graphic] != null)
         ((GraphicsProperties)this[graphic]).GraphicBrush = brush;
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.GraphicBrush = brush;
         Add(graphic, tempProps);
     }
 }
示例#44
0
 /// <summary>
 /// Sets the text color property to the given graphics object in the hashtable. If the element doesn't exist, then it adds the graphic element to the hashtable with the given text color.
 /// </summary>
 /// <param name="graphic">Graphic element to search or add</param>
 /// <param name="color">Text color to set</param>
 public void SetTextColor(System.Drawing.Graphics graphic, System.Drawing.Color color)
 {
     if (this[graphic] != null)
         ((GraphicsProperties)this[graphic]).TextColor = color;
     else
     {
         GraphicsProperties tempProps = new GraphicsProperties();
         tempProps.TextColor = color;
         Add(graphic, tempProps);
     }
 }