added GreenshotRadioButton

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2498 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
JKlingen 2013-02-17 13:49:35 +00:00
commit ebad49261d
3 changed files with 72 additions and 0 deletions

View file

@ -422,6 +422,12 @@ namespace GreenshotPlugin.Controls {
checkBox.Enabled = !iniValue.IsFixed;
continue;
}
RadioButton radíoButton = controlObject as RadioButton;
if (radíoButton != null) {
radíoButton.Checked = (bool)iniValue.Value;
radíoButton.Enabled = !iniValue.IsFixed;
continue;
}
TextBox textBox = controlObject as TextBox;
if (textBox != null) {
@ -449,8 +455,12 @@ namespace GreenshotPlugin.Controls {
}
}
}
OnFieldsFilled();
}
protected virtual void OnFieldsFilled() {
}
/// <summary>
/// Store all GreenshotControl values to the configuration
/// </summary>
@ -479,6 +489,12 @@ namespace GreenshotPlugin.Controls {
iniDirty = true;
continue;
}
RadioButton radioButton = controlObject as RadioButton;
if (radioButton != null) {
iniValue.Value = radioButton.Checked;
iniDirty = true;
continue;
}
TextBox textBox = controlObject as TextBox;
if (textBox != null) {
HotkeyControl hotkeyControl = controlObject as HotkeyControl;

View file

@ -0,0 +1,53 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2013 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace GreenshotPlugin.Controls {
/// <summary>
/// Description of GreenshotCheckbox.
/// </summary>
public class GreenshotRadioButton : RadioButton, IGreenshotLanguageBindable, IGreenshotConfigBindable {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey {
get;
set;
}
private string sectionName = "Core";
[Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")]
public string SectionName {
get {
return sectionName;
}
set {
sectionName = value;
}
}
[Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")]
public string PropertyName {
get;
set;
}
}
}