//ToolStrip Menu controls for DataGrid private void programToolStripMenuItem_Click(object sender, EventArgs e) { //Run Key Programming Wizard DialogResult KeyWizardAnswer; byte CurrentKey = (byte)(G_KeyMap.CurrentRow.Index + 1); StopQuickProgram(); //Right-Click Menu of DataGrid, Program ProgramWizard KeyWizard = new ProgramWizard(); KeyWizard.InitProgramWizard(SpecialKeyPlayer, (byte)CurrentKey); KeyWizardAnswer = KeyWizard.ShowDialog(); if (KeyWizardAnswer == DialogResult.OK) { //Wizard completed with "Finish", reprogram this key KeyMaps[CurrentKey - 1] = KeyWizard.WizardResult(); //Not needed with new GetKeyMap code //DX1 Single Key Program //int offset = (CurrentKey - 1) * 3; //mKeyMap[offset++] = CurrentKey; //mKeyMap[offset++] = KeyMaps[CurrentKey].Type; //mKeyMap[offset++] = KeyMaps[CurrentKey].Action; SaveButtonstoProfile(CurrentProfile.ProfName); ReBuildKeyMap(); } }
private void PropertiesStripMenuItem_Click(object sender, EventArgs e) { //Directly displaying the properties of the key DialogResult KeyWizardAnswer; byte CurrentKey = (byte)(G_KeyMap.CurrentRow.Index); StopQuickProgram(); ProgramWizard KeyWizard = new ProgramWizard(); KeyWizard.InitKeyProperties(KeyMaps[CurrentKey]); KeyWizardAnswer = KeyWizard.ShowDialog(); if (KeyWizardAnswer == DialogResult.OK) { //For now, only Description can be changed using the Properties, so only get that change KeyMaps[CurrentKey].Description = KeyWizard.WizardResult().Description; SaveButtonstoProfile(CurrentProfile.ProfName); ReBuildKeyMap(); } }