Checks if the specified form has lost focus, and if so, immediately restores the focus back.
상속: IDisposable
예제 #1
0
 /// <summary>
 /// Enables watchdogs
 /// </summary>
 private void enableWatchdogs()
 {
     if (_windowActiveWatchdog == null)
     {
         _windowActiveWatchdog = new WindowActiveWatchdog(this);
     }
 }
예제 #2
0
 /// <summary>
 /// Disables watchdogs
 /// </summary>
 private void removeWatchdogs()
 {
     if (_windowActiveWatchdog != null)
     {
         _windowActiveWatchdog.Dispose();
         _windowActiveWatchdog = null;
     }
 }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public ScreenLockSettingsForm()
        {
            InitializeComponent();

            _windowActiveWatchdog = new WindowActiveWatchdog(this);

            _dialogCommon = new DialogCommon(this);

            if (!_dialogCommon.Initialize())
            {
                Log.Debug("Initialization error");
            }

            initWidgetSettings();

            Load += ScreenLockSettingsForm_Load;
            FormClosing += ScreenLockSettingsForm_FormClosing;
        }
예제 #4
0
        /// <summary>
        /// Form has been loaded. Initialize
        /// </summary>
        private void ScreenLockSettingsForm_Load(object sender, EventArgs e)
        {
            tbPINCode.TextChanged += tbPINCode_TextChanged;
            tbPINCode.KeyPress += tbPINCode_KeyPress;

            _dialogCommon.OnLoad();

            Invoke(new MethodInvoker(delegate()
            {
                _windowActiveWatchdog = new WindowActiveWatchdog(this);
            }));

            subscribeToEvents();

            _dialogCommon.GetAnimationManager().Start(_dialogCommon.GetRootWidget());
        }
예제 #5
0
        /// <summary>
        /// Form has been loaded. Perform initialization
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void AbbreviationsEditorForm_Load(object sender, EventArgs e)
        {
            if (Add)
            {
                Windows.SetText(labelTitle, "Add Abbreviation");
                var widget = _dialogCommon.GetRootWidget().Finder.FindChild("lblDelete");
                if (widget != null)
                {
                    widget.Enabled = false;
                }
            }
            else
            {
                Windows.SetText(labelTitle, "Edit Abbreviation");
            }

            _windowActiveWatchdog = new WindowActiveWatchdog(this);

            initWidgetSettings();

            _dialogCommon.OnLoad();

            _dialogCommon.GetAnimationManager().Start(_dialogCommon.GetRootWidget());
        }
예제 #6
0
        /// <summary>
        /// Called when loaded. Create timers, position the window
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        /// </summary>
        private void TalkWindowForm_Load(object sender, EventArgs e)
        {
            if (_acatFont == null)
            {
                var fontFamily = Fonts.Instance.GetFontFamily("ACAT Icon");
                if (fontFamily != null)
                {
                    _acatFont = new Font(fontFamily, labelSpeaker.Font.Size);
                    labelSpeaker.Font = _acatFont;
                    labelClearText.Font = _acatFont;
                }
            }

            setFont(FontSize);
            updateVolumeStatus();
            CenterToScreen();
            _windowOverlapWatchdog = new WindowOverlapWatchdog(this);
            _windowActiveWatchdog = new WindowActiveWatchdog(this);
            textBox.SelectionStart = textBox.Text.Length;
            textBox.DeselectAll();
        }
예제 #7
0
 /// <summary>
 /// Form is loaded. Initialize
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">event args</param>
 private void NewFileNameForm_Load(object sender, EventArgs e)
 {
     _windowActiveWatchdog = new WindowActiveWatchdog(this);
     Shown += NewFileNameForm_Shown;
     textBoxFileName.TextChanged += new EventHandler(textBoxFileName_TextChanged);
 }
예제 #8
0
        /// <summary>
        /// Form has been loaded. Initlialize the controls
        /// on the form
        /// </summary>
        private void TextToSpeechSettingsForm_Load(object sender, EventArgs e)
        {
            lblVolumeText.Text = _initialVolume.RangeMin + " to " + _initialVolume.RangeMax;
            lblRateText.Text = _initialRate.RangeMin + " to " + _initialRate.RangeMax;
            lblPitchText.Text = _initialPitch.RangeMin + " to " + _initialPitch.RangeMax;
            lblTTSEngineName.Text = Context.AppTTSManager.ActiveEngine.Descriptor.Name;

            _windowActiveWatchdog = new WindowActiveWatchdog(this);
            _dialogCommon.OnLoad();
            subscribeToEvents();
            _dialogCommon.GetAnimationManager().Start(_dialogCommon.GetRootWidget());
        }
        /// <summary>
        /// Form has been loaded. Initlialize the controls
        /// on the form
        /// </summary>
        private void TextToSpeechSettingsForm_Load(object sender, EventArgs e)
        {
            lblVolumeText.Text = _initialVolume.RangeMin + " - " + _initialVolume.RangeMax;
            lblRateText.Text = _initialRate.RangeMin + " - " + _initialRate.RangeMax;
            lblPitchText.Text = _initialPitch.RangeMin + " - " + _initialPitch.RangeMax;
            lblTTSEngineName.Text = Context.AppTTSManager.ActiveEngine.Descriptor.Name;

            _windowActiveWatchdog = new WindowActiveWatchdog(this);
            _dialogCommon.OnLoad();
            subscribeToEvents();

            Windows.SetText(label1, label1.Text);
            Windows.SetText(lblTTSEngineName, lblTTSEngineName.Text);
            Windows.SetText(lblVolume, lblVolume.Text);
            Windows.SetText(lblSpeed, lblSpeed.Text);
            Windows.SetText(lblPitch, lblPitch.Text);
            Windows.SetText(lblVoice, lblVoice.Text);
            Windows.SetText(lblInstalledVoices, lblInstalledVoices.Text);

            _dialogCommon.GetAnimationManager().Start(_dialogCommon.GetRootWidget());
            selectInstalledVoiceRow();
        }