Changed EditorForm to use language binding... long live search & replace...

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1834 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-05-04 13:01:04 +00:00
commit 71f44023c2
11 changed files with 306 additions and 350 deletions

View file

@ -21,14 +21,21 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
using GreenshotPlugin.Controls;
namespace Greenshot.Controls {
/// <summary>
/// Description of BindableToolStripButton.
/// </summary>
public class BindableToolStripButton : ToolStripButton, INotifyPropertyChanged {
public class BindableToolStripButton : ToolStripButton, INotifyPropertyChanged, IGreenshotLanguageBindable {
public event PropertyChangedEventHandler PropertyChanged;
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey {
get;
set;
}
public BindableToolStripButton() :base() {
this.CheckedChanged += new EventHandler(BindableToolStripButton_CheckedChanged);
}

View file

@ -21,14 +21,21 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
using GreenshotPlugin.Controls;
namespace Greenshot.Controls {
/// <summary>
/// A simple ToolStripComboBox implementing INotifyPropertyChanged for data binding
/// </summary>
public class BindableToolStripComboBox : ToolStripComboBox, INotifyPropertyChanged {
public class BindableToolStripComboBox : ToolStripComboBox, INotifyPropertyChanged, IGreenshotLanguageBindable {
public event PropertyChangedEventHandler PropertyChanged;
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey {
get;
set;
}
public BindableToolStripComboBox() :base() {
this.SelectedIndexChanged += new EventHandler(BindableToolStripComboBox_SelectedIndexChanged);
}

View file

@ -21,6 +21,7 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
using GreenshotPlugin.Controls;
namespace Greenshot.Controls {
/// <summary>
@ -28,10 +29,16 @@ namespace Greenshot.Controls {
/// Also, when a DropDownItem is selected, the DropDownButton adops its Tag and Image.
/// The selected tag can be accessed via SelectedTag property.
/// </summary>
public class BindableToolStripDropDownButton : ToolStripDropDownButton, INotifyPropertyChanged {
public class BindableToolStripDropDownButton : ToolStripDropDownButton, INotifyPropertyChanged, IGreenshotLanguageBindable {
public event PropertyChangedEventHandler PropertyChanged;
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey {
get;
set;
}
public BindableToolStripDropDownButton() {
}

View file

@ -23,15 +23,22 @@ using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using GreenshotPlugin.Controls;
namespace Greenshot.Controls {
/// <summary>
/// Description of ColorButton.
/// </summary>
public class ColorButton : Button {
public class ColorButton : Button, IGreenshotLanguageBindable {
public event PropertyChangedEventHandler PropertyChanged;
private Color selectedColor = Color.White;
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey {
get;
set;
}
public ColorButton() {
Click += new EventHandler(ColorButtonClick);
}

View file

@ -22,6 +22,8 @@ using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using GreenshotPlugin.Controls;
using System.ComponentModel;
namespace Greenshot.Controls {
/// <summary>
@ -45,7 +47,6 @@ namespace Greenshot.Controls {
/// <remarks>
/// Default value is false, which is the same behavior provided by the base ToolStrip class.
/// </remarks>
public bool ClickThrough {
get {
return this.clickThrough;

View file

@ -23,11 +23,18 @@ using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using GreenshotPlugin.Controls;
namespace Greenshot.Controls {
public class ToolStripColorButton : ToolStripButton, INotifyPropertyChanged {
public class ToolStripColorButton : ToolStripButton, INotifyPropertyChanged, IGreenshotLanguageBindable {
public event PropertyChangedEventHandler PropertyChanged;
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey {
get;
set;
}
private Color selectedColor = Color.Transparent;
public ToolStripColorButton() {

View file

@ -22,6 +22,8 @@ using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;
using GreenshotPlugin.Controls;
namespace Greenshot.Controls {
/// <summary>