Beispiel #1
0
        private void _SetupStartupGroup(FlowLayoutPanel panel)
        {
            var startupGroupBox = new GroupBox
            {
                Text     = Resource.OptionsStartup,
                AutoSize = true,
                Margin   = this._groupBoxPadding,
                Height   = 0,
                Parent   = panel
            };

            var startupGroupBoxPanel = BufermanOptionsWindow._CreateGroupBoxPanel(startupGroupBox);

            var showUserModeNotificationCheckbox = new CheckBox()
            {
                Text     = Resource.OptionsAdministratorModeReminder,
                Checked  = this._settingsGetter.ShowUserModeNotification,
                AutoSize = true,
                Parent   = startupGroupBoxPanel
            };
            var userModeTooltip = new ToolTip()
            {
                InitialDelay = 0,
                IsBalloon    = true
            };

            userModeTooltip.SetToolTip(showUserModeNotificationCheckbox, Resource.OptionsAdministratorModeReminderTooltip);

            showUserModeNotificationCheckbox.CheckedChanged += (object sender, EventArgs args) =>
            {
                this._settingsSetter.ShowUserModeNotification = showUserModeNotificationCheckbox.Checked;

                this._saveButton.Enabled    = this._settingsSetter.IsDirty;
                this._restoreButton.Enabled = !this._settingsSetter.IsDefault;
            };

            var restorePreviousSessionCheckbox = new CheckBox()
            {
                Text     = Resource.OptionsRestorePreviousSession,
                Checked  = this._settingsGetter.RestorePreviousSession,
                AutoSize = true,
                Parent   = startupGroupBoxPanel
            };

            var restoreSessionTooltip = new ToolTip()
            {
                InitialDelay = 0,
                IsBalloon    = true
            };

            restoreSessionTooltip.SetToolTip(restorePreviousSessionCheckbox, Resource.OptionsRestorePreviousSessionTooltip);

            restorePreviousSessionCheckbox.CheckedChanged += (object sender, EventArgs args) =>
            {
                this._settingsSetter.RestorePreviousSession = restorePreviousSessionCheckbox.Checked;

                this._saveButton.Enabled    = this._settingsSetter.IsDirty;
                this._restoreButton.Enabled = !this._settingsSetter.IsDefault;
            };
        }
Beispiel #2
0
        private void _SetupFocusTooltipGroup(FlowLayoutPanel panel)
        {
            var tooltipGroupBox = new GroupBox
            {
                Text     = Resource.OptionsFocusBuferTooltip,
                AutoSize = true,
                Margin   = this._groupBoxPadding,
                Height   = 0,
                Parent   = panel
            };

            var onFocusTooltipGroupBoxPanel = BufermanOptionsWindow._CreateGroupBoxPanel(tooltipGroupBox);

            var focusTooltipCheckbox = new CheckBox
            {
                Text     = Resource.OptionsFocusBuferEnableDisable,
                AutoSize = true,
                Checked  = this._settingsGetter.ShowFocusTooltip,
                Parent   = onFocusTooltipGroupBoxPanel
            };

            var tooltipDurationPanel = new FlowLayoutPanel
            {
                AutoSize      = true,
                FlowDirection = FlowDirection.LeftToRight,
                Parent        = onFocusTooltipGroupBoxPanel,
                Margin        = new Padding(0)
            };

            var tooltipDurationInput = new NumericUpDown()
            {
                AutoSize  = true,
                Minimum   = 1234,
                Maximum   = 9876,
                Increment = 250,
                Enabled   = this._settingsGetter.ShowFocusTooltip,
                Parent    = tooltipDurationPanel
            };

            tooltipDurationInput.Value = this._settingsGetter.FocusTooltipDuration;

            focusTooltipCheckbox.CheckedChanged += (object sender, EventArgs args) =>
            {
                this._settingsSetter.ShowFocusTooltip = focusTooltipCheckbox.Checked;
                tooltipDurationInput.Enabled          = focusTooltipCheckbox.Checked;

                this._saveButton.Enabled    = this._settingsSetter.IsDirty;
                this._restoreButton.Enabled = !this._settingsSetter.IsDefault;
            };
            var tooltipDurationLabel = new Label
            {
                Text     = Resource.OptionsFocusBuferTooltipDurationText,
                AutoSize = true,
                Anchor   = AnchorStyles.Top | AnchorStyles.Bottom,
                Padding  = new Padding(0, 5, 5, 5),
                Parent   = tooltipDurationPanel
            };

            tooltipDurationInput.ValueChanged += (object sender, EventArgs args) =>
            {
                this._settingsSetter.FocusTooltipDuration = (int)tooltipDurationInput.Value;

                this._saveButton.Enabled    = this._settingsSetter.IsDirty;
                this._restoreButton.Enabled = !this._settingsSetter.IsDefault;
            };
        }