Fl_Pack.H 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // "$Id: Fl_Pack.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
  3. //
  4. // Pack header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2010 by Bill Spitzak and others.
  7. //
  8. // This library is free software. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. /* \file
  19. Fl_Pack widget . */
  20. #ifndef Fl_Pack_H
  21. #define Fl_Pack_H
  22. #include <FL/Fl_Group.H>
  23. /**
  24. This widget was designed to add the functionality of compressing and
  25. aligning widgets.
  26. <P>If type() is Fl_Pack::HORIZONTAL all the children are
  27. resized to the height of the Fl_Pack, and are moved next to
  28. each other horizontally. If type() is not Fl_Pack::HORIZONTAL
  29. then the children are resized to the width and are stacked below each
  30. other. Then the Fl_Pack resizes itself to surround the child
  31. widgets.
  32. <P>This widget is needed for the Fl_Tabs.
  33. In addition you may want to put the Fl_Pack inside an
  34. Fl_Scroll.
  35. <P>The resizable for Fl_Pack is set to NULL by default.</p>
  36. <P>See also: Fl_Group::resizable()
  37. */
  38. class FL_EXPORT Fl_Pack : public Fl_Group {
  39. int spacing_, with_label_;
  40. public:
  41. enum { // values for type(int)
  42. VERTICAL = 0,
  43. HORIZONTAL = 1
  44. };
  45. protected:
  46. void draw();
  47. public:
  48. Fl_Pack(int x,int y,int w ,int h,const char *l = 0);
  49. /**
  50. Gets the number of extra pixels of blank space that are added
  51. between the children.
  52. */
  53. int spacing() const {return spacing_;}
  54. /**
  55. Sets the number of extra pixels of blank space that are added
  56. between the children.
  57. */
  58. void spacing(int i) {spacing_ = i;}
  59. /** Same as Fl_Group::type() */
  60. uchar horizontal() const {return type();}
  61. int with_label() { return with_label_;};
  62. void with_label(int abool) {with_label_ = abool;};
  63. DECLARE_CLASS_CHEAP_RTTI_2(Fl_Pack, Fl_Group)
  64. };
  65. #endif
  66. //
  67. // End of "$Id: Fl_Pack.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
  68. //