//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      GUI/View/Device/SpanPropertyForm.h
//! @brief     Defines class SpanPropertyForm.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2022
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_GUI_VIEW_DEVICE_SPANPROPERTYFORM_H
#define BORNAGAIN_GUI_VIEW_DEVICE_SPANPROPERTYFORM_H

#include "GUI/View/Widget/GroupBoxes.h"
#include <QSpinBox>

class DoubleSpinBox;
class SpanProperty;

//! Use this to edit an SpanProperty.
//!
//! An SpanProperty handles values for a EquiDivision. The values will be already written into the
//! data element. For each change of values, a signal will be emitted. Use this e.g. to update
//! dependent values or to set the document to modified.
class SpanPropertyForm : public StaticGroupBox {
    Q_OBJECT
public:
    SpanPropertyForm(QWidget* parent, const QString& groupTitle, SpanProperty* spanProperty,
                     QString nbinsTooltip = "");

signals:
    void dataChanged();

private:
    QSpinBox* m_nbins_spin_box;
    SpanProperty* m_span_property;
    DoubleSpinBox* m_width_spin_box;
    DoubleSpinBox* m_center_spin_box;
};


#endif // BORNAGAIN_GUI_VIEW_DEVICE_SPANPROPERTYFORM_H
