diff --git a/GreenshotPlugin/Controls/GreenshotForm.cs b/GreenshotPlugin/Controls/GreenshotForm.cs index cb079c28e..56579c72b 100644 --- a/GreenshotPlugin/Controls/GreenshotForm.cs +++ b/GreenshotPlugin/Controls/GreenshotForm.cs @@ -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() { + } + /// /// Store all GreenshotControl values to the configuration /// @@ -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; diff --git a/GreenshotPlugin/Controls/GreenshotRadioButton.cs b/GreenshotPlugin/Controls/GreenshotRadioButton.cs new file mode 100644 index 000000000..ec8e76bcf --- /dev/null +++ b/GreenshotPlugin/Controls/GreenshotRadioButton.cs @@ -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 . + */ +using System; +using System.ComponentModel; +using System.Windows.Forms; + +namespace GreenshotPlugin.Controls { + /// + /// Description of GreenshotCheckbox. + /// + 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; + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/GreenshotPlugin.csproj b/GreenshotPlugin/GreenshotPlugin.csproj index 759d8c5a2..f55dd9545 100644 --- a/GreenshotPlugin/GreenshotPlugin.csproj +++ b/GreenshotPlugin/GreenshotPlugin.csproj @@ -31,6 +31,9 @@ Form + + Component +