2012-01-06 16:09:03 +00:00
|
|
|
#ifndef _PAYSAGES_QT_BASEFORM_H_
|
|
|
|
#define _PAYSAGES_QT_BASEFORM_H_
|
2012-01-05 16:32:41 +00:00
|
|
|
|
|
|
|
#include <QWidget>
|
2012-01-06 16:09:03 +00:00
|
|
|
#include <QPushButton>
|
2012-02-05 11:31:16 +00:00
|
|
|
#include <QComboBox>
|
2012-02-21 13:41:02 +00:00
|
|
|
#include "basepreview.h"
|
2012-01-05 18:39:17 +00:00
|
|
|
#include "baseinput.h"
|
2012-01-05 19:41:10 +00:00
|
|
|
#include "../lib_paysages/shared/types.h"
|
2012-01-23 23:45:33 +00:00
|
|
|
#include "../lib_paysages/noise.h"
|
2012-03-08 15:10:25 +00:00
|
|
|
#include "../lib_paysages/color.h"
|
2012-01-05 16:32:41 +00:00
|
|
|
|
|
|
|
class BaseForm:public QWidget
|
|
|
|
{
|
2012-01-05 18:39:17 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2012-01-05 16:32:41 +00:00
|
|
|
public:
|
2012-02-05 11:31:16 +00:00
|
|
|
BaseForm(QWidget* parent, bool auto_apply=false, bool with_layers=false);
|
2012-01-05 16:32:41 +00:00
|
|
|
|
2012-01-26 22:30:20 +00:00
|
|
|
signals:
|
|
|
|
void configApplied();
|
|
|
|
|
2012-01-05 16:32:41 +00:00
|
|
|
public slots:
|
|
|
|
virtual void revertConfig();
|
2012-01-06 16:09:03 +00:00
|
|
|
virtual void applyConfig();
|
2012-01-05 16:32:41 +00:00
|
|
|
|
2012-01-07 16:53:23 +00:00
|
|
|
protected slots:
|
2012-01-25 22:32:06 +00:00
|
|
|
virtual void configChangeEvent();
|
2012-02-05 11:31:16 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void layerAddClicked();
|
|
|
|
void layerDelClicked();
|
|
|
|
void layerListChanged();
|
2012-01-07 16:53:23 +00:00
|
|
|
|
2012-01-05 16:32:41 +00:00
|
|
|
protected:
|
2012-02-21 13:41:02 +00:00
|
|
|
void addPreview(BasePreview* preview, QString label);
|
2012-01-06 16:09:03 +00:00
|
|
|
QPushButton* addButton(QString label);
|
2012-01-05 18:39:17 +00:00
|
|
|
void addInput(BaseInput* input);
|
2012-01-06 16:09:03 +00:00
|
|
|
void addInputInt(QString label, int* value, int min, int max, int small_step, int large_step);
|
2012-01-05 18:39:17 +00:00
|
|
|
void addInputDouble(QString label, double* value, double min, double max, double small_step, double large_step);
|
2012-02-12 17:26:17 +00:00
|
|
|
void addInputBoolean(QString label, int* value);
|
2012-01-05 19:41:10 +00:00
|
|
|
void addInputColor(QString label, Color* value);
|
2012-01-07 16:53:23 +00:00
|
|
|
void addInputColorGradation(QString label, ColorGradation* value);
|
|
|
|
void addInputNoise(QString label, NoiseGenerator* value);
|
2012-01-05 16:32:41 +00:00
|
|
|
|
2012-02-05 11:31:16 +00:00
|
|
|
int currentLayer();
|
|
|
|
void setLayerCount(int layer_count);
|
|
|
|
|
|
|
|
virtual void layerAddedEvent();
|
|
|
|
virtual void layerDeletedEvent(int layer);
|
|
|
|
virtual void layerSelectedEvent(int layer);
|
|
|
|
|
2012-01-05 16:32:41 +00:00
|
|
|
private:
|
2012-01-27 23:01:21 +00:00
|
|
|
bool auto_apply;
|
2012-02-05 11:31:16 +00:00
|
|
|
bool with_layers;
|
|
|
|
QComboBox* layer_list;
|
|
|
|
QPushButton* layer_new;
|
|
|
|
QPushButton* layer_del;
|
2012-01-05 16:32:41 +00:00
|
|
|
QWidget* previews;
|
|
|
|
QWidget* form;
|
2012-01-06 16:09:03 +00:00
|
|
|
QWidget* buttons;
|
2012-01-10 20:51:27 +00:00
|
|
|
QPushButton* button_apply;
|
|
|
|
QPushButton* button_revert;
|
2012-01-05 16:32:41 +00:00
|
|
|
};
|
|
|
|
|
2012-01-06 16:09:03 +00:00
|
|
|
#endif // _PAYSAGES_QT_BASEFORM_H_
|