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.

100 lines
2.7KB

  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 "list"
  19. #include <FL/Fl.H>
  20. #include <FL/Fl_Counter.H>
  21. #include <FL/Fl_Scroll.H>
  22. #include <FL/Fl_Button.H>
  23. #include <FL/Fl_Pack.H>
  24. #include "../Widgets/Fl_LED_Button.H"
  25. #include "SeqSelectorPlugin.h"
  26. #include "../SpiralPluginGUI.h"
  27. #ifndef SEQ_SEL_GUI_H
  28. #define SEQ_SEL_GUI_H
  29. class CountLine : public Fl_Group
  30. {
  31. public:
  32. CountLine (int n, Fl_Color col1/*, Fl_Color col2*/);
  33. ~CountLine();
  34. void SetVal(int n, float val);
  35. float GetVal(int n);
  36. void SetLED(bool s) { m_Flasher->value(s); }
  37. virtual int handle(int event);
  38. ChannelHandler *m_GUICH;
  39. private:
  40. Fl_LED_Button *m_Flasher;
  41. Fl_Counter *m_Counter[NUM_VALUES];
  42. int m_Num;
  43. char m_Count[32];
  44. };
  45. class SeqSelectorPluginGUI : public SpiralPluginGUI
  46. {
  47. public:
  48. SeqSelectorPluginGUI(int w, int h, SeqSelectorPlugin *o,ChannelHandler *ch,const HostInfo *Info);
  49. virtual void UpdateValues(SpiralPlugin *o);
  50. virtual void Update();
  51. void AddLine(int* Val=NULL);
  52. void RemoveLine();
  53. float GetVal(int l, int v);
  54. int GetNumLines() { return m_LineVec.size(); }
  55. void SetLED(int n);
  56. void StreamOut(std::ostream &s);
  57. void StreamIn(std::istream &s);
  58. protected:
  59. const std::string GetHelpText(const std::string &loc);
  60. private:
  61. int m_LastLight;
  62. Fl_Color m_Colour/*1, m_Colour2*/;
  63. Fl_Pack *m_Main;
  64. Fl_Scroll *m_Scroll;
  65. Fl_Button *m_New;
  66. Fl_Button *m_Delete;
  67. Fl_Counter *m_Begin;
  68. Fl_Counter *m_End;
  69. Fl_Button *m_UseRange;
  70. std::list<CountLine*> m_LineVec;
  71. //// Callbacks ////
  72. inline void cb_New_i(Fl_Button* o, void* v);
  73. static void cb_New(Fl_Button* o, void* v);
  74. inline void cb_Delete_i(Fl_Button* o, void* v);
  75. static void cb_Delete(Fl_Button* o, void* v);
  76. inline void cb_Begin_i(Fl_Counter* o, void* v);
  77. static void cb_Begin(Fl_Counter* o, void* v);
  78. inline void cb_End_i(Fl_Counter* o, void* v);
  79. static void cb_End(Fl_Counter* o, void* v);
  80. inline void cb_UseRange_i(Fl_Button* o, void* v);
  81. static void cb_UseRange(Fl_Button* o, void* v);
  82. };
  83. #endif