/// <summary> /// Helper to load Settings and populate the form elements /// <see cref="Settings"/> /// </summary> public void LoadSettings() { // line LineThickness = Settings.LineThickness; tB_LineThickness.Text = LineThickness.ToString(); LineMaxLength = Settings.LineMaxLength; tB_LineMaxLength.Text = LineMaxLength.ToString(); LineDividerLengthFactor = Settings.LineSubdividerLengthFactor; tB_LineDividerLengthFactor.Text = LineDividerLengthFactor.ToString(); ScaleStyle = Settings.Style; lB_ScaleStyle.DataStore = Enum.GetNames(typeof(ScaleOverlay.ScaleStyle)); // text TextHeight = Settings.TextHeight; tB_TextHeight.Text = TextHeight.ToString(); TextFont = Settings.TextFont; fP_TextFont.Value = TextFont.ToEtoFont(); // position OffsetX = Settings.OffsetX; tB_OffsetX.Text = OffsetX.ToString(); OffsetY = Settings.OffsetY; tB_OffsetY.Text = OffsetY.ToString(); TextGap = Settings.TextGap; tB_TextGap.Text = TextGap.ToString(); // color LineColor = Settings.LineColor; btn_LineColor.BackgroundColor = LineColor.ToEto(); TextColor = Settings.TextColor; btn_TextColor.BackgroundColor = TextColor.ToEto(); }
private void tB_LineDividerLengthFactor_TextChanged(object sender, EventArgs e) { if (double.TryParse(tB_LineDividerLengthFactor.Text, out var result)) { LineDividerLengthFactor = result; if (result < Settings.MinSubdividerFactor) { LineDividerLengthFactor = Settings.MinSubdividerFactor; } if (result > Settings.MaxSubdividerFactor) { LineDividerLengthFactor = Settings.MaxSubdividerFactor; } tB_LineDividerLengthFactor.Text = LineDividerLengthFactor.ToString(); } }