EditSubtitlesForm: Added rows now have default values.

This commit is contained in:
scepheo 2014-10-19 22:42:46 +00:00
parent 4e3188e091
commit b4d065869e
2 changed files with 143 additions and 132 deletions

View File

@ -28,145 +28,147 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditSubtitlesForm));
this.Cancel = new System.Windows.Forms.Button();
this.OK = new System.Windows.Forms.Button();
this.SubGrid = new System.Windows.Forms.DataGridView();
this.Frame = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.X = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Y = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Length = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DispColor = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Message = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Export = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.SubGrid)).BeginInit();
this.SuspendLayout();
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(647, 266);
this.Cancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(100, 28);
this.Cancel.TabIndex = 0;
this.Cancel.Text = "&Cancel";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// OK
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OK.Location = new System.Drawing.Point(539, 266);
this.OK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(100, 28);
this.OK.TabIndex = 1;
this.OK.Text = "&Ok";
this.OK.UseVisualStyleBackColor = true;
this.OK.Click += new System.EventHandler(this.OK_Click);
//
// SubGrid
//
this.SubGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditSubtitlesForm));
this.Cancel = new System.Windows.Forms.Button();
this.OK = new System.Windows.Forms.Button();
this.SubGrid = new System.Windows.Forms.DataGridView();
this.Export = new System.Windows.Forms.Button();
this.Frame = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.X = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Y = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Length = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DispColor = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Message = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.SubGrid)).BeginInit();
this.SuspendLayout();
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(647, 266);
this.Cancel.Margin = new System.Windows.Forms.Padding(4);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(100, 28);
this.Cancel.TabIndex = 0;
this.Cancel.Text = "&Cancel";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// OK
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OK.Location = new System.Drawing.Point(539, 266);
this.OK.Margin = new System.Windows.Forms.Padding(4);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(100, 28);
this.OK.TabIndex = 1;
this.OK.Text = "&Ok";
this.OK.UseVisualStyleBackColor = true;
this.OK.Click += new System.EventHandler(this.OK_Click);
//
// SubGrid
//
this.SubGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.SubGrid.BackgroundColor = System.Drawing.SystemColors.ControlLight;
this.SubGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.SubGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.SubGrid.BackgroundColor = System.Drawing.SystemColors.ControlLight;
this.SubGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.SubGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Frame,
this.X,
this.Y,
this.Length,
this.DispColor,
this.Message});
this.SubGrid.Location = new System.Drawing.Point(16, 15);
this.SubGrid.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.SubGrid.Name = "SubGrid";
this.SubGrid.Size = new System.Drawing.Size(731, 244);
this.SubGrid.TabIndex = 2;
this.SubGrid.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SubGrid_MouseDoubleClick);
//
// Frame
//
this.Frame.HeaderText = "Frame";
this.Frame.MaxInputLength = 7;
this.Frame.Name = "Frame";
this.Frame.ToolTipText = "The first frame the subtitle will be displayed (integer)";
this.Frame.Width = 75;
//
// X
//
this.X.HeaderText = "X";
this.X.MaxInputLength = 3;
this.X.Name = "X";
this.X.ToolTipText = "Screen coordinate (absolute)";
this.X.Width = 30;
//
// Y
//
this.Y.HeaderText = "Y";
this.Y.MaxInputLength = 3;
this.Y.Name = "Y";
this.Y.ToolTipText = "Screen coordinate (absolute)";
this.Y.Width = 30;
//
// Length
//
this.Length.HeaderText = "Length";
this.Length.MaxInputLength = 5;
this.Length.Name = "Length";
this.Length.ToolTipText = "How long subtitle will be displayed";
this.Length.Width = 50;
//
// DispColor
//
this.DispColor.HeaderText = "Color";
this.DispColor.MaxInputLength = 8;
this.DispColor.Name = "DispColor";
this.DispColor.ToolTipText = "Color of subtitle text";
this.DispColor.Width = 60;
//
// Message
//
this.Message.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.Message.HeaderText = "Message";
this.Message.MaxInputLength = 255;
this.Message.MinimumWidth = 25;
this.Message.Name = "Message";
this.Message.ToolTipText = "What will be displayed";
//
// Export
//
this.Export.Location = new System.Drawing.Point(16, 266);
this.Export.Name = "Export";
this.Export.Size = new System.Drawing.Size(125, 28);
this.Export.TabIndex = 3;
this.Export.Text = "&Export to SubRip";
this.Export.UseVisualStyleBackColor = true;
this.Export.Click += new System.EventHandler(this.Export_Click);
//
// EditSubtitlesForm
//
this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(763, 309);
this.Controls.Add(this.Export);
this.Controls.Add(this.SubGrid);
this.Controls.Add(this.OK);
this.Controls.Add(this.Cancel);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MinimumSize = new System.Drawing.Size(245, 139);
this.Name = "EditSubtitlesForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Subtitles";
this.Load += new System.EventHandler(this.EditSubtitlesForm_Load);
((System.ComponentModel.ISupportInitialize)(this.SubGrid)).EndInit();
this.ResumeLayout(false);
this.SubGrid.Location = new System.Drawing.Point(16, 15);
this.SubGrid.Margin = new System.Windows.Forms.Padding(4);
this.SubGrid.Name = "SubGrid";
this.SubGrid.Size = new System.Drawing.Size(731, 244);
this.SubGrid.TabIndex = 2;
this.SubGrid.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.SubGrid_DefaultValuesNeeded);
this.SubGrid.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SubGrid_MouseDoubleClick);
//
// Export
//
this.Export.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.Export.Location = new System.Drawing.Point(16, 266);
this.Export.Name = "Export";
this.Export.Size = new System.Drawing.Size(125, 28);
this.Export.TabIndex = 3;
this.Export.Text = "&Export to SubRip";
this.Export.UseVisualStyleBackColor = true;
this.Export.Click += new System.EventHandler(this.Export_Click);
//
// Frame
//
this.Frame.HeaderText = "Frame";
this.Frame.MaxInputLength = 7;
this.Frame.Name = "Frame";
this.Frame.ToolTipText = "The first frame the subtitle will be displayed (integer)";
this.Frame.Width = 75;
//
// X
//
this.X.HeaderText = "X";
this.X.MaxInputLength = 3;
this.X.Name = "X";
this.X.ToolTipText = "Screen coordinate (absolute)";
this.X.Width = 30;
//
// Y
//
this.Y.HeaderText = "Y";
this.Y.MaxInputLength = 3;
this.Y.Name = "Y";
this.Y.ToolTipText = "Screen coordinate (absolute)";
this.Y.Width = 30;
//
// Length
//
this.Length.HeaderText = "Length";
this.Length.MaxInputLength = 5;
this.Length.Name = "Length";
this.Length.ToolTipText = "How long subtitle will be displayed";
this.Length.Width = 50;
//
// DispColor
//
this.DispColor.HeaderText = "Color";
this.DispColor.MaxInputLength = 8;
this.DispColor.Name = "DispColor";
this.DispColor.ToolTipText = "Color of subtitle text";
this.DispColor.Width = 60;
//
// Message
//
this.Message.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.Message.HeaderText = "Message";
this.Message.MaxInputLength = 255;
this.Message.MinimumWidth = 25;
this.Message.Name = "Message";
this.Message.ToolTipText = "What will be displayed";
//
// EditSubtitlesForm
//
this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(763, 309);
this.Controls.Add(this.Export);
this.Controls.Add(this.SubGrid);
this.Controls.Add(this.OK);
this.Controls.Add(this.Cancel);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4);
this.MinimumSize = new System.Drawing.Size(245, 139);
this.Name = "EditSubtitlesForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Subtitles";
this.Load += new System.EventHandler(this.EditSubtitlesForm_Load);
((System.ComponentModel.ISupportInitialize)(this.SubGrid)).EndInit();
this.ResumeLayout(false);
}
@ -175,12 +177,12 @@
private System.Windows.Forms.Button Cancel;
private System.Windows.Forms.Button OK;
private System.Windows.Forms.DataGridView SubGrid;
private System.Windows.Forms.Button Export;
private System.Windows.Forms.DataGridViewTextBoxColumn Frame;
private System.Windows.Forms.DataGridViewTextBoxColumn X;
private System.Windows.Forms.DataGridViewTextBoxColumn Y;
private System.Windows.Forms.DataGridViewTextBoxColumn Length;
private System.Windows.Forms.DataGridViewTextBoxColumn DispColor;
private System.Windows.Forms.DataGridViewTextBoxColumn Message;
private System.Windows.Forms.Button Export;
}
}

View File

@ -217,5 +217,14 @@ namespace BizHawk.Client.EmuHawk
"Success"
);
}
private void SubGrid_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
{
e.Row.Cells["Frame"].Value = 0;
e.Row.Cells["X"].Value = 0;
e.Row.Cells["Y"].Value = 0;
e.Row.Cells["Length"].Value = 0;
e.Row.Cells["DispColor"].Value = "FFFFFFFF";
}
}
}