/// <summary> /// Reads the hot key configuration and setup the UI elements accordingly /// </summary> /// <param name="Id">Configuration type to be read</param> /// <param name="cb">Checkbox to show enable/disable status</param> /// <param name="txt">Textbox to show description string</param> private void LoadHotKey(Shortcuts.SC_Type Id, CheckBox cb, TextBox txt) { ShortcutsKey key = sc.Key_Get(Id); cb.Checked = key.used; txt.Text = key.GetDescriptionString(); }
private void Settings_Load(object sender, EventArgs e) { sc = ((Form1)Owner).sc; om = ((Form1)Owner).om; ShortcutsKey key; key = sc.Key_Get(Shortcuts.SC_Type.SC_Type_Reset); cbScReset.Checked = key.used; if (key.valid) { txtReset.Text = key.GetDescriptionString(); } key = sc.Key_Get(Shortcuts.SC_Type.SC_Type_Hit); cbScHit.Checked = key.used; if (key.valid) { txtHit.Text = key.GetDescriptionString(); } key = sc.Key_Get(Shortcuts.SC_Type.SC_Type_HitUndo); cbScHitUndo.Checked = key.used; if (key.valid) { txtHitUndo.Text = key.GetDescriptionString(); } key = sc.Key_Get(Shortcuts.SC_Type.SC_Type_Split); cbScNextSplit.Checked = key.used; if (key.valid) { txtNextSplit.Text = key.GetDescriptionString(); } key = sc.Key_Get(Shortcuts.SC_Type.SC_Type_SplitPrev); cbScPrevSplit.Checked = key.used; if (key.valid) { txtPrevSplit.Text = key.GetDescriptionString(); } txtInput.Text = om.FilePathIn; txtOutput.Text = om.FilePathOut; radioHotKeyMethod_sync.Checked = (sc.NextStart_Method == Shortcuts.SC_HotKeyMethod.SC_HotKeyMethod_Sync); radioHotKeyMethod_async.Checked = (sc.NextStart_Method == Shortcuts.SC_HotKeyMethod.SC_HotKeyMethod_Async); cbShowAttempts.Checked = om.ShowAttemptsCounter; cbShowHeadline.Checked = om.ShowHeadline; cbShowSessionProgress.Checked = om.ShowSessionProgress; numShowSplitsCountFinished.Value = om.ShowSplitsCountFinished; numShowSplitsCountUpcoming.Value = om.ShowSplitsCountUpcoming; cbApCustomCss.Checked = om.StyleUseCustom; txtCssUrl.Text = om.StyleCssUrl; txtFontUrl.Text = om.StyleFontUrl; txtFontName.Text = om.StyleFontName; numStyleDesiredWidth.Value = om.StyleDesiredWidth; cbApHighContrast.Checked = om.StyleUseHighContrast; if (!sc.IsGlobalHotKeySupported) { tab_globalshortcuts.Text = tab_globalshortcuts.Text + " (OS not supported)"; tab_globalshortcuts.Enabled = false; } IsFormLoaded = true; }