Fl_Repeat_Button.H 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // "$Id: Fl_Repeat_Button.H 9637 2012-07-24 04:37:22Z matt $"
  3. //
  4. // Repeat button header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2010 by Bill Spitzak and others.
  7. //
  8. // This library is free software. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. /* \file
  19. Fl_Repeat_Button widget . */
  20. #ifndef Fl_Repeat_Button_H
  21. #define Fl_Repeat_Button_H
  22. #include "Fl.H"
  23. #include "Fl_Button.H"
  24. /**
  25. The Fl_Repeat_Button is a subclass of Fl_Button that
  26. generates a callback when it is pressed and then repeatedly generates
  27. callbacks as long as it is held down. The speed of the repeat is fixed
  28. and depends on the implementation.
  29. */
  30. class FL_EXPORT Fl_Repeat_Button : public Fl_Button {
  31. static void repeat_callback(void *);
  32. public:
  33. int handle(int);
  34. /**
  35. Creates a new Fl_Repeat_Button widget using the given
  36. position, size, and label string. The default boxtype is FL_UP_BOX.
  37. Deletes the button.
  38. */
  39. Fl_Repeat_Button(int X,int Y,int W,int H,const char *l=0);
  40. void deactivate() {
  41. Fl::remove_timeout(repeat_callback,this);
  42. Fl_Button::deactivate();
  43. }
  44. DECLARE_CLASS_CHEAP_RTTI_2(Fl_Repeat_Button, Fl_Button)
  45. };
  46. #endif
  47. //
  48. // End of "$Id: Fl_Repeat_Button.H 9637 2012-07-24 04:37:22Z matt $".
  49. //