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.

103 lines
3.8KB

  1. //
  2. // "$Id: Fl_Tile.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
  3. //
  4. // Tile 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; you can redistribute it and/or
  9. // modify it under the terms of the GNU Library General Public
  10. // License as published by the Free Software Foundation; either
  11. // version 2 of the License, or (at your option) any later version.
  12. //
  13. // This library is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. // Library General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Library General Public
  19. // License along with this library; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. // USA.
  22. //
  23. // Please report all bugs and problems on the following page:
  24. //
  25. // http://www.fltk.org/str.php
  26. //
  27. /* \file
  28. Fl_Tile widget . */
  29. #ifndef Fl_Tile_H
  30. #define Fl_Tile_H
  31. #include "Fl_Group.H"
  32. /**
  33. The Fl_Tile class lets you resize the children by dragging
  34. the border between them:
  35. <P ALIGN=CENTER>\image html Fl_Tile.png </P>
  36. \image latex Fl_Tile.png "Fl_Tile" width=4cm
  37. <P>For the tiling to work correctly, the children of an
  38. Fl_Tile must cover the entire area of the widget, but not
  39. overlap. This means that all children must touch each
  40. other at their edges, and no gaps can't be left inside the
  41. Fl_Tile.
  42. <P>Fl_Tile does not normailly draw any graphics of its own.
  43. The "borders" which can be seen in the snapshot above
  44. are actually part of the children. Their boxtypes have been set
  45. to FL_DOWN_BOX creating the impression of
  46. "ridges" where the boxes touch. What you see are
  47. actually two adjacent FL_DOWN_BOX's drawn next to each
  48. other. All neighboring widgets share the same edge - the widget's
  49. thick borders make it appear as though the widgets aren't actually
  50. touching, but they are. If the edges of adjacent widgets do not
  51. touch, then it will be impossible to drag the corresponding
  52. edges.</P>
  53. <P>Fl_Tile allows objects to be resized to zero dimensions.
  54. To prevent this you can use the resizable() to limit where
  55. corners can be dragged to.</P>
  56. <P>Even though objects can be resized to zero sizes, they must
  57. initially have non-zero sizes so the Fl_Tile can figure out
  58. their layout. If desired, call position() after creating the
  59. children but before displaying the window to set the borders where you
  60. want.
  61. <P>Note on resizable(Fl_Widget &w) :
  62. The "resizable" child widget (which should be invisible) limits where the
  63. border can be dragged to. If you don't set it, it will be possible to
  64. drag the borders right to the edge, and thus resize objects on the edge
  65. to zero width or height. The resizable() widget is not
  66. resized by dragging any borders. See also void Fl_Group::resizable(Fl_Widget &w)
  67. */
  68. class FL_EXPORT Fl_Tile : public Fl_Group {
  69. public:
  70. int handle(int);
  71. /**
  72. Creates a new Fl_Tile widget using the given position, size,
  73. and label string. The default boxtype is FL_NO_BOX.
  74. <P>The destructor <I>also deletes all the children</I>. This allows a
  75. whole tree to be deleted at once, without having to keep a pointer to
  76. all the children in the user code. A kludge has been done so the
  77. Fl_Tile and all of it's children can be automatic (local)
  78. variables, but you must declare the Fl_Tile <I>first</I>, so
  79. that it is destroyed last.
  80. */
  81. Fl_Tile(int X,int Y,int W,int H,const char*l=0) : Fl_Group(X,Y,W,H,l) {}
  82. void resize(int, int, int, int);
  83. void position(int, int, int, int);
  84. };
  85. #endif
  86. //
  87. // End of "$Id: Fl_Tile.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
  88. //