OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 6 Sep 2008 17:00:09 +0000 (17:00 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 6 Sep 2008 17:00:09 +0000 (17:00 +0000)
- Minor UI tweak to the Crop controls. Now uses radio buttons

git-svn-id: svn://localhost/HandBrake/trunk@1669 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Functions/Common.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx

index 179da77..c9d6519 100644 (file)
@@ -110,21 +110,17 @@ namespace Handbrake.Functions
             #region Picture\r
 \r
             if (presetQuery.CropTop == "0" && presetQuery.CropBottom == "0" && presetQuery.CropLeft == "0" && presetQuery.CropRight == "0")\r
-            {\r
-                mainWindow.drp_crop.SelectedIndex = 2;\r
-            }\r
+                mainWindow.check_autoCrop.Checked = true;\r
             else if (presetQuery.CropTop != null && presetQuery.CropBottom != null && presetQuery.CropLeft != null && presetQuery.CropRight != null)\r
             {\r
-                mainWindow.drp_crop.SelectedIndex = 1;\r
+                mainWindow.check_customCrop.Checked = true;\r
                 mainWindow.text_top.Text = presetQuery.CropTop;\r
                 mainWindow.text_bottom.Text = presetQuery.CropBottom;\r
                 mainWindow.text_left.Text = presetQuery.CropLeft;\r
                 mainWindow.text_right.Text = presetQuery.CropRight;\r
             }\r
             else\r
-            {\r
-                mainWindow.drp_crop.SelectedIndex = 0;\r
-            }\r
+                mainWindow.check_autoCrop.Checked = true;\r
 \r
             mainWindow.drp_deInterlace_option.Text = presetQuery.DeInterlace;\r
             mainWindow.drp_deNoise.Text = presetQuery.DeNoise;\r
@@ -524,9 +520,7 @@ namespace Handbrake.Functions
             string cropLeft = mainWindow.text_left.Text;\r
             string cropRight = mainWindow.text_right.Text;\r
 \r
-            if (mainWindow.drp_crop.Text == "No Crop")\r
-                query += " --crop 0:0:0:0 ";\r
-            else if (mainWindow.drp_crop.Text == "Custom")\r
+            if (mainWindow.check_customCrop.Checked)\r
             {\r
                 if (mainWindow.text_top.Text == string.Empty)\r
                     cropTop = "0";\r
index 0b42d5d..4ece909 100644 (file)
@@ -38,7 +38,7 @@ namespace Handbrake
             System.Windows.Forms.Label Label38;\r
             System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();\r
             this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
@@ -165,6 +165,8 @@ namespace Handbrake
             this.Label46 = new System.Windows.Forms.Label();\r
             this.Label40 = new System.Windows.Forms.Label();\r
             this.TabPage1 = new System.Windows.Forms.TabPage();\r
+            this.check_customCrop = new System.Windows.Forms.RadioButton();\r
+            this.check_autoCrop = new System.Windows.Forms.RadioButton();\r
             this.check_decomb = new System.Windows.Forms.CheckBox();\r
             this.label6 = new System.Windows.Forms.Label();\r
             this.drp_anamorphic = new System.Windows.Forms.ComboBox();\r
@@ -189,9 +191,7 @@ namespace Handbrake
             this.Label53 = new System.Windows.Forms.Label();\r
             this.Label52 = new System.Windows.Forms.Label();\r
             this.Label51 = new System.Windows.Forms.Label();\r
-            this.Label50 = new System.Windows.Forms.Label();\r
             this.Label15 = new System.Windows.Forms.Label();\r
-            this.drp_crop = new System.Windows.Forms.ComboBox();\r
             this.Check_ChapterMarkers = new System.Windows.Forms.CheckBox();\r
             this.advancedOptions = new System.Windows.Forms.TabControl();\r
             this.tab_chapters = new System.Windows.Forms.TabPage();\r
@@ -643,9 +643,9 @@ namespace Handbrake
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle1.Format = "N0";\r
-            dataGridViewCellStyle1.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
+            dataGridViewCellStyle11.Format = "N0";\r
+            dataGridViewCellStyle11.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle11;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
             this.number.Name = "number";\r
@@ -1851,6 +1851,8 @@ namespace Handbrake
             // TabPage1\r
             // \r
             this.TabPage1.BackColor = System.Drawing.Color.Transparent;\r
+            this.TabPage1.Controls.Add(this.check_customCrop);\r
+            this.TabPage1.Controls.Add(this.check_autoCrop);\r
             this.TabPage1.Controls.Add(this.check_decomb);\r
             this.TabPage1.Controls.Add(this.lbl_src_res);\r
             this.TabPage1.Controls.Add(this.label7);\r
@@ -1879,9 +1881,7 @@ namespace Handbrake
             this.TabPage1.Controls.Add(this.Label53);\r
             this.TabPage1.Controls.Add(this.Label52);\r
             this.TabPage1.Controls.Add(this.Label51);\r
-            this.TabPage1.Controls.Add(this.Label50);\r
             this.TabPage1.Controls.Add(this.Label15);\r
-            this.TabPage1.Controls.Add(this.drp_crop);\r
             this.TabPage1.Location = new System.Drawing.Point(4, 22);\r
             this.TabPage1.Name = "TabPage1";\r
             this.TabPage1.Padding = new System.Windows.Forms.Padding(3);\r
@@ -1889,6 +1889,30 @@ namespace Handbrake
             this.TabPage1.TabIndex = 0;\r
             this.TabPage1.Text = "Picture Settings";\r
             // \r
+            // check_customCrop\r
+            // \r
+            this.check_customCrop.AutoSize = true;\r
+            this.check_customCrop.Location = new System.Drawing.Point(16, 58);\r
+            this.check_customCrop.Name = "check_customCrop";\r
+            this.check_customCrop.Size = new System.Drawing.Size(74, 17);\r
+            this.check_customCrop.TabIndex = 34;\r
+            this.check_customCrop.Text = "Custom:";\r
+            this.check_customCrop.UseVisualStyleBackColor = true;\r
+            this.check_customCrop.CheckedChanged += new System.EventHandler(this.check_customCrop_CheckedChanged);\r
+            // \r
+            // check_autoCrop\r
+            // \r
+            this.check_autoCrop.AutoSize = true;\r
+            this.check_autoCrop.Checked = true;\r
+            this.check_autoCrop.Location = new System.Drawing.Point(16, 34);\r
+            this.check_autoCrop.Name = "check_autoCrop";\r
+            this.check_autoCrop.Size = new System.Drawing.Size(82, 17);\r
+            this.check_autoCrop.TabIndex = 33;\r
+            this.check_autoCrop.TabStop = true;\r
+            this.check_autoCrop.Text = "Automatic";\r
+            this.check_autoCrop.UseVisualStyleBackColor = true;\r
+            this.check_autoCrop.CheckedChanged += new System.EventHandler(this.check_autoCrop_CheckedChanged);\r
+            // \r
             // check_decomb\r
             // \r
             this.check_decomb.AutoSize = true;\r
@@ -1929,8 +1953,7 @@ namespace Handbrake
             // \r
             // text_bottom\r
             // \r
-            this.text_bottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
-            this.text_bottom.Location = new System.Drawing.Point(96, 130);\r
+            this.text_bottom.Location = new System.Drawing.Point(96, 147);\r
             this.text_bottom.Maximum = new decimal(new int[] {\r
             1080,\r
             0,\r
@@ -1942,8 +1965,7 @@ namespace Handbrake
             // \r
             // text_top\r
             // \r
-            this.text_top.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
-            this.text_top.Location = new System.Drawing.Point(96, 84);\r
+            this.text_top.Location = new System.Drawing.Point(96, 101);\r
             this.text_top.Maximum = new decimal(new int[] {\r
             1080,\r
             0,\r
@@ -1955,8 +1977,7 @@ namespace Handbrake
             // \r
             // text_left\r
             // \r
-            this.text_left.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
-            this.text_left.Location = new System.Drawing.Point(45, 106);\r
+            this.text_left.Location = new System.Drawing.Point(45, 123);\r
             this.text_left.Maximum = new decimal(new int[] {\r
             1920,\r
             0,\r
@@ -1968,8 +1989,7 @@ namespace Handbrake
             // \r
             // text_right\r
             // \r
-            this.text_right.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
-            this.text_right.Location = new System.Drawing.Point(147, 106);\r
+            this.text_right.Location = new System.Drawing.Point(147, 123);\r
             this.text_right.Maximum = new decimal(new int[] {\r
             1920,\r
             0,\r
@@ -2152,7 +2172,7 @@ namespace Handbrake
             this.Label53.AutoSize = true;\r
             this.Label53.BackColor = System.Drawing.Color.Transparent;\r
             this.Label53.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label53.Location = new System.Drawing.Point(94, 154);\r
+            this.Label53.Location = new System.Drawing.Point(94, 171);\r
             this.Label53.Name = "Label53";\r
             this.Label53.Size = new System.Drawing.Size(48, 13);\r
             this.Label53.TabIndex = 10;\r
@@ -2163,7 +2183,7 @@ namespace Handbrake
             this.Label52.AutoSize = true;\r
             this.Label52.BackColor = System.Drawing.Color.Transparent;\r
             this.Label52.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label52.Location = new System.Drawing.Point(103, 69);\r
+            this.Label52.Location = new System.Drawing.Point(103, 86);\r
             this.Label52.Name = "Label52";\r
             this.Label52.Size = new System.Drawing.Size(28, 13);\r
             this.Label52.TabIndex = 5;\r
@@ -2174,49 +2194,23 @@ namespace Handbrake
             this.Label51.AutoSize = true;\r
             this.Label51.BackColor = System.Drawing.Color.Transparent;\r
             this.Label51.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label51.Location = new System.Drawing.Point(190, 108);\r
+            this.Label51.Location = new System.Drawing.Point(190, 125);\r
             this.Label51.Name = "Label51";\r
             this.Label51.Size = new System.Drawing.Size(36, 13);\r
             this.Label51.TabIndex = 8;\r
             this.Label51.Text = "Right";\r
             // \r
-            // Label50\r
-            // \r
-            this.Label50.AutoSize = true;\r
-            this.Label50.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label50.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label50.Location = new System.Drawing.Point(13, 37);\r
-            this.Label50.Name = "Label50";\r
-            this.Label50.Size = new System.Drawing.Size(88, 13);\r
-            this.Label50.TabIndex = 1;\r
-            this.Label50.Text = "Select Option:";\r
-            // \r
             // Label15\r
             // \r
             this.Label15.AutoSize = true;\r
             this.Label15.BackColor = System.Drawing.Color.Transparent;\r
             this.Label15.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label15.Location = new System.Drawing.Point(13, 108);\r
+            this.Label15.Location = new System.Drawing.Point(13, 125);\r
             this.Label15.Name = "Label15";\r
             this.Label15.Size = new System.Drawing.Size(28, 13);\r
             this.Label15.TabIndex = 3;\r
             this.Label15.Text = "Left";\r
             // \r
-            // drp_crop\r
-            // \r
-            this.drp_crop.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
-            this.drp_crop.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.drp_crop.FormattingEnabled = true;\r
-            this.drp_crop.Items.AddRange(new object[] {\r
-            "Automatic",\r
-            "Custom",\r
-            "No Crop"});\r
-            this.drp_crop.Location = new System.Drawing.Point(103, 34);\r
-            this.drp_crop.Name = "drp_crop";\r
-            this.drp_crop.Size = new System.Drawing.Size(123, 21);\r
-            this.drp_crop.TabIndex = 2;\r
-            this.drp_crop.SelectedIndexChanged += new System.EventHandler(this.drp_crop_SelectedIndexChanged);\r
-            // \r
             // Check_ChapterMarkers\r
             // \r
             this.Check_ChapterMarkers.AutoSize = true;\r
@@ -3143,7 +3137,7 @@ namespace Handbrake
             // \r
             this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
             this.lbl_encode});\r
-            this.StatusStrip.Location = new System.Drawing.Point(0, 617);\r
+            this.StatusStrip.Location = new System.Drawing.Point(0, 619);\r
             this.StatusStrip.Name = "StatusStrip";\r
             this.StatusStrip.Size = new System.Drawing.Size(938, 22);\r
             this.StatusStrip.TabIndex = 7;\r
@@ -3160,7 +3154,7 @@ namespace Handbrake
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
-            this.ClientSize = new System.Drawing.Size(938, 639);\r
+            this.ClientSize = new System.Drawing.Size(938, 641);\r
             this.Controls.Add(this.GroupBox1);\r
             this.Controls.Add(this.groupBox_dest);\r
             this.Controls.Add(this.groupBox_output);\r
@@ -3273,9 +3267,7 @@ namespace Handbrake
         internal System.Windows.Forms.Label Label53;\r
         internal System.Windows.Forms.Label Label52;\r
         internal System.Windows.Forms.Label Label51;\r
-        internal System.Windows.Forms.Label Label50;\r
         internal System.Windows.Forms.Label Label15;\r
-        internal System.Windows.Forms.ComboBox drp_crop;\r
         internal System.Windows.Forms.TabControl advancedOptions;\r
         internal System.Windows.Forms.Label Label46;\r
         private System.Windows.Forms.GroupBox groupBox_dest;\r
@@ -3438,6 +3430,8 @@ namespace Handbrake
         private System.Windows.Forms.StatusStrip StatusStrip;\r
         private System.Windows.Forms.ToolStripStatusLabel lbl_encode;\r
         internal System.Windows.Forms.CheckBox check_decomb;\r
+        internal System.Windows.Forms.RadioButton check_customCrop;\r
+        internal System.Windows.Forms.RadioButton check_autoCrop;\r
 \r
     }\r
 }
\ No newline at end of file
index 7cd0784..7e673f1 100644 (file)
@@ -90,7 +90,6 @@ namespace Handbrake
             lblStatus.Text = "Setting up the GUI ...";\r
             Application.DoEvents();\r
             setupH264Panel();               // Initalize the H.264 Panel\r
-            drp_crop.SelectedIndex = 0;     // Set the default Cropping Option\r
             loadPresetPanel();              // Load the Preset Panel\r
             // Load the user's default settings or Normal Preset\r
             if (Properties.Settings.Default.defaultSettings == "Checked")\r
@@ -738,56 +737,34 @@ namespace Handbrake
                     text_height.BackColor = Color.LightGreen;\r
             }\r
         }\r
-        private void drp_crop_SelectedIndexChanged(object sender, EventArgs e)\r
+        private void check_customCrop_CheckedChanged(object sender, EventArgs e)\r
         {\r
-            if ((string)drp_crop.SelectedItem == "Custom")\r
+            text_left.Enabled = true;\r
+            text_right.Enabled = true;\r
+            text_top.Enabled = true;\r
+            text_bottom.Enabled = true;\r
+            if (selectedTitle != null)\r
             {\r
-                text_left.Enabled = true;\r
-                text_right.Enabled = true;\r
-                text_top.Enabled = true;\r
-                text_bottom.Enabled = true;\r
-                text_left.Text = "0";\r
-                text_right.Text = "0";\r
-                text_top.Text = "0";\r
-                text_bottom.Text = "0";\r
-            }\r
-\r
-            if ((string)drp_crop.SelectedItem == "Automatic")\r
-            {\r
-                text_left.Enabled = false;\r
-                text_right.Enabled = false;\r
-                text_top.Enabled = false;\r
-                text_bottom.Enabled = false;\r
-\r
-                if ((drp_dvdtitle.Text != "Automatic") && (selectedTitle != null))\r
-                {\r
-                    text_top.Text = selectedTitle.AutoCropDimensions[0].ToString();\r
-                    text_bottom.Text = selectedTitle.AutoCropDimensions[1].ToString();\r
-                    text_left.Text = selectedTitle.AutoCropDimensions[2].ToString();\r
-                    text_right.Text = selectedTitle.AutoCropDimensions[3].ToString();\r
-                }\r
-                else\r
-                {\r
-                    text_left.Text = "";\r
-                    text_right.Text = "";\r
-                    text_top.Text = "";\r
-                    text_bottom.Text = "";\r
-                }\r
-\r
+                text_top.Text = selectedTitle.AutoCropDimensions[0].ToString();\r
+                text_bottom.Text = selectedTitle.AutoCropDimensions[1].ToString();\r
+                text_left.Text = selectedTitle.AutoCropDimensions[2].ToString();\r
+                text_right.Text = selectedTitle.AutoCropDimensions[3].ToString();\r
             }\r
-\r
-            if ((string)drp_crop.SelectedItem == "No Crop")\r
+            else\r
             {\r
-                text_left.Enabled = false;\r
-                text_right.Enabled = false;\r
-                text_top.Enabled = false;\r
-                text_bottom.Enabled = false;\r
                 text_left.Text = "0";\r
                 text_right.Text = "0";\r
                 text_top.Text = "0";\r
                 text_bottom.Text = "0";\r
             }\r
         }\r
+        private void check_autoCrop_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            text_left.Enabled = false;\r
+            text_right.Enabled = false;\r
+            text_top.Enabled = false;\r
+            text_bottom.Enabled = false;\r
+        }\r
         private void check_vfr_CheckedChanged(object sender, EventArgs e)\r
         {\r
             if (check_vfr.CheckState == CheckState.Checked)\r
index 1b5323e..d0c9f18 100644 (file)
@@ -155,6 +155,12 @@ Make sure you have selected a "Title" from the "Source" box above otherwise
 the list will not be populated with the correct amount of chapters.\r
 Note: Do not change any of the chapter numbers!</value>\r
   </data>\r
+  <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>True</value>\r
+  </metadata>\r
+  <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>True</value>\r
+  </metadata>\r
   <metadata name="DVD_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>223, 15</value>\r
   </metadata>\r