Пример #1
0
            public General(Control _par)
            {
                this.Name     = "General";
                this.AutoSize = true;
                this.Size     = _par.Size.Shrink(Style.PaddingSize);
                this.Dock     = DockStyle.Fill;

                /**
                 *
                 * Left this as a reminder of how to setup a checkbox. The actual option doesn't even exist anymore.
                 *
                 * this.Controls.Add(new Elements.CheckBox(new Tuple<Func<bool>, Func<bool, bool>> (
                 *  new Func<bool>(() => { return Settings.S.CloseMenuOnDeFocus; }),
                 *  new Func<bool, bool>(_val => Settings.S.CloseMenuOnDeFocus = _val)
                 * ), "Close context menu(s) on Window defocus"));*/

                this.Controls.Add(new Elements.CheckBox(new Tuple <Func <bool>, Func <bool, bool> > (
                                                            new Func <bool>(() => { return(Settings.S.RememberSession); }),
                                                            new Func <bool, bool>(_val => Settings.S.RememberSession = _val)
                                                            ), "Remember Session"));

                this.Controls.Add(new Elements.CheckBox(new Tuple <Func <bool>, Func <bool, bool> > (
                                                            new Func <bool>(() => { return(Settings.S.RememberSize); }),
                                                            new Func <bool, bool>(_val => Settings.S.RememberSize = _val)
                                                            ), "Remember Window Size"));

                this.Controls.Add(new Elements.NewLine());

                Elements.Select enc = new Elements.Select(this);
                foreach (KeyValuePair <string, Encoding> e in Main.Encodings)
                {
                    enc.AddItem(e.Key);
                    if (e.Value == Settings.S.DefaultEncoding)
                    {
                        enc.SetDefault(e.Key);
                    }
                }
                enc.Selected += ix => {
                    Settings.S.DefaultEncoding = Main.Encodings.ElementAt(ix).Value;
                };

                this.Controls.Add(enc);
            }
Пример #2
0
            public Appearance(Control _par)
            {
                this.Name     = "Apperance";
                this.AutoSize = true;
                this.Size     = _par.Size.Shrink(Style.PaddingSize);
                this.Dock     = DockStyle.Fill;

                Elements.Select themesel = new Elements.Select(this);
                foreach (dynamic theme in Main.Themes)
                {
                    themesel.AddItem(theme.Name);
                }
                themesel.Selected += ix => {
                    Main.Themes[ix].Click(this, new EventArgs());
                    Main.SettingsWindow.Reload(1);
                };

                this.Controls.Add(new Elements.Text("Theme"));
                this.Controls.Add(themesel);
            }