1 // 2 // "$Id$" 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 19 /* \file 20 Fl_Pack widget . */ 21 22 #ifndef Fl_Pack_H 23 #define Fl_Pack_H 24 25 #include <FL/Fl_Group.H> 26 27 /** 28 This widget was designed to add the functionality of compressing and 29 aligning widgets. 30 <P>If type() is Fl_Pack::HORIZONTAL all the children are 31 resized to the height of the Fl_Pack, and are moved next to 32 each other horizontally. If type() is not Fl_Pack::HORIZONTAL 33 then the children are resized to the width and are stacked below each 34 other. Then the Fl_Pack resizes itself to surround the child 35 widgets. 36 <P>This widget is needed for the Fl_Tabs. 37 In addition you may want to put the Fl_Pack inside an 38 Fl_Scroll. 39 40 <P>The resizable for Fl_Pack is set to NULL by default.</p> 41 <P>See also: Fl_Group::resizable() 42 */ 43 class FL_EXPORT Fl_Pack : public Fl_Group { 44 int spacing_; 45 46 public: 47 enum { // values for type(int) 48 VERTICAL = 0, 49 HORIZONTAL = 1 50 }; 51 52 protected: 53 void draw(); 54 55 public: 56 Fl_Pack(int x,int y,int w ,int h,const char *l = 0); 57 /** 58 Gets the number of extra pixels of blank space that are added 59 between the children. 60 */ spacing()61 int spacing() const {return spacing_;} 62 /** 63 Sets the number of extra pixels of blank space that are added 64 between the children. 65 */ spacing(int i)66 void spacing(int i) {spacing_ = i;} 67 /** Same as Fl_Group::type() */ horizontal()68 uchar horizontal() const {return type();} 69 }; 70 71 #endif 72 73 // 74 // End of "$Id$". 75 // 76