private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { if (tools == Tools.text && flagTextEndEnter == false) { buffer.MouseDown(e); textb.Location = e.Location; textb.Size = new Size(200, 100); textb.Visible = true; textb.Multiline = true; textb.BorderStyle = BorderStyle.None; textb.Focus(); flagTextEndEnter = true; LineBox.Hide(); RubberOptionBox.Hide(); } else if (tools == Tools.text && flagTextEndEnter) { textb.Visible = false; buffer.MouseUp(e); ClearTextBox(); } }
private void FillToolsBTN_Click(object sender, EventArgs e) { WidthLineBTN.Enabled = false; buffer.InitSelectedStep(new Fill()); FillToolsBTN.TabIndex = 0; tools = Tools.fill; LineBox.Hide(); RubberOptionBox.Hide(); }
public LinePathAlgorithm(List <Line> rLines) { this.LineBoxes = new List <LineBox>(); for (int i = 0; i < rLines.Count; i++) { LineBox rLineBox = new LineBox(rLines[i]); this.LineBoxes.Add(rLineBox); } }
private void RubberToolsBTN_Click(object sender, EventArgs e) { if (flagTextEndEnter) { buffer.MouseUp((MouseEventArgs)e); } clickFigure(); WidthLineBTN.Enabled = true; RubberToolsBTN.TabIndex = 0; buffer.InitSelectedStep(new Rubber()); tools = Tools.rubber; LineBox.Hide(); }
private void PaintLineBox(LineBox box) { Painter.StrokeWidth = box.StrokeWidth; Painter.StrokeColor = Color.Black; float offset = 0.01f;//when start point and end point are on X=0 line disappear then add little point Painter.DrawLine( box.StartPoint.X + box.Left + offset, box.StartPoint.Y + box.Top, box.EndPoint.X + box.Left + offset, box.EndPoint.Y + box.Top); }
private void TextToolsBTN_Click(object sender, EventArgs e) { textb.Visible = false; if (flagTextEndEnter) { buffer.MouseUp((MouseEventArgs)e); } clickFigure(); TextToolsBTN.TabIndex = 0; LineBox.Hide(); RubberOptionBox.Hide(); buffer.InitSelectedStep(new TextElement()); tools = Tools.text; }
private void WidthLineBTN_Click(object sender, EventArgs e) { if (tools == Tools.text) { RubberOptionBox.Hide(); LineBox.Hide(); fontDialog1.ShowDialog(); textb.Font = fontDialog1.Font; } else if (tools == Tools.line || tools == Tools.elipse || tools == Tools.square) { RubberOptionBox.Hide(); LineBox.Show(); } else if (tools == Tools.rubber) { LineBox.Hide();; RubberOptionBox.Show(); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TopLogoControl)); this.pnlLogo = new System.Windows.Forms.Panel(); this.progressIcon = new WebsitePanel.LocalizationToolkit.ProgressIcon(); this.lblVersion = new System.Windows.Forms.Label(); this.imgLogo = new System.Windows.Forms.PictureBox(); this.line = new WebsitePanel.LocalizationToolkit.LineBox(); this.pnlLogo.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.imgLogo)).BeginInit(); this.SuspendLayout(); // // pnlLogo // this.pnlLogo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pnlLogo.BackColor = System.Drawing.Color.White; this.pnlLogo.Controls.Add(this.progressIcon); this.pnlLogo.Controls.Add(this.lblVersion); this.pnlLogo.Controls.Add(this.imgLogo); this.pnlLogo.Location = new System.Drawing.Point(0, 0); this.pnlLogo.Name = "pnlLogo"; this.pnlLogo.Size = new System.Drawing.Size(496, 63); this.pnlLogo.TabIndex = 2; // // progressIcon // this.progressIcon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.progressIcon.Location = new System.Drawing.Point(452, 15); this.progressIcon.Name = "progressIcon"; this.progressIcon.Size = new System.Drawing.Size(30, 30); this.progressIcon.TabIndex = 4; this.progressIcon.Visible = false; // // lblVersion // this.lblVersion.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.lblVersion.ForeColor = System.Drawing.Color.Black; this.lblVersion.Location = new System.Drawing.Point(264, 36); this.lblVersion.Name = "lblVersion"; this.lblVersion.Size = new System.Drawing.Size(93, 13); this.lblVersion.TabIndex = 2; this.lblVersion.Text = "v1.0"; // // imgLogo // this.imgLogo.Image = ((System.Drawing.Image)(resources.GetObject("imgLogo.Image"))); this.imgLogo.Location = new System.Drawing.Point(13, 7); this.imgLogo.Name = "imgLogo"; this.imgLogo.Size = new System.Drawing.Size(251, 42); this.imgLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.imgLogo.TabIndex = 0; this.imgLogo.TabStop = false; // // line // this.line.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.line.Location = new System.Drawing.Point(0, 61); this.line.Name = "line"; this.line.Size = new System.Drawing.Size(496, 2); this.line.TabIndex = 3; this.line.TabStop = false; // // TopLogoControl // this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.line); this.Controls.Add(this.pnlLogo); this.Name = "TopLogoControl"; this.Size = new System.Drawing.Size(496, 64); this.pnlLogo.ResumeLayout(false); this.pnlLogo.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.imgLogo)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// use this for initialization /// </summary> void Start() { appPath = Application.streamingAssetsPath + '/'; ProtoBuf.Meta.RuntimeTypeModel.Default.Add (typeof(Color), false).SetSurrogate (typeof(ProtoColor)); ProtoBuf.Meta.RuntimeTypeModel.Default.Add (typeof(Vector2), false).SetSurrogate (typeof(ProtoVector3)); ProtoBuf.Meta.RuntimeTypeModel.Default.Add (typeof(Vector3), false).SetSurrogate (typeof(ProtoVector3)); winDiag = new Vector2(Screen.width, Screen.height).magnitude; mouseDownPos = new Vector3[3]; mouseUpPos = new Vector3[3]; RenderSettings.ambientLight = Color.white; Camera.main.orthographicSize = Screen.height / 2; Camera.main.transform.position = new Vector3(Screen.width / 2f, Screen.height / 2f, 0); quadPrefab.renderer.material.shader = Shader.Find ("Transparent/VertexLit"); quadPrefab.renderer.material.color = Color.white; quadPrefab.transform.rotation = new Quaternion(0, 1, 0, 0); sprTile = Instantiate (quadPrefab) as GameObject; border = new LineBox(); border.line.SetWidth (2, 2); // ISSUE #16: make width customizable by mod deleteLines = new MoveLineRenderer(Color.red); keepLines = new MoveLineRenderer(Color.green); sprMakeUnit = Instantiate (quadPrefab) as GameObject; // ISSUE #16: make color and width customizable by mod selectBox = new LineBox(); selectBox.line.material.color = Color.white; selectBox.line.SetWidth (2, 2); // ISSUE #16: make font, size, and color customizable by mod lblStyle = GUIStyle.none; lblStyle.fontSize = (int)(Screen.height * fontSize); lblStyle.normal.textColor = Color.white; lblErrStyle = new GUIStyle(lblStyle); lblErrStyle.normal.textColor = Color.red; if (!scnOpen (appPath + modPath + "scn.json", 0, false)) { Debug.LogError ("Scenario failed to load."); } }
public LineBoxNeighbors(LineBox box) => Box = box;