summaryrefslogtreecommitdiffstats
path: root/win/C#/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-06-29 20:05:04 +0000
committersr55 <[email protected]>2009-06-29 20:05:04 +0000
commitfafb7a774fba159de59fd54e5bf10b53a2382f7d (patch)
tree7e6ec763fb01a49e12f204dbfe3ca011557d3979 /win/C#/Controls
parent36d3b711916f38c606a4ed5db77608a07d5efbbe (diff)
WinGui:
- Added Global Event Handlers to parts of some of the user controls. - Added register and deregister event handler functions for widget changes. (This allows the preset label to be changed to custom when a user changes a widget). This isn't finalised. - Misc UI tweaks - Few bug fixes: * Preset update notification appearing behind splashscreen * Tweaks to the preset loader to make it work a bit better. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2640 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Controls')
-rw-r--r--win/C#/Controls/AudioPanel.cs13
-rw-r--r--win/C#/Controls/Filters.cs21
-rw-r--r--win/C#/Controls/PictureSettings.cs15
3 files changed, 47 insertions, 2 deletions
diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs
index 57a258322..272f88ce8 100644
--- a/win/C#/Controls/AudioPanel.cs
+++ b/win/C#/Controls/AudioPanel.cs
@@ -11,6 +11,7 @@ namespace Handbrake.Controls
{
public partial class AudioPanel : UserControl
{
+ public event EventHandler AudioListChanged;
public AudioPanel()
{
InitializeComponent();
@@ -131,6 +132,10 @@ namespace Handbrake.Controls
newTrack.SubItems.Add(lbl_drc.Text);
lv_audioList.Items.Add(newTrack);
+ // The Audio List has changed to raise the event.
+ if (this.AudioListChanged != null)
+ this.AudioListChanged(this, new EventArgs());
+
// Select the newly added track and select the control
lv_audioList.Items[lv_audioList.Items.Count - 1].Selected = true;
lv_audioList.Select();
@@ -184,6 +189,10 @@ namespace Handbrake.Controls
// Remove the Item and reselect the control if the following conditions are met.
if (lv_audioList.SelectedItems.Count != 0)
{
+ // The Audio List is about to change so raise the event.
+ if (this.AudioListChanged != null)
+ this.AudioListChanged(this, new EventArgs());
+
// Record the current selected index.
int currentPosition = lv_audioList.SelectedIndices[0];
@@ -252,10 +261,14 @@ namespace Handbrake.Controls
public void addTrackForPreset(ListViewItem item)
{
lv_audioList.Items.Add(item);
+ if (this.AudioListChanged != null)
+ this.AudioListChanged(this, new EventArgs());
}
public void clearAudioList()
{
lv_audioList.Items.Clear();
+ if (this.AudioListChanged != null)
+ this.AudioListChanged(this, new EventArgs());
}
public int getNewID()
{
diff --git a/win/C#/Controls/Filters.cs b/win/C#/Controls/Filters.cs
index 22d2c5771..bfbc5e5ad 100644
--- a/win/C#/Controls/Filters.cs
+++ b/win/C#/Controls/Filters.cs
@@ -5,6 +5,8 @@ namespace Handbrake.Controls
{
public partial class Filters : UserControl
{
+ public event EventHandler FilterSettingsChanged;
+
public Filters()
{
InitializeComponent();
@@ -18,26 +20,45 @@ namespace Handbrake.Controls
private void drop_detelecine_SelectedIndexChanged(object sender, EventArgs e)
{
text_customDT.Visible = drop_detelecine.Text == "Custom";
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
}
private void drop_decomb_SelectedIndexChanged(object sender, EventArgs e)
{
text_customDC.Visible = drop_decomb.Text == "Custom";
if (drop_decomb.SelectedIndex != 0 && drop_deinterlace.SelectedIndex != 0)
drop_deinterlace.SelectedIndex = 0;
+
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
}
private void drop_deinterlace_SelectedIndexChanged(object sender, EventArgs e)
{
text_customDI.Visible = drop_deinterlace.Text == "Custom";
if (drop_decomb.SelectedIndex != 0 && drop_deinterlace.SelectedIndex != 0)
drop_decomb.SelectedIndex = 0;
+
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
}
private void drop_denoise_SelectedIndexChanged(object sender, EventArgs e)
{
text_customDN.Visible = drop_denoise.Text == "Custom";
+
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
}
private void slider_deblock_Scroll(object sender, EventArgs e)
{
lbl_deblockVal.Text = slider_deblock.Value == 4 ? "Off" : slider_deblock.Value.ToString();
+
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
}
// Returns the CLI query for the query generator.
diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs
index c35c2fa51..e490c2e63 100644
--- a/win/C#/Controls/PictureSettings.cs
+++ b/win/C#/Controls/PictureSettings.cs
@@ -1,5 +1,4 @@
using System;
-using System.Drawing;
using System.Globalization;
using System.Windows.Forms;
using Handbrake.Parsing;
@@ -24,6 +23,8 @@ namespace Handbrake.Controls
private Boolean looseAnamorphicHeightGuard;
private Boolean heightModJumpGaurd;
+ public event EventHandler PictureSettingsChanged;
+
// Window Setup
public PictureSettings()
{
@@ -112,7 +113,9 @@ namespace Handbrake.Controls
customAnamorphic(text_width);
break;
}
-
+ // A Picture Setting has changed so raise a PictureSettingsChanged event.
+ if (this.PictureSettingsChanged != null)
+ this.PictureSettingsChanged(this, new EventArgs());
}
private void text_height_ValueChanged(object sender, EventArgs e)
{
@@ -160,6 +163,10 @@ namespace Handbrake.Controls
heightChangeGuard = false;
looseAnamorphicHeightGuard = false;
heightModJumpGaurd = false;
+
+ // A Picture Setting has changed so raise a PictureSettingsChanged event.
+ if (this.PictureSettingsChanged != null)
+ this.PictureSettingsChanged(this, new EventArgs());
}
private void check_KeepAR_CheckedChanged(object sender, EventArgs e)
{
@@ -254,6 +261,10 @@ namespace Handbrake.Controls
break;
}
+
+ // A Picture Setting has changed so raise a PictureSettingsChanged event.
+ if (this.PictureSettingsChanged != null)
+ this.PictureSettingsChanged(this, new EventArgs());
}
// Custom Anamorphic Controls