private void RightCircle_MouseDoubleClick(object sender, EventArgs e) { //Handles theRightCircle.DoubleClick //When the right azimuth circle tip is double clicked, bring the left circle tip so it shows over the left theLeftCircle.BringToFront(); return; }
private void Region_MouseDown(object sender, MouseEventArgs e) { RegionHighlight.BringToFront(); this.BackColor = Color.Orange; RegionHighlight.BorderColor = Color.Orange; if (VisualizerGlobal.SelectedTool == VisualizerGlobal.Tool.Select) { return; } MouseDownLocation = e.Location; }
private void CreatePiece(string imageName, int suffix) { OvalShape shape = new OvalShape(shapeContainer); shape.BackgroundImage = (Image)Properties.Resources.ResourceManager.GetObject(imageName); shape.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; shape.BorderColor = System.Drawing.Color.Transparent; shape.Name = imageName + suffix.ToString(); shape.Location = DoosLocation(shape.Name); shape.Size = new System.Drawing.Size(26, 26); shape.BringToFront(); shape.MouseDown += new MouseEventHandler(shape_MouseDown); shape.SelectionColor = System.Drawing.Color.Transparent; inDoos.Add(shape); }
private void ShowDot(Zet zet) { Point van = getBordLocation(zet.van.x, zet.van.y); Point naar = getBordLocation(zet.naar.x, zet.naar.y); OvalShape circle = new OvalShape(shapeContainer); bool isPiece = zet.naar.stuk.type != StukType.geen; //V138 int offset = isPiece ? 0 : 12; int r = isPiece ? 26 : 2; circle.Location = new Point(naar.X + offset, naar.Y + offset); circle.Name = "DOT"; circle.BorderColor = Color.Red; circle.Size = new Size(r, r); circle.BringToFront(); circle.Show(); }
private void SetUpSectorDraw() { //Routine that constructs the azimuth compass gauge in all its glory //Basically, a canvas is set up then a circle drawn around the center of the canvas //Each indicator is build from three lines that form a triangle and a filled circle //The triangle points left or right depending upon the indicator. And, left is red; right is green. canvas = new ShapeContainer(); canvas.Parent = this; CenterPoint.X = MainCircleDrawLocationX + MainCircleSize / 2; CenterPoint.Y = MainCircleDrawLocationY + MainCircleSize / 2; CenterPoint = new Point(MainCircleDrawLocationX + (MainCircleSize / 2), MainCircleDrawLocationY + (MainCircleSize / 2)); theMainCircle = new OvalShape(); theLeftCircle = new OvalShape(); theRightCircle = new OvalShape(); theLeftLine = new LineShape(); theRightLine = new LineShape(); theInnerLeftLine = new LineShape(); theInnerRightLine = new LineShape(); theOuterLeftLine = new LineShape(); theOuterRightLine = new LineShape(); theMainCircle.Parent = canvas; theMainCircle.Size = new System.Drawing.Size(MainCircleSize, MainCircleSize); theMainCircle.Location = new System.Drawing.Point(MainCircleDrawLocationX, MainCircleDrawLocationY); theMainCircle.BorderWidth = MainCircleBorder; theMainCircle.BorderColor = Color.LightBlue; theLeftLine.Parent = canvas; theLeftLine.BorderColor = Color.Red; theLeftLine.BorderWidth = 2; theInnerLeftLine.Parent = canvas; theInnerLeftLine.BorderColor = Color.Red; theInnerLeftLine.BorderWidth = 2; theOuterLeftLine.Parent = canvas; theOuterLeftLine.BorderColor = Color.Red; theOuterLeftLine.BorderWidth = 2; theInnerRightLine.Parent = canvas; theInnerRightLine.BorderColor = Color.Green; theInnerRightLine.BorderWidth = 2; theOuterRightLine.Parent = canvas; theOuterRightLine.BorderColor = Color.Green; theOuterRightLine.BorderWidth = 2; LineAngleLeft = Utilities.AzimuthToCanvas(AzimuthLeft); theLeftLine.StartPoint = CenterPoint; theLeftLine.EndPoint = new Point((int)(CircleRadius * Math.Cos(LineAngleLeft) + XCircleCenter), (int)(CircleRadius * Math.Sin(LineAngleLeft) + YCircleCenter)); LeftTip = Utilities.TriPoint(CenterPoint, CircleRadius, LineAngleLeft, -TipSize); theInnerLeftLine.StartPoint = CenterPoint; theInnerLeftLine.EndPoint = LeftTip; theOuterLeftLine.StartPoint = LeftTip; theOuterLeftLine.EndPoint = theLeftLine.EndPoint; theLeftCircle.Parent = canvas; theLeftCircle.Size = new System.Drawing.Size(PointCircleSize, PointCircleSize); theLeftCircle.Location = Utilities.LocationOffset(theLeftLine.EndPoint, PointCircleSize); theLeftCircle.BorderColor = Color.Red; theLeftCircle.FillColor = Color.Red; theLeftCircle.FillStyle = FillStyle.Solid; theLeftCircle.BringToFront(); theRightLine.Parent = canvas; theRightLine.BorderColor = Color.Green; theRightLine.BorderWidth = 2; LineAngleRight = Utilities.AzimuthToCanvas(AzimuthRight); theRightLine.StartPoint = CenterPoint; theRightLine.EndPoint = new Point((int)(CircleRadius * Math.Cos(LineAngleRight) + XCircleCenter), (int)(CircleRadius * Math.Sin(LineAngleRight) + YCircleCenter)); RightTip = Utilities.TriPoint(CenterPoint, CircleRadius, LineAngleRight, TipSize); theInnerRightLine.StartPoint = CenterPoint; theInnerRightLine.EndPoint = RightTip; theOuterRightLine.StartPoint = RightTip; theOuterRightLine.EndPoint = theRightLine.EndPoint; theRightCircle.Parent = canvas; theRightCircle.Size = new System.Drawing.Size(PointCircleSize, PointCircleSize); theRightCircle.Location = Utilities.LocationOffset(theRightLine.EndPoint, PointCircleSize); theRightCircle.BorderColor = Color.Green; theRightCircle.FillColor = Color.Green; theRightCircle.FillStyle = FillStyle.Solid; theRightCircle.BringToFront(); return; }