easycoder 250105.1__tar.gz → 250106.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-250105.1 → easycoder-250106.1}/PKG-INFO +2 -2
- {easycoder-250105.1 → easycoder-250106.1}/README.md +1 -1
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/import.md +3 -3
- {easycoder-250105.1 → easycoder-250106.1}/doc/graphics/README.md +2 -1
- easycoder-250106.1/doc/graphics/keywords/attach.md +18 -0
- easycoder-250106.1/doc/graphics/keywords/close.md +15 -0
- easycoder-250106.1/doc/graphics/keywords/create.md +15 -0
- easycoder-250106.1/doc/graphics/keywords/ellipse.md +15 -0
- easycoder-250106.1/doc/graphics/keywords/image.md +15 -0
- easycoder-250106.1/doc/graphics/keywords/move.md +17 -0
- easycoder-250106.1/doc/graphics/keywords/on.md +16 -0
- easycoder-250106.1/doc/graphics/keywords/rectangle.md +15 -0
- easycoder-250106.1/doc/graphics/keywords/render.md +18 -0
- easycoder-250106.1/doc/graphics/keywords/run.md +18 -0
- easycoder-250106.1/doc/graphics/keywords/set.md +15 -0
- easycoder-250106.1/doc/graphics/keywords/text.md +15 -0
- easycoder-250106.1/doc/graphics/values/attribute.md +15 -0
- easycoder-250106.1/doc/graphics/values/window.md +15 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/__init__.py +1 -1
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_compiler.py +1 -1
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_core.py +0 -1
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_graphics.py +11 -8
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_screenspec.py +4 -7
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_value.py +2 -2
- {easycoder-250105.1 → easycoder-250106.1}/scripts/wave.ecg +1 -1
- {easycoder-250105.1 → easycoder-250106.1}/LICENSE +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/README.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/README.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/boolean.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/empty.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/ends.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/even.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/exists.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/greater.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/includes.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/is.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/less.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/list.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/none.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/not.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/numeric.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/object.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/odd.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/starts.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/conditions/string.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/add.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/append.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/assert.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/begin.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/clear.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/close.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/create.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/debug.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/delete.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/divide.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/exit.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/file.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/fork.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/get.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/go.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/if.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/increment.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/index.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/init.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/input.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/load.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/lock.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/module.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/multiply.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/negate.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/open.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/pop.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/post.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/print.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/push.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/put.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/read.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/release.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/replace.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/return.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/run.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/save.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/script.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/set.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/split.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/stack.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/stop.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/system.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/take.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/unlock.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/variable.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/wait.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/while.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/keywords/write.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/arg.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/args.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/cos.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/datime.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/decode.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/element.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/elements.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/empty.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/encode.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/error.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/files.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/float.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/from.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/hash.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/index.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/integer.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/json.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/keys.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/left.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/length.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/lowercase.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/memory.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/modification.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/modulo.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/newline.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/now.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/position.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/property.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/random.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/right.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/sin.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/stringify.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/tab.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/tan.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/timestamp.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/today.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/trim.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/type.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/uppercase.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/value.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/doc/core/values/weekday.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/README.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_classes.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_condition.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_handler.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_program.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_renderer.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/json/graphics-demo.json +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/plugins/ec_p100.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/plugins/example.py +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/pyproject.toml +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/scripts/README.md +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/scripts/benchmark.ecs +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/scripts/graphics-demo.ecg +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/scripts/hello.ecs +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/scripts/points.ecs +0 -0
- {easycoder-250105.1 → easycoder-250106.1}/scripts/tests.ecs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250106.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>
|
|
@@ -77,7 +77,7 @@ A couple of demo graphical scripts are included in the `scripts` directory:
|
|
|
77
77
|
|
|
78
78
|
- English-like syntax based on vocabulary rather than structure. Scripts can be read as English
|
|
79
79
|
- Comprehensive feature set
|
|
80
|
-
- Runs directly from source scripts
|
|
80
|
+
- Runs directly from source scripts. A fast compiler creates efficient intermediate code that runs immediately after compilation
|
|
81
81
|
- Low memory requirements
|
|
82
82
|
- Minimim dependency on other 3rd-party packages
|
|
83
83
|
- Built-in co-operative multitasking
|
|
@@ -66,7 +66,7 @@ A couple of demo graphical scripts are included in the `scripts` directory:
|
|
|
66
66
|
|
|
67
67
|
- English-like syntax based on vocabulary rather than structure. Scripts can be read as English
|
|
68
68
|
- Comprehensive feature set
|
|
69
|
-
- Runs directly from source scripts
|
|
69
|
+
- Runs directly from source scripts. A fast compiler creates efficient intermediate code that runs immediately after compilation
|
|
70
70
|
- Low memory requirements
|
|
71
71
|
- Minimim dependency on other 3rd-party packages
|
|
72
72
|
- Built-in co-operative multitasking
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Syntax:
|
|
4
4
|
`import {type} {variable} [and {type} {variable} ...]]`
|
|
5
|
-
`import {classname} from {path}`
|
|
5
|
+
`import plugin {classname} from {path}`
|
|
6
6
|
|
|
7
7
|
## Examples:
|
|
8
8
|
`import variable Name and variable Surname`
|
|
9
|
-
`import Points from plugins/example.py`
|
|
9
|
+
`import plugin Points from plugins/example.py`
|
|
10
10
|
|
|
11
11
|
## Description:
|
|
12
12
|
First form:
|
|
13
|
-
This specifies which variable should be provided by a calling script
|
|
13
|
+
This specifies which variable should be provided by a calling script.
|
|
14
14
|
|
|
15
15
|
Second form:
|
|
16
16
|
As with [script](script.md), `import` is a compiler directive that should be placed at the top of the script, under the [script](script.md) directive. It's used to call in a plugin language extension where needed. The example above is provided in the repository, to be used as a starting point for your own extra functionality.
|
|
@@ -10,10 +10,11 @@ There are three primary components to the language:
|
|
|
10
10
|
|
|
11
11
|
The core keywords are:
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
[attach](attach.md) [close](close.md) [create](create.md) [ellipse](ellipse.md) [image](image.md) [move](move.md) [on](on.md) [rectangle](rectangle.md) [render](render.md) [run](run.md) [set](set.md) [text](text.md)
|
|
14
14
|
|
|
15
15
|
The core values are:
|
|
16
16
|
|
|
17
|
+
[attribute](attribute.md) [window](window.md)
|
|
17
18
|
|
|
18
19
|
The core conditions are:
|
|
19
20
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## attach
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`attach {id} to {graphic element}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``attach `big-circle` to Ellipse1` ``
|
|
8
|
+
``attach `container` to Container` ``
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Attaches an **_EasyCoder_** graphic variable ([ellipse](ellipse.md), [rectangle](rectangle.md), [text](text.md), [image](image.md) etc.) to the rendered graphic item with the given id.
|
|
12
|
+
|
|
13
|
+
When a graphic specification is rendered, every item in the structure is added to 1) a list of items in the order they were rendered (the z-order) and 2) a dictionary of items indexed by their ids.
|
|
14
|
+
|
|
15
|
+
Next: [close](close.md)
|
|
16
|
+
Prev: [text](text.md)
|
|
17
|
+
|
|
18
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## close
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`close window`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`close window`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Close the window. This will also terminate the **_EasyCoder_** script.
|
|
11
|
+
|
|
12
|
+
Next: [create](create.md)
|
|
13
|
+
Prev: [attach](attach.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## create
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`create window {parameters}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``create window title `Demo` at 300 300 size 640 480 fill color 255 255 200` ``
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Creates a window with the given parameters. There can only be one of these in a program.
|
|
11
|
+
|
|
12
|
+
Next: [ellipse](ellipse.md)
|
|
13
|
+
Prev: [close](close.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## ellipse
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`ellipse {name}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`ellipse Circle`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Declares an ellipse variable. This will be attached to a rendered ellipse and used to pass commands to it. See also [image](image.md), [rectangle](rectangle.md) and [text](text.md).
|
|
11
|
+
|
|
12
|
+
Next: [image](image.md)
|
|
13
|
+
Prev: [create](create.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## image
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`image {name}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`image House`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Declares an image variable. This will be attached to a rendered image and used to pass commands to it. See also [ellipse](ellipse.md), [rectangle](rectangle.md) and [text](text.md).
|
|
11
|
+
|
|
12
|
+
Next: [move](move.md)
|
|
13
|
+
Prev: [ellipse](ellipse.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## move
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`move {name} by {dx} {dy}`
|
|
5
|
+
`move {name} to {x} {y}`
|
|
6
|
+
|
|
7
|
+
## Examples:
|
|
8
|
+
`move Blob by 5 10`
|
|
9
|
+
`move Button to X Y`
|
|
10
|
+
|
|
11
|
+
## Description:
|
|
12
|
+
Moves a graphic element in its parent container, either by a relative amount or to a specified location.
|
|
13
|
+
|
|
14
|
+
Next: [on](on.md)
|
|
15
|
+
Prev: [image](image.md)
|
|
16
|
+
|
|
17
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## on
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`on click/tap {element} {action}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`on click Button stop`
|
|
8
|
+
`on tap Plus increment Count`
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Handle a graphic event. When the user clicks/taps the specified element, perform the requested action, which can be a single command or a `begin...end` block.
|
|
12
|
+
|
|
13
|
+
Next: [rectangle](rectangle.md)
|
|
14
|
+
Prev: [move](move.md)
|
|
15
|
+
|
|
16
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## rectangle
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`rectangle {name}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`rectangle BigBox`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Declares a rectangle variable. This will be attached to a rendered rectangle and used to pass commands to it. See also [ellipse](ellipse.md), [image](image.md) and [text](text.md).
|
|
11
|
+
|
|
12
|
+
Next: [render](render.md)
|
|
13
|
+
Prev: [on](on.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## render
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`render {specification} [in {parent}]`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`render Spec`
|
|
8
|
+
`render Spec in BigBox`
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Render a graphic specification, optionally giving the parent container.
|
|
12
|
+
|
|
13
|
+
Specifications are JSON structures that describe the layout and the element(s) comprising the graphic. See [specification](../specification.md).
|
|
14
|
+
|
|
15
|
+
Next: [run](run.md)
|
|
16
|
+
Prev: [rectangle](rectangle.md)
|
|
17
|
+
|
|
18
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## run
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`render {specification} [in {parent}]`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`render Spec`
|
|
8
|
+
`render Spec in BigBox`
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Render a graphic specification, optionally giving the parent container.
|
|
12
|
+
|
|
13
|
+
Specifications are JSON structures that describe the layout and the element(s) comprising the graphic. See [specification](../specification.md).
|
|
14
|
+
|
|
15
|
+
Next: [run](run.md)
|
|
16
|
+
Prev: [rectangle](rectangle.md)
|
|
17
|
+
|
|
18
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## set
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`set attribute {name} of {element} to {value}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``set attribute `left` of Button to Left`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Set an attribute of a graphic element. Valid attributes depend on the element but include such as `left`, `bottom`, `width` and `height`.
|
|
11
|
+
|
|
12
|
+
Next: [text](text.md)
|
|
13
|
+
Prev: [run](run.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## text
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`text {name}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`text BigBox`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Declares a text variable. This will be attached to a rendered text object and used to pass commands to it. See also [ellipse](ellipse.md), [image](image.md) and [rectangle](rectangle.md).
|
|
11
|
+
|
|
12
|
+
Next: [attach](attach.md)
|
|
13
|
+
Prev: [set](set.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# attribute
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`attribute {key} of {element}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``attribute `width` of BigBox` ``
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Gets the named attribute of a graphic element.
|
|
11
|
+
|
|
12
|
+
Next: [window](window.md)
|
|
13
|
+
Prev: [window](window.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# window
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`[the] window left/top/width/height`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`the window height`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Gets the specified attribute of the window.
|
|
11
|
+
|
|
12
|
+
Next: [attribute](attribute.md)
|
|
13
|
+
Prev: [attribute](attribute.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -102,7 +102,7 @@ class Compiler:
|
|
|
102
102
|
|
|
103
103
|
def showWarnings(self):
|
|
104
104
|
for warning in self.warnings:
|
|
105
|
-
print(f'Warning at line {self.getLino() + 1}
|
|
105
|
+
print(f'Warning at line {self.getLino() + 1} of {self.program.name}: {warning}')
|
|
106
106
|
|
|
107
107
|
def getSymbolRecord(self):
|
|
108
108
|
token = self.getToken()
|
|
@@ -36,7 +36,7 @@ class Graphics(Handler):
|
|
|
36
36
|
FatalError(self.program.compiler, f'There is no screen element with id \'{id}\'')
|
|
37
37
|
return -1
|
|
38
38
|
if element.getType() != keyword:
|
|
39
|
-
FatalError(self.program.compiler, f'Mismatched element type
|
|
39
|
+
FatalError(self.program.compiler, f'Mismatched element type: \'{element['type']}\' and \'{keyword}\'')
|
|
40
40
|
self.putSymbolValue(targetRecord, {'type': 'text', 'content': id})
|
|
41
41
|
return self.nextPC()
|
|
42
42
|
|
|
@@ -301,13 +301,22 @@ class Graphics(Handler):
|
|
|
301
301
|
# render {spec}
|
|
302
302
|
def k_render(self, command):
|
|
303
303
|
command['spec'] = self.nextValue()
|
|
304
|
+
command['parent'] = None
|
|
305
|
+
if self.peek() == 'in':
|
|
306
|
+
self.nextToken()
|
|
307
|
+
if self.nextIsSymbol():
|
|
308
|
+
command['parent'] = self.getSymbolRecord()['name']
|
|
304
309
|
self.add(command)
|
|
305
310
|
return True
|
|
306
311
|
|
|
307
312
|
def r_render(self, command):
|
|
313
|
+
spec = self.getRuntimeValue(command['spec'])
|
|
314
|
+
parent = command['parent']
|
|
315
|
+
if parent !=None:
|
|
316
|
+
parent = self.getVariable(command['parent'])
|
|
308
317
|
self.ui = self.renderer.getUI()
|
|
309
318
|
try:
|
|
310
|
-
ScreenSpec().render(
|
|
319
|
+
ScreenSpec().render(spec, parent, self.ui)
|
|
311
320
|
except Exception as e:
|
|
312
321
|
RuntimeError(self.program, e)
|
|
313
322
|
return self.nextPC()
|
|
@@ -316,12 +325,6 @@ class Graphics(Handler):
|
|
|
316
325
|
def k_run(self, command):
|
|
317
326
|
if self.nextIs('graphics'):
|
|
318
327
|
self.add(command)
|
|
319
|
-
cmd = {}
|
|
320
|
-
cmd['domain'] = 'graphics'
|
|
321
|
-
cmd['lino'] = command['lino'] + 1
|
|
322
|
-
cmd['keyword'] = 'getui'
|
|
323
|
-
cmd['debug'] = False
|
|
324
|
-
self.addCommand(cmd)
|
|
325
328
|
return True
|
|
326
329
|
return False
|
|
327
330
|
|
|
@@ -61,17 +61,14 @@ class ScreenSpec():
|
|
|
61
61
|
self.createWidget(spec[widgets], parent)
|
|
62
62
|
|
|
63
63
|
# Render a graphic specification
|
|
64
|
-
def render(self, spec, ui):
|
|
64
|
+
def render(self, spec, parent, ui):
|
|
65
65
|
self.ui = ui
|
|
66
66
|
|
|
67
67
|
# If it'a string, process it
|
|
68
68
|
if isinstance(spec, str):
|
|
69
|
-
self.renderSpec(loads(spec),
|
|
69
|
+
self.renderSpec(loads(spec), parent)
|
|
70
70
|
|
|
71
71
|
# If it's a 'dict', extract the spec and the args
|
|
72
|
-
elif isinstance(spec, dict):
|
|
73
|
-
spec = loads(spec['spec'])
|
|
74
|
-
self.renderSpec(spec, None)
|
|
75
|
-
|
|
76
72
|
else:
|
|
77
|
-
|
|
73
|
+
self.renderSpec(spec, parent)
|
|
74
|
+
|
|
@@ -51,14 +51,14 @@ class Value:
|
|
|
51
51
|
if item != None:
|
|
52
52
|
return item
|
|
53
53
|
self.compiler.rewindTo(mark)
|
|
54
|
-
self.compiler.warning(f'I don\'t understand \'{token}\'')
|
|
54
|
+
# self.compiler.warning(f'I don\'t understand \'{token}\'')
|
|
55
55
|
return None
|
|
56
56
|
|
|
57
57
|
def compileValue(self):
|
|
58
58
|
token = self.getToken()
|
|
59
59
|
item = self.getItem()
|
|
60
60
|
if item == None:
|
|
61
|
-
|
|
61
|
+
self.compiler.warning(f'ec_value.compileValue: Cannot get the value of "{token}"')
|
|
62
62
|
return None
|
|
63
63
|
|
|
64
64
|
value = {}
|
|
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
|