2002-09-24 13:57:09 +00:00
|
|
|
// -*- C++ -*-
|
2001-08-29 02:08:04 +00:00
|
|
|
/**
|
|
|
|
* \file lengthcombo.h
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-08-29 02:08:04 +00:00
|
|
|
*
|
|
|
|
* \author John Levon
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-08-29 02:08:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LENGTHCOMBO_H
|
|
|
|
#define LENGTHCOMBO_H
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
|
|
#include <qcombobox.h>
|
|
|
|
|
|
|
|
#include "vspace.h"
|
2001-08-29 02:08:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A combo box for selecting LyXLength::UNIT types.
|
|
|
|
*/
|
|
|
|
class LengthCombo : public QComboBox {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
LengthCombo(QWidget * parent, char * name);
|
|
|
|
|
2003-12-05 16:22:36 +00:00
|
|
|
/// set the current item from unit
|
2001-08-29 02:08:04 +00:00
|
|
|
virtual void setCurrentItem(LyXLength::UNIT unit);
|
2003-12-05 16:22:36 +00:00
|
|
|
/// set the current item from int
|
|
|
|
virtual void setCurrentItem(int item);
|
2001-08-29 02:08:04 +00:00
|
|
|
/// get the current item
|
|
|
|
LyXLength::UNIT currentLengthItem() const;
|
2002-11-17 11:24:08 +00:00
|
|
|
/// enable the widget
|
|
|
|
virtual void setEnabled(bool b);
|
2003-12-01 07:54:02 +00:00
|
|
|
/// use the %-items?
|
|
|
|
virtual void noPercents();
|
2002-11-17 11:24:08 +00:00
|
|
|
|
2001-08-29 02:08:04 +00:00
|
|
|
protected slots:
|
|
|
|
virtual void has_activated(int index);
|
|
|
|
signals:
|
|
|
|
/// the current selection has changed
|
|
|
|
void selectionChanged(LyXLength::UNIT unit);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2002-08-06 00:54:20 +00:00
|
|
|
#endif // LENGTHCOMBO_H
|