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.

Fl_Navigation.h 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* Copyright 2022 Pierre Ossman for Cendio AB
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining
  4. * a copy of this software and associated documentation files (the
  5. * "Software"), to deal in the Software without restriction, including
  6. * without limitation the rights to use, copy, modify, merge, publish,
  7. * distribute, sublicense, and/or sell copies of the Software, and to
  8. * permit persons to whom the Software is furnished to do so, subject to
  9. * the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be
  12. * included in all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  18. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  19. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. */
  23. #ifndef __FL_NAVIGATION_H__
  24. #define __FL_NAVIGATION_H__
  25. #include <FL/Fl_Group.H>
  26. class Fl_Scroll;
  27. class Fl_Navigation: private Fl_Group {
  28. public:
  29. Fl_Navigation(int x, int y, int w, int h);
  30. ~Fl_Navigation();
  31. Fl_Widget *value();
  32. int value(Fl_Widget*);
  33. void client_area(int &rx, int &ry, int &rw, int &rh, int lw);
  34. virtual void draw();
  35. // Delegation to underlying widget
  36. void begin();
  37. void end();
  38. private:
  39. void update_labels();
  40. static void label_pressed(Fl_Widget *widget, void *user_data);
  41. private:
  42. Fl_Scroll *scroll;
  43. Fl_Group *labels;
  44. Fl_Group *pages;
  45. };
  46. #endif