easycoder 251105.1__py2.py3-none-any.whl → 251215.2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,225 @@
1
+ from .ec_classes import ECObject
2
+
3
+ ###############################################################################
4
+ # A generic graphic element
5
+ class ECGElement(ECObject):
6
+ def __init__(self):
7
+ super().__init__()
8
+
9
+ # By default, classes that inherit from here do not belong to this package
10
+ def isCoreClass(self):
11
+ return False
12
+
13
+ ###############################################################################
14
+ # A generic widget (other packages should inherit from this)
15
+ class ECWidget(ECGElement):
16
+ def __init__(self):
17
+ super().__init__()
18
+
19
+ ###############################################################################
20
+ # A core widget (only classes in this package should inherit from this)
21
+ class ECCoreWidget(ECWidget):
22
+ def __init__(self):
23
+ super().__init__()
24
+
25
+ # This is a core class
26
+ def isCoreClass(self):
27
+ return True
28
+
29
+ ###############################################################################
30
+ # A simple panel widget
31
+ class ECPanel(ECCoreWidget):
32
+ def __init__(self):
33
+ super().__init__()
34
+
35
+ # This type of widget is clearable
36
+ def isClearable(self):
37
+ return True
38
+
39
+ ###############################################################################
40
+ # A widget with a text value
41
+ class ECTextWidget(ECCoreWidget):
42
+ def __init__(self):
43
+ super().__init__()
44
+
45
+ # This type of widget has a runtime value
46
+ def hasRuntimeValue(self):
47
+ return True
48
+
49
+ # Get the text of the widget
50
+ def getText(self):
51
+ return self.getContent() # type: ignore
52
+
53
+ # Check if the object is empty
54
+ def isEmpty(self):
55
+ return self.getText() == ""
56
+
57
+ ###############################################################################
58
+ # A layout variable
59
+ class ECLayout(ECCoreWidget):
60
+ def __init__(self):
61
+ super().__init__()
62
+
63
+ ###############################################################################
64
+ # A group variable
65
+ class ECGroup(ECCoreWidget):
66
+ def __init__(self):
67
+ super().__init__()
68
+
69
+ ###############################################################################
70
+ # A label variable
71
+ class ECLabel(ECTextWidget):
72
+ def __init__(self):
73
+ super().__init__()
74
+
75
+ # This is a core class
76
+ def isCoreClass(self):
77
+ return True
78
+
79
+ ###############################################################################
80
+ # A pushbutton variable
81
+ class ECPushButton(ECTextWidget):
82
+ def __init__(self):
83
+ super().__init__()
84
+
85
+ # This is a core class
86
+ def isCoreClass(self):
87
+ return True
88
+
89
+ ###############################################################################
90
+ # A checkbox variable
91
+ class ECCheckBox(ECCoreWidget):
92
+ def __init__(self):
93
+ super().__init__()
94
+
95
+ # This object has a runtime value
96
+ def hasRuntimeValue(self):
97
+ return True
98
+
99
+ # Get the content of the value at the current index
100
+ def getContent(self):
101
+ v = self.getValue()
102
+ if v is None: return None
103
+ return v.getContent().isChecked()
104
+
105
+ ###############################################################################
106
+ # A line input widget
107
+ class ECLineInput(ECTextWidget):
108
+ def __init__(self):
109
+ super().__init__()
110
+
111
+ # This object has a runtime value
112
+ def hasRuntimeValue(self):
113
+ return True
114
+
115
+ # Get the text of the widget
116
+ def getText(self):
117
+ return self.getValue().getContent().text() # type: ignore
118
+
119
+ # Get the content of the value at the current index
120
+ def getContent(self):
121
+ v = self.getValue()
122
+ if v is None: return None
123
+ return v.getContent().text()
124
+
125
+ ###############################################################################
126
+ # A multiline widget
127
+ class ECMultiline(ECTextWidget):
128
+ def __init__(self):
129
+ super().__init__()
130
+
131
+ ###############################################################################
132
+ # A listbox variable
133
+ class ECListBox(ECCoreWidget):
134
+ def __init__(self):
135
+ super().__init__()
136
+
137
+ # This type of widget has a runtime value
138
+ def hasRuntimeValue(self):
139
+ return True
140
+
141
+ # This type of widget is mutable.
142
+ def isMutable(self):
143
+ return True
144
+
145
+ # This type of widget is clearable
146
+ def isClearable(self):
147
+ return True
148
+
149
+ # Get the count of items in the list box
150
+ def getCount(self):
151
+ v = self.getContent().count() # type: ignore
152
+ return v
153
+
154
+ # Get the selected item in the list box
155
+ def getContent(self):
156
+ widget = self.getValue().getContent() # type: ignore
157
+ content = widget.selectedItems()[0].text() if widget.selectedItems() else None
158
+ return content
159
+
160
+ # Get the text of the widget
161
+ def getText(self):
162
+ return self.getValue().getContent().text() # type: ignore
163
+
164
+
165
+ ###############################################################################
166
+ # A combo box variable
167
+ class ECComboBox(ECCoreWidget):
168
+ def __init__(self):
169
+ super().__init__()
170
+
171
+ # This type of widget has a runtime value
172
+ def hasRuntimeValue(self):
173
+ return True
174
+
175
+ # This type of widget is mutable.
176
+ def isMutable(self):
177
+ return True
178
+
179
+ # This type of widget is clearable
180
+ def isClearable(self):
181
+ return True
182
+
183
+ # Get the count of items in the combo box
184
+ def getCount(self):
185
+ v = self.getContent().count() # type: ignore
186
+ return v
187
+
188
+ # Get the text of the widget
189
+ def getText(self):
190
+ return self.getValue().getContent().text() # type: ignore
191
+
192
+
193
+ ###############################################################################
194
+ # A window variable
195
+ class ECWindow(ECGElement):
196
+ def __init__(self):
197
+ super().__init__()
198
+
199
+ # This is a core class
200
+ def isCoreClass(self):
201
+ return True
202
+
203
+ ###############################################################################
204
+ # A dialog variable
205
+ class ECDialog(ECGElement):
206
+ def __init__(self):
207
+ super().__init__()
208
+
209
+ # This is a core class
210
+ def isCoreClass(self):
211
+ return True
212
+
213
+ # This type of widget has a runtime value
214
+ def hasRuntimeValue(self):
215
+ return True
216
+
217
+ def getReturnValue(self):
218
+ dialog = self.getValue().getContent() # type: ignore
219
+ return dialog.result
220
+
221
+ ###############################################################################
222
+ # A message box variable
223
+ class ECMessageBox(ECGElement):
224
+ def __init__(self):
225
+ super().__init__()