easycoder 250824.2__tar.gz → 250826.1__tar.gz
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.
Potentially problematic release.
This version of easycoder might be problematic. Click here for more details.
- {easycoder-250824.2 → easycoder-250826.1}/PKG-INFO +1 -1
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/__init__.py +1 -1
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_classes.py +2 -2
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_compiler.py +3 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_core.py +3 -3
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_handler.py +1 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_program.py +5 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_pyside.py +40 -22
- {easycoder-250824.2 → easycoder-250826.1}/.gitignore +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/LICENSE +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/README.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/backdrop.jpg +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/README.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/README.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/boolean.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/empty.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/ends.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/even.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/exists.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/greater.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/includes.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/is.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/less.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/list.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/none.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/not.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/numeric.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/object.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/odd.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/starts.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/conditions/string.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/add.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/append.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/assert.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/begin.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/clear.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/close.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/create.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/debug.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/delete.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/divide.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/exit.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/file.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/fork.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/get.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/go.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/if.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/import.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/increment.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/index.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/init.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/input.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/load.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/lock.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/log.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/module.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/multiply.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/negate.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/on.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/open.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/pop.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/post.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/print.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/push.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/put.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/read.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/release.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/replace.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/return.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/run.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/save.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/script.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/send.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/set.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/shuffle.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/split.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/stack.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/stop.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/system.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/take.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/unlock.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/use.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/variable.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/wait.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/while.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/keywords/write.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/arg.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/args.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/cos.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/datime.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/decode.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/element.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/elements.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/empty.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/encode.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/error.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/files.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/float.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/from.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/hash.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/index.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/integer.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/json.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/keys.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/left.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/length.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/lowercase.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/memory.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/modification.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/modulo.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/newline.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/now.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/position.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/property.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/random.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/right.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/sin.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/stringify.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/tab.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/tan.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/timestamp.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/today.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/trim.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/type.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/uppercase.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/value.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/core/values/weekday.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/README.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/attach.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/close.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/create.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/ellipse.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/image.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/move.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/on.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/rectangle.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/render.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/run.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/set.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/keywords/text.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/values/attribute.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/doc/graphics/values/window.md +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/close.png +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_border.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_condition.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_keyboard.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/ec_value.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/easycoder/tick.png +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/json/graphics-demo.json +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/plugins/ec_keyboard.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/plugins/ec_p100.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/plugins/ec_pyside6.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/plugins/points.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/plugins/sql.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/pyproject.toml +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/scripts/benchmark.ecs +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/scripts/config.ecg +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/scripts/ec_keyboard.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/scripts/hello.ecs +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/scripts/points.ecs +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/scripts/test.ecs +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/scripts/tests.ecs +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/test.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/testrc.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/testsql.py +0 -0
- {easycoder-250824.2 → easycoder-250826.1}/testui.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250826.1
|
|
4
4
|
Summary: Rapid scripting in English
|
|
5
5
|
Keywords: compiler,scripting,prototyping,programming,coding,python,low code,hypertalk,computer language,learn to code
|
|
6
6
|
Author-email: Graham Trott <gtanyware@gmail.com>
|
|
@@ -5,7 +5,7 @@ class FatalError:
|
|
|
5
5
|
compiler.showWarnings()
|
|
6
6
|
lino = compiler.tokens[compiler.index].lino
|
|
7
7
|
script = compiler.script.lines[lino].strip()
|
|
8
|
-
print(f'Compile error in {compiler.program.name} at line {lino + 1} ({script})
|
|
8
|
+
print(f'Compile error in {compiler.program.name} at line {lino + 1} ({script}):\n-> {message}')
|
|
9
9
|
sys.exit()
|
|
10
10
|
|
|
11
11
|
class NoValueError(FatalError):
|
|
@@ -31,7 +31,7 @@ class RuntimeError:
|
|
|
31
31
|
code = program.code[program.pc]
|
|
32
32
|
lino = code['lino']
|
|
33
33
|
script = program.script.lines[lino].strip()
|
|
34
|
-
print(f'Runtime Error in {program.name} at line {lino + 1} ({script})
|
|
34
|
+
print(f'Runtime Error in {program.name} at line {lino + 1} ({script}):\n-> {message}')
|
|
35
35
|
sys.exit()
|
|
36
36
|
|
|
37
37
|
class NoValueRuntimeError(RuntimeError):
|
|
@@ -119,6 +119,9 @@ class Compiler:
|
|
|
119
119
|
|
|
120
120
|
def getSymbolRecord(self):
|
|
121
121
|
token = self.getToken()
|
|
122
|
+
if not token in self.symbols:
|
|
123
|
+
FatalError(self, f'Undefined symbol name "{token}"')
|
|
124
|
+
return None
|
|
122
125
|
symbol = self.symbols[token]
|
|
123
126
|
if symbol == None: return None
|
|
124
127
|
symbolRecord = self.code[symbol]
|
|
@@ -540,11 +540,11 @@ class Core(Handler):
|
|
|
540
540
|
|
|
541
541
|
def r_gosub(self, command):
|
|
542
542
|
label = command['gosub'] + ':'
|
|
543
|
-
|
|
544
|
-
|
|
543
|
+
if label in self.symbols:
|
|
544
|
+
address = self.symbols[label]
|
|
545
545
|
self.stack.append(self.nextPC())
|
|
546
546
|
return address
|
|
547
|
-
RuntimeError(self.program, f'There is no label "{label
|
|
547
|
+
RuntimeError(self.program, f'There is no label "{label}"')
|
|
548
548
|
return None
|
|
549
549
|
|
|
550
550
|
# if <condition> <action> [else <action>]
|
|
@@ -36,6 +36,7 @@ class Handler:
|
|
|
36
36
|
self.testCondition = self.program.condition.testCondition
|
|
37
37
|
self.symbols = self.program.symbols
|
|
38
38
|
self.stack = self.program.stack
|
|
39
|
+
self.getSymbolContent = self.program.getSymbolContent
|
|
39
40
|
self.getSymbolValue = self.program.getSymbolValue
|
|
40
41
|
self.putSymbolValue = self.program.putSymbolValue
|
|
41
42
|
self.run = self.program.run
|
|
@@ -197,6 +197,11 @@ class Program:
|
|
|
197
197
|
return ''
|
|
198
198
|
return None
|
|
199
199
|
|
|
200
|
+
def getSymbolContent(self, symbolRecord):
|
|
201
|
+
if len(symbolRecord['value']) == 0:
|
|
202
|
+
return None
|
|
203
|
+
return symbolRecord['value'][symbolRecord['index']]
|
|
204
|
+
|
|
200
205
|
def getSymbolValue(self, symbolRecord):
|
|
201
206
|
if len(symbolRecord['value']) == 0:
|
|
202
207
|
return None
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import sys
|
|
1
|
+
import sys
|
|
2
|
+
from functools import partial
|
|
2
3
|
from .ec_handler import Handler
|
|
3
4
|
from .ec_classes import RuntimeError
|
|
4
5
|
from .ec_border import Border
|
|
@@ -63,11 +64,16 @@ class Graphics(Handler):
|
|
|
63
64
|
'lineinput',
|
|
64
65
|
'multiline',
|
|
65
66
|
'listbox',
|
|
66
|
-
'combobox'
|
|
67
|
+
'combobox',
|
|
68
|
+
'widget'
|
|
67
69
|
]
|
|
68
70
|
|
|
69
71
|
def dialogTypes(self):
|
|
70
72
|
return ['confirm', 'lineedit', 'multiline', 'generic']
|
|
73
|
+
|
|
74
|
+
def getWidget(self, record):
|
|
75
|
+
if record['keyword'] in ['pushbutton']: return self.getSymbolContent(record)
|
|
76
|
+
else: return record['widget']
|
|
71
77
|
|
|
72
78
|
class ClickableLineEdit(QLineEdit):
|
|
73
79
|
clicked = Signal()
|
|
@@ -198,13 +204,13 @@ class Graphics(Handler):
|
|
|
198
204
|
layoutRecord = self.getVariable(command['layout'])
|
|
199
205
|
widget = command['widget']
|
|
200
206
|
if widget == 'stretch':
|
|
201
|
-
layoutRecord
|
|
207
|
+
self.getWidget(layoutRecord).addStretch()
|
|
202
208
|
elif widget == 'spacer':
|
|
203
|
-
layoutRecord
|
|
209
|
+
self.getWidget(layoutRecord).addSpacing(self.getRuntimeValue(command['size']))
|
|
204
210
|
else:
|
|
205
211
|
widgetRecord = self.getVariable(widget)
|
|
206
212
|
layoutRecord = self.getVariable(command['layout'])
|
|
207
|
-
widget = widgetRecord
|
|
213
|
+
widget = self.getWidget(widgetRecord)
|
|
208
214
|
layout = layoutRecord['widget']
|
|
209
215
|
stretch = 'stretch' in command
|
|
210
216
|
if widgetRecord['keyword'] == 'layout':
|
|
@@ -264,7 +270,8 @@ class Graphics(Handler):
|
|
|
264
270
|
return False
|
|
265
271
|
|
|
266
272
|
def r_clear(self, command):
|
|
267
|
-
self.getVariable(command['name'])['widget']
|
|
273
|
+
widget = self.getVariable(command['name'])['widget']
|
|
274
|
+
widget.clear()
|
|
268
275
|
return self.nextPC()
|
|
269
276
|
|
|
270
277
|
# close {window}
|
|
@@ -418,11 +425,7 @@ class Graphics(Handler):
|
|
|
418
425
|
self.add(command)
|
|
419
426
|
return True
|
|
420
427
|
|
|
421
|
-
def
|
|
422
|
-
self.add(command)
|
|
423
|
-
return True
|
|
424
|
-
|
|
425
|
-
def k_createComboBox(self, command):
|
|
428
|
+
def k_createWidget(self, command):
|
|
426
429
|
self.add(command)
|
|
427
430
|
return True
|
|
428
431
|
|
|
@@ -489,6 +492,7 @@ class Graphics(Handler):
|
|
|
489
492
|
command['name'] = record['name']
|
|
490
493
|
keyword = record['keyword']
|
|
491
494
|
if keyword == 'window': return self.k_createWindow(command)
|
|
495
|
+
elif keyword in ['listbox', 'combobox', 'widget']: return self.k_createWidget(command)
|
|
492
496
|
elif keyword == 'layout': return self.k_createLayout(command)
|
|
493
497
|
elif keyword == 'group': return self.k_createGroupBox(command)
|
|
494
498
|
elif keyword == 'label': return self.k_createLabel(command)
|
|
@@ -496,8 +500,6 @@ class Graphics(Handler):
|
|
|
496
500
|
elif keyword == 'checkbox': return self.k_createCheckBox(command)
|
|
497
501
|
elif keyword == 'lineinput': return self.k_createLineEdit(command)
|
|
498
502
|
elif keyword == 'multiline': return self.k_createMultiLineEdit(command)
|
|
499
|
-
elif keyword == 'listbox': return self.k_createListWidget(command)
|
|
500
|
-
elif keyword == 'combobox': return self.k_createComboBox(command)
|
|
501
503
|
elif keyword == 'dialog': return self.k_createDialog(command)
|
|
502
504
|
elif keyword == 'messagebox': return self.k_createMessageBox(command)
|
|
503
505
|
return False
|
|
@@ -570,7 +572,7 @@ class Graphics(Handler):
|
|
|
570
572
|
c = pushbutton.contentsMargins()
|
|
571
573
|
w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
|
|
572
574
|
pushbutton.setMaximumWidth(w)
|
|
573
|
-
record
|
|
575
|
+
self.putSymbolValue(record, pushbutton)
|
|
574
576
|
return self.nextPC()
|
|
575
577
|
|
|
576
578
|
def r_createCheckBox(self, command, record):
|
|
@@ -624,6 +626,10 @@ class Graphics(Handler):
|
|
|
624
626
|
record['widget'] = QComboBox()
|
|
625
627
|
return self.nextPC()
|
|
626
628
|
|
|
629
|
+
def r_createWidget(self, command, record):
|
|
630
|
+
record['widget'] = QWidget()
|
|
631
|
+
return self.nextPC()
|
|
632
|
+
|
|
627
633
|
def r_createDialog(self, command, record):
|
|
628
634
|
|
|
629
635
|
class ECDialog(QDialog):
|
|
@@ -706,6 +712,7 @@ class Graphics(Handler):
|
|
|
706
712
|
elif keyword == 'multiline': return self.r_createMultiLineEdit(command, record)
|
|
707
713
|
elif keyword == 'listbox': return self.r_createListWidget(command, record)
|
|
708
714
|
elif keyword == 'combobox': return self.r_createComboBox(command, record)
|
|
715
|
+
elif keyword == 'widget': return self.r_createWidget(command, record)
|
|
709
716
|
elif keyword == 'dialog': return self.r_createDialog(command, record)
|
|
710
717
|
elif keyword == 'messagebox': return self.r_createMessageBox(command, record)
|
|
711
718
|
return None
|
|
@@ -877,14 +884,22 @@ class Graphics(Handler):
|
|
|
877
884
|
return False
|
|
878
885
|
|
|
879
886
|
def r_on(self, command):
|
|
887
|
+
def run(widget, record):
|
|
888
|
+
for i, w in enumerate(record['value']):
|
|
889
|
+
if w == widget:
|
|
890
|
+
record['index'] = i
|
|
891
|
+
self.run(command['goto'])
|
|
892
|
+
return
|
|
893
|
+
|
|
880
894
|
if command['type'] == 'tick':
|
|
881
895
|
self.runOnTick = command['runOnTick']
|
|
882
896
|
else:
|
|
883
897
|
record = self.getVariable(command['name'])
|
|
884
|
-
widget = record
|
|
898
|
+
widget = self.getWidget(record)
|
|
885
899
|
keyword = record['keyword']
|
|
886
900
|
if keyword == 'pushbutton':
|
|
887
|
-
|
|
901
|
+
handler = partial(run, widget, record)
|
|
902
|
+
widget.clicked.connect(handler)
|
|
888
903
|
elif keyword == 'combobox':
|
|
889
904
|
widget.currentIndexChanged.connect(lambda: self.run(command['goto']))
|
|
890
905
|
elif keyword == 'listbox':
|
|
@@ -1126,7 +1141,6 @@ class Graphics(Handler):
|
|
|
1126
1141
|
layout = self.getVariable(command['name'])['widget']
|
|
1127
1142
|
layout.setSpacing(self.getRuntimeValue(command['value']))
|
|
1128
1143
|
elif what == 'text':
|
|
1129
|
-
record = self.getVariable(command['name'])
|
|
1130
1144
|
widget = self.getVariable(command['name'])['widget']
|
|
1131
1145
|
text = self.getRuntimeValue(command['value'])
|
|
1132
1146
|
keyword = record['keyword']
|
|
@@ -1156,19 +1170,23 @@ class Graphics(Handler):
|
|
|
1156
1170
|
elif flag == 'center': alignment |= Qt.AlignCenter
|
|
1157
1171
|
widget.setAlignment(alignment)
|
|
1158
1172
|
elif what == 'style':
|
|
1159
|
-
|
|
1173
|
+
record = self.getVariable(command['name'])
|
|
1174
|
+
widget = self.getWidget(record)
|
|
1160
1175
|
styles = self.getRuntimeValue(command['value'])
|
|
1161
1176
|
widget.setStyleSheet(styles)
|
|
1162
1177
|
elif what == 'color':
|
|
1163
|
-
|
|
1178
|
+
record = self.getVariable(command['name'])
|
|
1179
|
+
widget = self.getWidget(record)
|
|
1164
1180
|
color = self.getRuntimeValue(command['value'])
|
|
1165
1181
|
widget.setStyleSheet(f"color: {color};")
|
|
1166
1182
|
elif what == 'background-color':
|
|
1167
|
-
|
|
1183
|
+
record = self.getVariable(command['name'])
|
|
1184
|
+
widget = self.getWidget(record)
|
|
1168
1185
|
bg_color = self.getRuntimeValue(command['value'])
|
|
1169
1186
|
widget.setStyleSheet(f"background-color: {bg_color};")
|
|
1170
1187
|
elif what == 'listbox':
|
|
1171
|
-
|
|
1188
|
+
record = self.getVariable(command['name'])
|
|
1189
|
+
widget = self.getWidget(record)
|
|
1172
1190
|
value = self.getRuntimeValue(command['value'])
|
|
1173
1191
|
widget.clear()
|
|
1174
1192
|
widget.addItems(value)
|
|
@@ -1343,7 +1361,7 @@ class Graphics(Handler):
|
|
|
1343
1361
|
symbolRecord = self.getVariable(symbolRecord['name'])
|
|
1344
1362
|
keyword = symbolRecord['keyword']
|
|
1345
1363
|
if keyword == 'pushbutton':
|
|
1346
|
-
pushbutton = symbolRecord['widget']
|
|
1364
|
+
pushbutton = self.getSymbolContent() # symbolRecord['widget']
|
|
1347
1365
|
v = {}
|
|
1348
1366
|
v['type'] = 'text'
|
|
1349
1367
|
v['content'] = pushbutton.accessibleName()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|