/**********************************************************************
 *     EPSCAN, an EPSON ES-1200 scanner driver     
 *     Adam P. Jenkins <ajenkins@cs.umass.edu>
 *     
 *     This program is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License
 *     as published by the Free Software Foundation; either version 2
 *     of the License, or (at your option) any later version.
 *     
 *     This program 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 General Public License for more details.
 *     
 *     You should have received a copy of the GNU General Public License
 *     along with this program; if not, write to the Free Software
 *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 **********************************************************************/

// -*-c++-*-
// Author: Adam P. Jenkins

// QLabeledBoxLayout is derived from QBoxLayout.  It just adds a
// single new method, addLabeledWidget, to QBoxLayout, which can add a
// label to a widget.

#ifndef QLABELEDLAYOUT_H
#define QLABELEDLAYOUT_H

#include <qlayout.h>

class QLabeledBoxLayout : public QBoxLayout
{
public:
  QLabeledBoxLayout(QWidget* parent, Direction d, int border=0,
		    int autoBorder = -1, const char* name=0)
    : QBoxLayout(parent, d, border, autoBorder, name) {}
  QLabeledBoxLayout(Direction d, int autoBorder = -1, const char* name=0)
    : QBoxLayout(d, autoBorder, name) {}

  // adds a widget to layout, the same as in QBoxLayout, except that
  // it also labels the widget.  labSide controls the placement
  // of the label in relation to the widget. I.e. AlignTop will put
  // the label on top. AlignCenter will put the label above the widget
  // if direction is TopToBottom, below the widget if Direction is
  // BottomToTop, to the left if LeftToRight, and to the right if
  // RightToLeft.  If label is null, the value of w->name() is used as
  // the label
  void addLabeledWidget(QWidget* w, int stretch = 0,
			int alignment = AlignCenter,
			const char *label = 0,
			int labSide = AlignCenter,
			int labAlignment = AlignCenter);

};

#endif
