diff --git a/PluginExample/ExampleForm.cs b/PluginExample/ExampleForm.cs new file mode 100644 index 000000000..71335e9d5 --- /dev/null +++ b/PluginExample/ExampleForm.cs @@ -0,0 +1,29 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 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.Collections.Generic; +using System.Text; +using GreenshotPlugin.Controls; + +namespace PluginExample { + public class ExampleForm : GreenshotForm{ + } +} diff --git a/PluginExample/PluginExample.csproj b/PluginExample/PluginExample.csproj index 14d36a89e..b202b6349 100644 --- a/PluginExample/PluginExample.csproj +++ b/PluginExample/PluginExample.csproj @@ -1,5 +1,5 @@  - + {6BD38118-B27F-43A1-951C-FB6464D39260} Debug @@ -49,13 +49,18 @@ + + Form + - + + Form + SettingsForm.cs diff --git a/PluginExample/SettingsForm.Designer.cs b/PluginExample/SettingsForm.Designer.cs index 6e7903796..2702f9c73 100644 --- a/PluginExample/SettingsForm.Designer.cs +++ b/PluginExample/SettingsForm.Designer.cs @@ -48,16 +48,18 @@ namespace PluginExample /// private void InitializeComponent() { - this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox1 = new GreenshotPlugin.Controls.GreenshotCheckBox(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); - this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new GreenshotPlugin.Controls.GreenshotCheckBox(); this.SuspendLayout(); // // checkBox1 // this.checkBox1.Location = new System.Drawing.Point(12, 12); this.checkBox1.Name = "checkBox1"; + this.checkBox1.PropertyName = "AnnotationProcessor"; + this.checkBox1.SectionName = "PluginExample"; this.checkBox1.Size = new System.Drawing.Size(152, 24); this.checkBox1.TabIndex = 0; this.checkBox1.Text = "Annotation processor"; @@ -87,6 +89,8 @@ namespace PluginExample // this.checkBox2.Location = new System.Drawing.Point(12, 42); this.checkBox2.Name = "checkBox2"; + this.checkBox2.PropertyName = "GreyScaleProcessor"; + this.checkBox2.SectionName = "PluginExample"; this.checkBox2.Size = new System.Drawing.Size(152, 24); this.checkBox2.TabIndex = 3; this.checkBox2.Text = "Greyscale processor"; @@ -104,10 +108,11 @@ namespace PluginExample this.Name = "SettingsForm"; this.Text = "Plugin example settings"; this.ResumeLayout(false); + } - private System.Windows.Forms.CheckBox checkBox2; + private GreenshotPlugin.Controls.GreenshotCheckBox checkBox2; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button1; - private System.Windows.Forms.CheckBox checkBox1; + private GreenshotPlugin.Controls.GreenshotCheckBox checkBox1; } } diff --git a/PluginExample/SettingsForm.cs b/PluginExample/SettingsForm.cs index 34a5bb64b..d7c45c407 100644 --- a/PluginExample/SettingsForm.cs +++ b/PluginExample/SettingsForm.cs @@ -28,7 +28,7 @@ namespace PluginExample { /// /// Description of SettingsForm. /// - public partial class SettingsForm : Form { + public partial class SettingsForm : ExampleForm { private static PluginExampleConfiguration conf = IniConfig.GetIniSection(); public SettingsForm() { @@ -36,13 +36,9 @@ namespace PluginExample { // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); - checkBox1.Checked = conf.AnnotationProcessor; - checkBox2.Checked = conf.GreyscaleProcessor; } void Button1Click(object sender, EventArgs e) { - conf.AnnotationProcessor = checkBox1.Checked; - conf.GreyscaleProcessor = checkBox2.Checked; DialogResult = DialogResult.OK; }