You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.6KB

  1. /* PawfalYesNo Fltk Dialog
  2. * Copyleft (C) 2001 Dan Bethell <dan@pawfal.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #ifndef PAWFALYESNO_H
  19. #define PAWFALYESNO_H
  20. #include <iostream>
  21. #include <cstdlib>
  22. #include <ctime>
  23. #include <cassert>
  24. #include <FL/Fl.H>
  25. #include <FL/Fl_Window.H>
  26. #include <FL/Fl_Button.H>
  27. #include <FL/Fl_Input.H>
  28. #include <FL/Fl_Box.H>
  29. #include <FL/Fl_Pixmap.H>
  30. static char * tv_xpm[] = {
  31. "30 30 4 1",
  32. " c None",
  33. ". c #000000",
  34. "+ c #6E6E6E",
  35. "@ c #FFFFFF",
  36. "..............................",
  37. "..............................",
  38. "..............................",
  39. "..............................",
  40. "..............................",
  41. ".....++++++++++++++++++++.....",
  42. ".....+++++++++@@+++++++++.....",
  43. ".....+++++++++@@+++++++++.....",
  44. ".....+++++++++@@+++++++++.....",
  45. ".....+++++++++@@+++++++++.....",
  46. ".....+++++++++@@+++++++++.....",
  47. ".....+++++++++@@+++++++++.....",
  48. ".....++++++++++++++++++++.....",
  49. ".....+++++++++@@+++++++++.....",
  50. ".....++++++++++++++++++++.....",
  51. "..............................",
  52. "..............................",
  53. "..............................",
  54. "..............................",
  55. "..............................",
  56. " .......... ",
  57. " .......... ",
  58. " .......... ",
  59. " .......... ",
  60. " .......... ",
  61. "..............................",
  62. "..............................",
  63. "..............................",
  64. "..............................",
  65. ".............................."};
  66. class PawfalYesNo : public Fl_Window
  67. {
  68. int handle(int);
  69. void draw();
  70. static void ok_cb(Fl_Button *, void *);
  71. static void cancel_cb(Fl_Button *, void *);
  72. public:
  73. PawfalYesNo(int, int, const char *);
  74. ~PawfalYesNo();
  75. bool go();
  76. bool getResult() { return result; }
  77. private:
  78. Fl_Pixmap *logo;
  79. Fl_Box *lbl;
  80. Fl_Button *yes, *no;
  81. bool keyhit;
  82. bool result;
  83. };
  84. bool Pawfal_YesNo(const char *a,...);
  85. #endif