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.

61 lines
1.8KB

  1. /* SpiralPlugin
  2. * Copyleft (C) 2000 David Griffiths <dave@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. #include "SpiralPluginGUI.h"
  19. #include "SpiralPlugin.h"
  20. #include <FL/fl_draw.h>
  21. #include <FL/fl_draw.H>
  22. static const int GUI_COLOUR = 154;
  23. static const int GUIBG_COLOUR = 144;
  24. static const int GUIBG2_COLOUR = 145;
  25. SpiralPluginGUI::SpiralPluginGUI(int w, int h, SpiralPlugin* o, ChannelHandler *ch) :
  26. SpiralGUIType(0,0,w,h,"")
  27. {
  28. Fl::visible_focus(false);
  29. m_GUICH = ch;
  30. box(FL_THIN_UP_BOX);
  31. m_DragBar = new Fl_DragBar(0,0,w,20,o->GetName().c_str());
  32. m_DragBar->type(Fl_DragBar::FLDRAG);
  33. add(m_DragBar);
  34. m_Hide = new Fl_Button(2,2,18,16,"X");
  35. m_Hide->labeltype(FL_ENGRAVED_LABEL);
  36. m_Hide->box(FL_NO_BOX);
  37. m_Hide->callback((Fl_Callback*)cb_Hide);
  38. add(m_Hide);
  39. }
  40. SpiralPluginGUI::~SpiralPluginGUI()
  41. {
  42. // Needed to properly remove the window.
  43. Fl::check();
  44. }
  45. //// Callbacks ////
  46. inline void SpiralPluginGUI::cb_Hide_i(Fl_Button* o, void* v)
  47. { hide(); }
  48. void SpiralPluginGUI::cb_Hide(Fl_Button* o, void* v)
  49. { ((SpiralPluginGUI*)(o->parent()))->cb_Hide_i(o,v); }