/trunk/Widow/RuleEditForm.Designer.cs |
@@ -21,6 +21,7 @@ |
this.groupBox1 = new System.Windows.Forms.GroupBox(); |
this.removeButton = new System.Windows.Forms.Button(); |
this.groupBox2 = new System.Windows.Forms.GroupBox(); |
this.groupBox7 = new System.Windows.Forms.GroupBox(); |
this.WindowTitle = new System.Windows.Forms.TextBox(); |
this.groupBox6 = new System.Windows.Forms.GroupBox(); |
this.ignoreHeightCheckBox = new System.Windows.Forms.CheckBox(); |
@@ -38,9 +39,9 @@ |
this.refreshButton = new System.Windows.Forms.Button(); |
this.desktopWindowsListBox = new System.Windows.Forms.ListBox(); |
this.addButton = new System.Windows.Forms.Button(); |
this.drawButton = new System.Windows.Forms.Button(); |
this.groupBox1.SuspendLayout(); |
this.groupBox2.SuspendLayout(); |
this.groupBox7.SuspendLayout(); |
this.groupBox6.SuspendLayout(); |
this.groupBox5.SuspendLayout(); |
this.groupBox4.SuspendLayout(); |
@@ -81,8 +82,7 @@ |
// |
// groupBox2 |
// |
this.groupBox2.Controls.Add(this.drawButton); |
this.groupBox2.Controls.Add(this.WindowTitle); |
this.groupBox2.Controls.Add(this.groupBox7); |
this.groupBox2.Controls.Add(this.groupBox6); |
this.groupBox2.Controls.Add(this.groupBox5); |
this.groupBox2.Controls.Add(this.groupBox4); |
@@ -89,14 +89,24 @@ |
this.groupBox2.Controls.Add(this.groupBox3); |
this.groupBox2.Location = new System.Drawing.Point(382, 12); |
this.groupBox2.Name = "groupBox2"; |
this.groupBox2.Size = new System.Drawing.Size(190, 331); |
this.groupBox2.Size = new System.Drawing.Size(190, 302); |
this.groupBox2.TabIndex = 2; |
this.groupBox2.TabStop = false; |
this.groupBox2.Text = "Settings"; |
// |
// WindowTitle |
// groupBox7 |
// |
this.WindowTitle.Location = new System.Drawing.Point(14, 31); |
this.groupBox7.Controls.Add(this.WindowTitle); |
this.groupBox7.Location = new System.Drawing.Point(6, 19); |
this.groupBox7.Name = "groupBox7"; |
this.groupBox7.Size = new System.Drawing.Size(178, 50); |
this.groupBox7.TabIndex = 5; |
this.groupBox7.TabStop = false; |
this.groupBox7.Text = "Title"; |
// |
// WindowName |
// |
this.WindowTitle.Location = new System.Drawing.Point(8, 19); |
this.WindowTitle.Name = "WindowTitle"; |
this.WindowTitle.ReadOnly = true; |
this.WindowTitle.Size = new System.Drawing.Size(162, 20); |
@@ -264,16 +274,6 @@ |
this.addButton.UseVisualStyleBackColor = true; |
this.addButton.Click += new System.EventHandler(this.AddButton_Click); |
// |
// drawButton |
// |
this.drawButton.Location = new System.Drawing.Point(14, 299); |
this.drawButton.Name = "drawButton"; |
this.drawButton.Size = new System.Drawing.Size(75, 23); |
this.drawButton.TabIndex = 5; |
this.drawButton.Text = "Draw"; |
this.drawButton.UseVisualStyleBackColor = true; |
this.drawButton.Click += new System.EventHandler(this.DrawButton_Click); |
// |
// RuleEditForm |
// |
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
@@ -289,7 +289,8 @@ |
this.Text = "Rule Editor"; |
this.groupBox1.ResumeLayout(false); |
this.groupBox2.ResumeLayout(false); |
this.groupBox2.PerformLayout(); |
this.groupBox7.ResumeLayout(false); |
this.groupBox7.PerformLayout(); |
this.groupBox6.ResumeLayout(false); |
this.groupBox6.PerformLayout(); |
this.groupBox5.ResumeLayout(false); |
@@ -316,6 +317,7 @@ |
private System.Windows.Forms.TextBox WindowTop; |
private System.Windows.Forms.GroupBox groupBox3; |
private System.Windows.Forms.TextBox WindowLeft; |
private System.Windows.Forms.GroupBox groupBox7; |
private System.Windows.Forms.TextBox WindowTitle; |
private System.Windows.Forms.GroupBox groupBox8; |
private System.Windows.Forms.ListBox desktopWindowsListBox; |
@@ -326,6 +328,5 @@ |
private System.Windows.Forms.CheckBox ignoreWidthCheckBox; |
private System.Windows.Forms.CheckBox ignoreTopCheckBox; |
private System.Windows.Forms.CheckBox ignoreLeftCheckBox; |
private System.Windows.Forms.Button drawButton; |
} |
} |
/trunk/Widow/RuleEditForm.cs |
@@ -14,8 +14,6 @@ |
|
public MainForm Form { get; set; } |
|
public DrawOverlayForm DrawOverlayForm { get; set; } |
|
#endregion |
|
#region Constructors, Destructors and Finalizers |
@@ -366,52 +364,5 @@ |
} |
|
#endregion |
|
private void DrawButton_Click(object sender, EventArgs e) |
{ |
var selectedWindow = (Window) windowRulesListBox.SelectedItem; |
if (selectedWindow == null) |
{ |
return; |
} |
|
if (DrawOverlayForm != null) |
{ |
return; |
} |
|
DrawOverlayForm = new DrawOverlayForm(); |
DrawOverlayForm.WindowDrawn += DrawOverlayForm_WindowDrawn; |
DrawOverlayForm.Closed += DrawOverlayForm_Closed; |
DrawOverlayForm.Show(); |
|
} |
|
private void DrawOverlayForm_WindowDrawn(object sender, WindowDrawnEventArgs e) |
{ |
var selectedWindow = (Window) windowRulesListBox.SelectedItem; |
if (selectedWindow == null) |
{ |
return; |
} |
|
WindowLeft.Text = e.Left.ToString(); |
WindowTop.Text = e.Top.ToString(); |
WindowWidth.Text = e.Width.ToString(); |
WindowHeight.Text = e.Height.ToString(); |
|
selectedWindow.Left = e.Left; |
selectedWindow.Top = e.Top; |
selectedWindow.Width = e.Width; |
selectedWindow.Height = e.Height; |
} |
|
private void DrawOverlayForm_Closed(object sender, EventArgs e) |
{ |
DrawOverlayForm.Closed -= DrawOverlayForm_Closed; |
DrawOverlayForm.WindowDrawn -= DrawOverlayForm_WindowDrawn; |
DrawOverlayForm.Dispose(); |
DrawOverlayForm = null; |
} |
} |
} |