/// <summary> /// Method for call the delagetes /// </summary> /// <param name="e"></param> protected virtual void OnButtonRepeatState(HTButtonEventArgs e) { if (this.ButtonRepeatState != null) { this.ButtonRepeatState(this, e); } }
/// <summary> /// Mouse up event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void OnMuoseUp(object sender, MouseEventArgs e) { // Change the state this.State = ButtonState.Normal; this.Invalidate(); // Call the delagates HTButtonEventArgs ev = new HTButtonEventArgs(); ev.State = this.State; this.OnButtonChangeState(ev); // Disable the timer this.tmrRepeat.Enabled = false; }
/// <summary> /// Timer event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Timer_Tick(object sender, EventArgs e) { this.tmrRepeat.Enabled = false; // Update the interval if (tmrRepeat.Interval == this.startRepeatInterval) { this.tmrRepeat.Interval = this.repeatInterval; } // Call the delagate HTButtonEventArgs ev = new HTButtonEventArgs(); ev.State = this.State; this.OnButtonRepeatState(ev); this.tmrRepeat.Enabled = true; }
/// <summary> /// Mouse down event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void OnMouseDown(object sender, MouseEventArgs e) { // Change the state this.State = ButtonState.Pressed; this.Invalidate(); // Call the delagates HTButtonEventArgs ev = new HTButtonEventArgs(); ev.State = this.State; this.OnButtonChangeState(ev); // Enable the repeat timer if (this.RepeatState != false) { this.tmrRepeat.Interval = this.StartRepeatInterval; this.tmrRepeat.Enabled = true; } }