private void restoreDefaultsButton_Click(object sender, EventArgs e) { ConfigManager.RestoreDefaults(); LoadConfigManagerValuesIntoGUI(); }
private void LoadConfigManagerValuesIntoGUI() { try { cursorMagnetEnabledCheckbox.Checked = ConfigManager.cursorMagnetEnabled; cursorMagnetClippingThreshold.Value = (decimal)ConfigManager.cursorMagnetClippingThresholdMm; zoomboxStickyCheckBox.Checked = ConfigManager.zoomboxSticky; mouseMovementEyeGazeResumeUpDown.Value = ((decimal)ConfigManager.mouseMovementEyeGazeResumeMilliseconds) / 1000; keyboardActiveGazeResumeSecondsNumeric.Value = ((decimal)ConfigManager.keyboardEyeGazeResumeMilliseconds) / 1000; zoomWindowPctScreenNumeric.Value = (decimal)ConfigManager.zoomWindowPctScreen; zoomWindowMagnificationNumeric.Value = (decimal)ConfigManager.zoomWindowMagnificationPct; fixationMinDurationNumeric.Value = (decimal)ConfigManager.fixationMinDurationMs; fixationRadiusClickAndHoldMmNumeric.Value = (decimal)ConfigManager.fixationRadiusClickAndHoldMm; fixationDurationClickAndHoldZoomboxNumeric.Value = ConfigManager.fixationDurationClickAndHoldZoombox; fixationInitTimeClickAndHoldMsNumeric.Value = ConfigManager.fixationInitTimeClickAndHoldMs; fixationRadiusForHoverMmNumeric.Value = ConfigManager.fixationRadiusForHoverMm; fixationDurationForHoverMsNumeric.Value = (decimal)ConfigManager.fixationDurationForHoverMs; fixationMinCursorActiveMs.Value = ConfigManager.fixationMinCursorActiveMs; cursorAlwaysFollowsGazeCheckbox.Checked = ConfigManager.cursorAlwaysFollowsGaze; fixationClickAndHoldCheckbox.Checked = ConfigManager.fixationClickAndHoldEnabled; hideCursorGazeCheckbox.Checked = ConfigManager.hideCursorDuringGaze; largeSaccadeMmNumeric.Value = ConfigManager.largeSaccadeThresholdMm; zoomboxEnabledCheckbox.Checked = ConfigManager.zoomboxEnabled; zoomboxGridCheckbox.Checked = ConfigManager.zoomboxGrid; zoomboxZoomAgainAfterMsNumeric.Value = ConfigManager.zoomboxZoomAgainAfterMs; zoomboxZoomAgainCheckbox.Checked = ConfigManager.zoomboxZoomAgain; zoomboxZoomAgainAfterMsNumeric.Enabled = zoomboxZoomAgainCheckbox.Checked; cursorMagnetClippingExitThresholdMmNumeric.Value = ConfigManager.cursorMagnetClippingExitThresholdMm; CursorMagnetClippingExitDurationMsNumeric.Value = ConfigManager.cursorMagnetClippingExitDurationMs; CursorMagnetClippingChangeBoxIntoPercNumeric.Value = ConfigManager.cursorMagnetClippingChangeBoxIntoPerc; CalibrationCircleSizeMmNumeric.Value = ConfigManager.calibrationCircleSizeMm; CalibrationSingleIterationTimeMsNumeric.Value = ConfigManager.calibrationIterationTimeMs; CalibrationIterationCountMaxNumeric.Value = ConfigManager.calibrationIterationCountMax; CalibrationCompletedThresholdMmNumeric.Value = ConfigManager.calibrationCompletedThresholdMm; CursorMagnetClippingMinBoxWidthMm.Value = ConfigManager.cursorMagnetClippingMinBoxWidthMm; fixationDurationClickAndHoldZoomboxNumeric.Value = ConfigManager.fixationDurationClickAndHoldZoombox; dockEnabledCheckbox.Checked = ConfigManager.dockEnabled; dockFixateToSelectButtonCheckbox.Checked = ConfigManager.dockFixateToSelectEnabled; dockButtonFixationMsNumeric.Value = ConfigManager.dockButtonFixationMs; dockFormMaxWidthMmNumeric.Value = ConfigManager.dockFormMaxWidthMm; dockButtonHeightMmNumeric.Value = ConfigManager.dockButtonHeightMm; onscreenKeyboardEnabledCheckbox.Checked = ConfigManager.onscreenKeyboardEnabled; onscreenKeyWidthMmNumeric.Value = ConfigManager.onscreenKeyWidthMm; onscreenKeyHeightMmNumeric.Value = ConfigManager.onscreenKeyHeightMm; } catch (Exception e) { Logger.WriteError(e.ToString()); //Revert to defaults and try again ConfigManager.RestoreDefaults(); LoadConfigManagerValuesIntoGUI(); } }
private void exitButton_Click(object sender, EventArgs e) { ConfigManager.SaveToDisk(); this.Hide(); }