1998-10-20 01:39:29 +04:00
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// "$Id$"
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// Tile header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2009-01-01 19:11:32 +03:00
|
|
|
// Copyright 1998-2009 by Bill Spitzak and others.
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Library General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Library General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
// USA.
|
|
|
|
//
|
2005-04-16 04:13:17 +04:00
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2008-10-15 17:46:06 +04:00
|
|
|
/* \file
|
2008-09-16 11:26:22 +04:00
|
|
|
Fl_Tile widget . */
|
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
#ifndef Fl_Tile_H
|
|
|
|
#define Fl_Tile_H
|
|
|
|
|
|
|
|
#include "Fl_Group.H"
|
|
|
|
|
2008-09-14 19:45:27 +04:00
|
|
|
/**
|
|
|
|
The Fl_Tile class lets you resize the children by dragging
|
|
|
|
the border between them:
|
|
|
|
|
2008-10-15 15:27:29 +04:00
|
|
|
<P ALIGN=CENTER>\image html Fl_Tile.gif </P>
|
|
|
|
\image latex Fl_Tile.eps "Fl_Tile" width=4cm
|
2008-09-14 19:45:27 +04:00
|
|
|
|
|
|
|
<P>For the tiling to work correctly, the children of an
|
|
|
|
Fl_Tile must cover the entire area of the widget, but not
|
|
|
|
overlap. This means that all children must touch each
|
|
|
|
other at their edges, and no gaps can't be left inside the
|
|
|
|
Fl_Tile.
|
|
|
|
|
|
|
|
<P>Fl_Tile does not normailly draw any graphics of its own.
|
2008-09-17 19:44:43 +04:00
|
|
|
The "borders" which can be seen in the snapshot above
|
2008-09-14 19:45:27 +04:00
|
|
|
are actually part of the children. Their boxtypes have been set
|
|
|
|
to FL_DOWN_BOX creating the impression of
|
2008-09-17 19:44:43 +04:00
|
|
|
"ridges" where the boxes touch. What you see are
|
2008-09-14 19:45:27 +04:00
|
|
|
actually two adjacent FL_DOWN_BOX's drawn next to each
|
|
|
|
other. All neighboring widgets share the same edge - the widget's
|
|
|
|
thick borders make it appear as though the widgets aren't actually
|
|
|
|
touching, but they are. If the edges of adjacent widgets do not
|
|
|
|
touch, then it will be impossible to drag the corresponding
|
|
|
|
edges.</P>
|
|
|
|
|
|
|
|
<P>Fl_Tile allows objects to be resized to zero dimensions.
|
|
|
|
To prevent this you can use the resizable() to limit where
|
|
|
|
corners can be dragged to.</P>
|
|
|
|
|
|
|
|
<P>Even though objects can be resized to zero sizes, they must
|
|
|
|
initially have non-zero sizes so the Fl_Tile can figure out
|
|
|
|
their layout. If desired, call position() after creating the
|
|
|
|
children but before displaying the window to set the borders where you
|
|
|
|
want.
|
|
|
|
|
|
|
|
<P>Note on resizable(Fl_Widget &w) :
|
2008-09-17 19:44:43 +04:00
|
|
|
The "resizable" child widget (which should be invisible) limits where the
|
2008-09-14 19:45:27 +04:00
|
|
|
border can be dragged to. If you don't set it, it will be possible to
|
|
|
|
drag the borders right to the edge, and thus resize objects on the edge
|
|
|
|
to zero width or height. The resizable() widget is not
|
|
|
|
resized by dragging any borders. See also void Fl_Group::resizable(Fl_Widget &w)
|
|
|
|
|
|
|
|
*/
|
2002-08-14 20:49:38 +04:00
|
|
|
class FL_EXPORT Fl_Tile : public Fl_Group {
|
1998-10-06 22:21:25 +04:00
|
|
|
public:
|
2002-08-14 20:49:38 +04:00
|
|
|
int handle(int);
|
2008-09-14 19:45:27 +04:00
|
|
|
/**
|
|
|
|
Creates a new Fl_Tile widget using the given position, size,
|
|
|
|
and label string. The default boxtype is FL_NO_BOX.
|
|
|
|
|
|
|
|
<P>The destructor <I>also deletes all the children</I>. This allows a
|
|
|
|
whole tree to be deleted at once, without having to keep a pointer to
|
|
|
|
all the children in the user code. A kludge has been done so the
|
|
|
|
Fl_Tile and all of it's children can be automatic (local)
|
|
|
|
variables, but you must declare the Fl_Tile <I>first</I>, so
|
|
|
|
that it is destroyed last.
|
|
|
|
*/
|
1998-10-06 22:21:25 +04:00
|
|
|
Fl_Tile(int X,int Y,int W,int H,const char*l=0) : Fl_Group(X,Y,W,H,l) {}
|
2002-08-14 20:49:38 +04:00
|
|
|
void resize(int, int, int, int);
|
|
|
|
void position(int, int, int, int);
|
1998-10-06 22:21:25 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-10-20 01:39:29 +04:00
|
|
|
|
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// End of "$Id$".
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|