qt/LedOK/program/progeditorwin.h

51 lines
1.1 KiB
C
Raw Normal View History

2022-08-25 18:37:24 +08:00
#ifndef PROGEDITORWIN_H
#define PROGEDITORWIN_H
2023-04-18 14:14:46 +08:00
#include "program/pageeditor.h"
2023-10-23 11:44:22 +08:00
#include <QCheckBox>
2024-02-21 18:08:50 +08:00
#include <QRadioButton>
2023-09-19 11:49:20 +08:00
#include <QDialog>
#include <QSpinBox>
#include <QTextEdit>
2022-08-25 18:37:24 +08:00
#include <QListWidget>
2023-09-19 11:49:20 +08:00
#include "gutil/qjson.h"
2022-08-25 18:37:24 +08:00
2022-10-27 15:07:45 +08:00
class ProgPanel;
class ProgItem;
2023-04-28 16:02:14 +08:00
class ProgEditorWin : public QWidget {
2022-08-25 18:37:24 +08:00
Q_OBJECT
public:
2023-04-28 16:02:14 +08:00
explicit ProgEditorWin(ProgItem *progItem, QWidget *);
2022-08-25 18:37:24 +08:00
public slots:
void onSave();
void onAddPage();
protected:
void closeEvent(QCloseEvent *event) override;
private:
bool isProgChanged();
2023-05-15 16:06:10 +08:00
bool save();
2022-08-25 18:37:24 +08:00
QListWidget *listPage;
2023-09-19 11:49:20 +08:00
PageListItem *mPageItem = 0;
2023-05-09 15:08:39 +08:00
PageEditor *mPageEditor;
2022-08-25 18:37:24 +08:00
QTabWidget *mTabsAttr;
2023-09-19 11:49:20 +08:00
std::vector<JObj> mPageJsons;
2022-10-27 15:07:45 +08:00
ProgItem *mProgItem;
2022-08-25 18:37:24 +08:00
int mNewEleX = 0;
int mNewEleY = 0;
};
2023-09-19 11:49:20 +08:00
class ProgCreateDlg : public QDialog {
Q_OBJECT
public:
2024-02-21 18:08:50 +08:00
ProgCreateDlg(QString name, int width, int height, QString remarks, QString, bool isVer, QWidget *parent = nullptr);
2023-09-19 11:49:20 +08:00
QLineEdit *fdName;
QSpinBox *fdWidth;
QSpinBox *fdHeight;
QTextEdit *fdRemark;
2023-10-23 11:44:22 +08:00
QCheckBox *fdIsUltraLong;
2024-02-21 18:08:50 +08:00
QRadioButton *fdHor, *fdVer;
2023-09-19 11:49:20 +08:00
QLineEdit *fdSplitWidths;
};
2022-08-25 18:37:24 +08:00
#endif // PROGEDITORWIN_H