using System; using System.Collections.Generic; using System.Text; using Peltarion.Core; using Peltarion.Settings; using Peltarion.Settings.Common; using SynapsePlugin; namespace SynapsePluginGui { public class SPlugGui : SPlug, GuiPlug, SettingProvider { #region GuiPlug Members public string[] Category { get { return new string[] { "Basic", "Home Grown" }; } } Gui gui; public IControl Control { get { return gui ?? (gui = new Gui(this)); } } #endregion #region SettingProvider Members public SettingTable GetSettings() { SettingTable t = new SettingTable(); t["Layout", "Inputs"] = new SettingInt(Inputs[0], "Number of input features. Age, AvgG, Chdn, ExEd, CR, Sex, SecE, AvgE, Pass, Fail"); t["Layout", "Outputs"] = new SettingInt(Outputs[0], "Number of output features. The first one is large if the police is found good. The second is large if (s)he is found bad"); t["Looks", "Border"] = new SettingEnum( gui.BorderStyle, "BorderStyle", delegate(System.Windows.Forms.BorderStyle bs) { gui.BorderStyle = bs; }); string[] names = new string[] { "Bill", "George", "Sara", "John", "Lucy" }; t["Annoyances", "Poppup"] = new SettingString("Pick one!", names, "Popp.", delegate(string s) { System.Windows.Forms.MessageBox.Show(s + "!"); }); return t; } #endregion } class Gui : IControl { SPlugGui target; public Gui(SPlugGui target) { this.target = target; Peltarion.GLib.Gui.StandardControl ctrl; ctrl = new Peltarion.GLib.Gui.StandardControl(); ctrl.ShortLabel = target.Name; ctrl.Label = "Good Cop/Bad Cop"; ctrl.ShowText = true; this.Controls.Add(ctrl); ctrl.Dock = System.Windows.Forms.DockStyle.Fill; } public override System.Drawing.Image GetMediumIcon() { return Properties.Resources.cuffs32; } } }