Ejemplo n.º 1
0
        public ActionMenuForm(IConfigContext context, ActionMenuPluginConfig config)
        {
            _context = context;
            _config  = config;

            InitializeComponent();

            this.Shown               += OnLoad;
            this.textBox.KeyPress    += OnKeyPress;
            this.KeyPress            += OnKeyPress;
            this.textBox.KeyDown     += OnKeyDown;
            this.KeyDown             += OnKeyDown;
            this.textBox.TextChanged += OnTextChanged;
            this.listBox.GotFocus    += OnGotFocus;
            this.textBox.LostFocus   += OnLostFocus;

            this.TopMost         = true;
            this.ControlBox      = false;
            this.FormBorderStyle = FormBorderStyle.None;
            this.BackColor       = System.Drawing.Color.LimeGreen;
            this.TransparencyKey = System.Drawing.Color.LimeGreen;
            this.Text            = config.MenuTitle;
            this.Width           = config.MenuWidth;
            this.MinimumSize     = new Size(config.MenuWidth, config.MenuHeight);
            this.MaximumSize     = new Size(config.MenuWidth, 100000);
            this.AutoSize        = true;
            this.AutoSizeMode    = AutoSizeMode.GrowAndShrink;

            this.label.Text        = "";
            this.label.BackColor   = ColorToColor(config.Background);
            this.label.ForeColor   = ColorToColor(config.Foreground);
            this.textBox.BackColor = ColorToColor(config.Background);
            this.textBox.ForeColor = ColorToColor(config.Foreground);
            this.listBox.BackColor = ColorToColor(config.Background);
            this.listBox.ForeColor = ColorToColor(config.Foreground);

            this.textBox.AutoSize       = true;
            this.listBox.AutoSize       = true;
            this.listBox.IntegralHeight = true;

            this.label.Font   = new Font(config.FontName, config.FontSize, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            this.textBox.Font = new Font(config.FontName, config.FontSize, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            this.listBox.Font = new Font(config.FontName, config.FontSize, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));

            this.listBox.DisplayMember = "Text";
            this.listBox.ValueMember   = "Text";
        }
Ejemplo n.º 2
0
        public ActionMenuPlugin(ActionMenuPluginConfig config)
        {
            _config = config;

            DefaultMenu = CreateDefault();
        }
Ejemplo n.º 3
0
 public static ActionMenuPlugin AddActionMenu(this IConfigContext context, ActionMenuPluginConfig config = null)
 {
     return(context.Plugins.RegisterPlugin(new ActionMenuPlugin(config ?? new ActionMenuPluginConfig())));
 }