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.

96 lines
2.7KB

  1. /* PawfalInput 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 PAWFALINPUT_H
  19. #define PAWFALINPUT_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 PawfalInput : 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. PawfalInput(int, int, int, int, const char *, const char *);
  74. PawfalInput(int, int, const char *, const char *);
  75. ~PawfalInput();
  76. bool go();
  77. const char *getText(){return input->value();}
  78. private:
  79. Fl_Pixmap *logo;
  80. Fl_Box *lbl;
  81. Fl_Input *input;
  82. Fl_Button *ok, *cancel;
  83. bool keyhit;
  84. };
  85. bool Pawfal_Input(const char *a, const char *b, char *out);
  86. #endif