private void btnHelp_Click(object sender, EventArgs e) { HelpUserForm.HelpForm f = new HelpUserForm.HelpForm(); HelperFunc.CreateFormStartPosition(ref f, this); f.ShowDialog(); }
private void btnPickHotkeys_Click(object sender, EventArgs e) { unsafe { HotKeyDataHolder hkdh; ThemeDataHolder tdh; HotKeyPickerForm hkpf = new HotKeyPickerForm(&hkdh, &tdh, HotKeys); HelperFunc.CreateFormStartPosition(ref hkpf, this); DialogResult result = hkpf.ShowDialog(); if (result == DialogResult.OK) { string themePathFromCSTR1 = new string(tdh.ThemePath1); string themePathFromCSTR2 = new string(tdh.ThemePath2); //After the form is closed we can make a new KeyValuePair for our dictionary and register the key. RegisterHotKey(Handle, hkdh.id, hkdh.keyModifier, hkdh.keyHashCode); HotKeys.Add( HotKey.FormNewHotKey(hkdh), new ThemePathContainer(themePathFromCSTR1, themePathFromCSTR2) ); } } logStatus(); }
private void btnRemoveHotkey_Click(object sender, EventArgs e) { unsafe { HotKeyDataHolder hkdh; HotKeyRemovalForm hkrf = new HotKeyRemovalForm(&hkdh, HotKeys); HelperFunc.CreateFormStartPosition(ref hkrf, this); DialogResult result = hkrf.ShowDialog(); switch (result) { case DialogResult.OK: HotKey hk = new HotKey(hkdh.id, hkdh.keyModifier, hkdh.key); HotKeys.Remove(hk); UnregisterHotKey(Handle, hk.id); break; case DialogResult.Yes: foreach (KeyValuePair <HotKey, ThemePathContainer> entry in HotKeys) { UnregisterHotKey(Handle, entry.Key.id); } HotKeys = new Dictionary <HotKey, ThemePathContainer>(); break; } } logStatus(); }
private void btnOpenAdvanced_Click(object sender, EventArgs e) { AdvancedUserSettingsForm f = new AdvancedUserSettingsForm(USettings.GetOptions()); HelperFunc.CreateFormStartPosition(ref f, this); DialogResult result = f.ShowDialog(); if (result == DialogResult.OK) { USettings = f.USettingsOptions; } logStatus(); }
private void btnPickHotKey_Click(object sender, EventArgs e) { PickHotKeyDialog phkd = new PickHotKeyDialog(); HelperFunc.CreateFormStartPosition(ref phkd, this); DialogResult result = phkd.ShowDialog(); if (result != DialogResult.OK) { return; } HKKey = phkd.Key; HKKeyMod = phkd.KeyMod; lblKeyOK.Text = @"Finished"; lblKeyOK.ForeColor = Color.Green; }