-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialog.h
136 lines (95 loc) · 3.13 KB
/
dialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/* gSAFE - LIB
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2024 Péter Deák ([email protected])
License: Apache 2.0
dialog.h
*/
#ifndef GSAFE__DIALOG_HEADER_FILE_X_
#define GSAFE__DIALOG_HEADER_FILE_X_
/** \defgroup dialog dialog */
/* @{ */
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
#include "dm.h"
#include "gui.h"
#include "guiext.h"
class HDialog;
class HProcessIndicator;
/** Base data class to rapid build dialogs for gSAFE structures. */
class HDialogData : public HNamed
{
public:
HDialogData();
HDialogData(QString configName);
~HDialogData();
virtual QString className();
void makeGui(QWidget *base);
HDialogData* add(HNamed *obj);
HDialogData* setConfig(QString configName);
QString attribute(QString name);
QStringList allDefinedAttributes();
HDialogData* setAttribute(QString name,QString value);
HDialogData* setAttribute(QString name,int ivalue);
HDialogData* setAttribute(QString name,double dvalue);
HDialogData* setDisplayFlags(HDispObjectFlags flags);
HDispObjectFlags displayFlags();
static void addConfig(QString name,QString attributes);
static HDialogData* fromJson(QString jsonData);
static HDialogData* fromJsonFile(QString jsonFileName);
virtual bool applyJson(QString jsonData);
virtual bool applyJsonFile(QString jsonFileName);
virtual QString toJson(HJsonFlag flags = HJsonFlag_Default);
static HDialogData* fromJson_inWork(QJsonValue jsonValue);
virtual bool applyJson_inWork(QJsonObject jsonObject);
virtual QJsonValue toJson_inWork(HJsonFlag flags);
static QString readJsonFile_inWork(QString jsonFileName);
HDialog* toHDialog();
HRecord* getHRecord(int objIndex);
HRecordLines* getHRecordLines(int objIndex);
HDataMatrix* getHDataMatrix(int objIndex);
HDialogData* addToolButtonHandler(QString code,QObject *receiver,const char *method);
protected:
void addProgressIndicator(QWidget *base,QVBoxLayout *mlay);
bool makeGui_called;
QList<HNamed *> objs;
HDispObjectFlags dispFlags;
QMap<QString,QString> attributeMap;
QMap<QString,QObject *> toolButtonReceiverMap;
QMap<QString,const char *> toolButtonMethodMap;
static QMap<QString,QString> configs;
};
/** Rapid dialog for gSAFE structures, based on HDialogData. */
class HDialog : public QDialog , public HDialogData
{
Q_OBJECT
public:
HDialog(QWidget *parent);
HDialog(QString configName,QWidget *parent);
~HDialog();
virtual QString className();
static HDialog* fromJson(QWidget *parent,QString jsonData);
static HDialog* fromJsonFile(QWidget *parent,QString jsonFileName);
static HDialog* fromJson_inWork(QWidget *parent,QJsonValue jsonValue);
using HDialogData::setAttribute;
public slots:
virtual int exec();
};
class HProgressIndicator : public QFrame
{
Q_OBJECT
public:
HProgressIndicator(QWidget *parent,int steps);
~HProgressIndicator();
int setCurrent(int c);
int step();
public:
int number_pointsize;
protected:
int all_steps;
int current;
void paintEvent(QPaintEvent *e);
};
/* @} */
#endif