#ifndef PROGEDITORWIN_H
#define PROGEDITORWIN_H
#include "program/pageeditor.h"
#include <QListWidget>
#include <QJsonObject>

class ProgPanel;
class ProgItem;
class ProgEditorWin : public QWidget {
    Q_OBJECT
public:
    explicit ProgEditorWin(ProgItem *progItem, QWidget *);
public slots:
    void onSave();
    void onAddPage();
protected:
    void closeEvent(QCloseEvent *event) override;
private:
    bool isProgChanged();
    bool save();
    void UdpSendJson(QJsonObject json);

    QListWidget *listPage;
    PageListItem *mPageItem = nullptr;
    PageEditor *mPageEditor;
    QTabWidget *mTabsAttr;
    QList<QJsonObject> mPageJsons;
    ProgItem *mProgItem;
    int mNewEleX = 0;
    int mNewEleY = 0;
};

#endif // PROGEDITORWIN_H
