2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-26 03:53:02 +00:00
|
|
|
* \file LengthCombo.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LENGTHCOMBO_H
|
|
|
|
#define LENGTHCOMBO_H
|
|
|
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
2007-04-26 04:41:58 +00:00
|
|
|
#include "VSpace.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
//namespace lyx {
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-04-28 12:58:49 +00:00
|
|
|
* A combo box for selecting Length::UNIT types.
|
2006-03-05 17:24:44 +00:00
|
|
|
*/
|
|
|
|
class LengthCombo : public QComboBox {
|
|
|
|
Q_OBJECT
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
public:
|
|
|
|
LengthCombo(QWidget * parent);
|
|
|
|
|
|
|
|
/// set the current item from unit
|
2007-04-28 12:58:49 +00:00
|
|
|
virtual void setCurrentItem(lyx::Length::UNIT unit);
|
2006-03-05 17:24:44 +00:00
|
|
|
/// set the current item from int
|
|
|
|
virtual void setCurrentItem(int item);
|
|
|
|
/// get the current item
|
2007-04-28 12:58:49 +00:00
|
|
|
lyx::Length::UNIT currentLengthItem() const;
|
2006-03-05 17:24:44 +00:00
|
|
|
/// enable the widget
|
|
|
|
virtual void setEnabled(bool b);
|
|
|
|
/// use the %-items?
|
|
|
|
virtual void noPercents();
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
protected Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
virtual void has_activated(int index);
|
2006-06-30 14:37:33 +00:00
|
|
|
Q_SIGNALS:
|
2006-03-05 17:24:44 +00:00
|
|
|
/// the current selection has changed
|
2007-04-28 12:58:49 +00:00
|
|
|
void selectionChanged(lyx::Length::UNIT unit);
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
//} // namespace lyx
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#endif // LENGTHCOMBO_H
|