public MenuButton(Texture2D tex, Vector2 pos, int val, buttonclick clickevent) { texture = tex; position = pos; value = val; onClick = clickevent; color = Color.White; }
public void button5_Click(object sender, EventArgs e) { if (button5.InvokeRequired) { buttonclick callback = new buttonclick(button5_Click); this.Invoke(callback, new object[] { sender, e }); return; } Master.doBHop = !Master.doBHop; if (Master.doBHop) { synthesizer.SpeakAsync("B Hop Enabled"); } else { synthesizer.SpeakAsync("B Hop Disabled"); } }
public void button2_Click(object sender, EventArgs e) { if (button2.InvokeRequired) { buttonclick callback = new buttonclick(button2_Click); this.Invoke(callback, new object[] { sender, e }); return; } if (Master.mode == 0) { synthesizer.SpeakAsync("Slow"); Master.mode = 1; button2.Text = "Mode: Slow (Key 7)"; } else { synthesizer.SpeakAsync("Fast"); Master.mode = 0; button2.Text = "Mode: Fast (Key 7)"; } }
// -- Button Events -- \\ public void button1_Click(object sender, EventArgs e) { if (button1.InvokeRequired) { buttonclick callback = new buttonclick(button1_Click); this.Invoke(callback, new object[] { sender, e }); return; } Master.enabled = !Master.enabled; if (Master.enabled) { label1.ForeColor = Color.LimeGreen; synthesizer.SpeakAsync("Enabled"); label1.Text = "On"; } else { label1.ForeColor = Color.Red; synthesizer.SpeakAsync("Disabled"); label1.Text = "Off"; } }