easycoder 250107.1__tar.gz → 250107.4__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-250107.1 → easycoder-250107.4}/PKG-INFO +1 -1
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/__init__.py +1 -1
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_graphics.py +45 -6
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_renderer.py +29 -11
- {easycoder-250107.1 → easycoder-250107.4}/scripts/graphics-demo.ecg +11 -0
- {easycoder-250107.1 → easycoder-250107.4}/LICENSE +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/README.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/README.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/README.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/boolean.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/empty.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/ends.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/even.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/exists.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/greater.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/includes.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/is.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/less.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/list.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/none.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/not.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/numeric.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/object.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/odd.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/starts.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/conditions/string.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/add.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/append.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/assert.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/begin.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/clear.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/close.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/create.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/debug.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/delete.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/divide.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/exit.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/file.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/fork.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/get.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/go.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/if.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/import.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/increment.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/index.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/init.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/input.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/load.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/lock.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/module.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/multiply.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/negate.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/open.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/pop.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/post.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/print.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/push.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/put.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/read.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/release.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/replace.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/return.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/run.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/save.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/script.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/set.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/split.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/stack.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/stop.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/system.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/take.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/unlock.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/variable.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/wait.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/while.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/keywords/write.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/arg.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/args.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/cos.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/datime.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/decode.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/element.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/elements.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/empty.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/encode.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/error.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/files.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/float.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/from.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/hash.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/index.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/integer.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/json.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/keys.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/left.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/length.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/lowercase.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/memory.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/modification.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/modulo.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/newline.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/now.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/position.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/property.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/random.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/right.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/sin.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/stringify.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/tab.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/tan.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/timestamp.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/today.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/trim.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/type.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/uppercase.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/value.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/core/values/weekday.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/README.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/attach.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/close.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/create.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/ellipse.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/image.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/move.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/on.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/rectangle.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/render.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/run.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/set.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/keywords/text.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/values/attribute.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/doc/graphics/values/window.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/README.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_classes.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_compiler.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_condition.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_core.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_handler.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_program.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_screenspec.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/easycoder/ec_value.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/json/graphics-demo.json +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/plugins/ec_p100.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/plugins/example.py +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/pyproject.toml +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/scripts/README.md +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/scripts/benchmark.ecs +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/scripts/hello.ecs +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/scripts/points.ecs +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/scripts/tests.ecs +0 -0
- {easycoder-250107.1 → easycoder-250107.4}/scripts/wave.ecg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version: 250107.
|
|
3
|
+
Version: 250107.4
|
|
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>
|
|
@@ -32,12 +32,12 @@ class Graphics(Handler):
|
|
|
32
32
|
targetRecord = self.getVariable(command['name'])
|
|
33
33
|
keyword = targetRecord['keyword']
|
|
34
34
|
id = self.getRuntimeValue(command['id'])
|
|
35
|
-
|
|
36
|
-
if
|
|
35
|
+
uiElement = self.ui.getElement(id)
|
|
36
|
+
if uiElement == None:
|
|
37
37
|
FatalError(self.program.compiler, f'There is no screen element with id \'{id}\'')
|
|
38
38
|
return -1
|
|
39
|
-
if
|
|
40
|
-
etype =
|
|
39
|
+
if uiElement.getType() != keyword:
|
|
40
|
+
etype = uiElement['type']
|
|
41
41
|
FatalError(self.program.compiler, f'Mismatched element type: "{etype}" and "{keyword}"')
|
|
42
42
|
self.putSymbolValue(targetRecord, {'type': 'text', 'content': id})
|
|
43
43
|
return self.nextPC()
|
|
@@ -228,6 +228,21 @@ class Graphics(Handler):
|
|
|
228
228
|
self.ui = self.renderer.getUI()
|
|
229
229
|
return self.nextPC()
|
|
230
230
|
|
|
231
|
+
# Hide an element
|
|
232
|
+
def k_hide(self, command):
|
|
233
|
+
if self.nextIsSymbol():
|
|
234
|
+
record = self.getSymbolRecord()
|
|
235
|
+
type = record['keyword']
|
|
236
|
+
if self.isGraphicType(type):
|
|
237
|
+
command['target'] = record['id']
|
|
238
|
+
self.add(command)
|
|
239
|
+
return True
|
|
240
|
+
return False
|
|
241
|
+
|
|
242
|
+
def r_hide(self, command):
|
|
243
|
+
self.ui.setVisible(self.getRuntimeValue(command['target']), False)
|
|
244
|
+
return self.nextPC()
|
|
245
|
+
|
|
231
246
|
def k_image(self, command):
|
|
232
247
|
return self.compileVariable(command)
|
|
233
248
|
|
|
@@ -265,6 +280,7 @@ class Graphics(Handler):
|
|
|
265
280
|
self.ui.moveElementBy(self.getRuntimeValue(command['target']), dist)
|
|
266
281
|
return self.nextPC()
|
|
267
282
|
|
|
283
|
+
# on click/tap {element} {action}
|
|
268
284
|
def k_on(self, command):
|
|
269
285
|
token = self.nextToken()
|
|
270
286
|
if token in ['click', 'tap']:
|
|
@@ -298,14 +314,22 @@ class Graphics(Handler):
|
|
|
298
314
|
return True
|
|
299
315
|
return False
|
|
300
316
|
|
|
317
|
+
# Set a handler on every element
|
|
301
318
|
def r_on(self, command):
|
|
302
319
|
pc = command['goto']
|
|
303
320
|
if command['type'] == 'tap':
|
|
304
321
|
record = self.getVariable(command['target'])
|
|
322
|
+
def oncb(data):
|
|
323
|
+
record['index'] = data.index
|
|
324
|
+
self.run(data.pc)
|
|
305
325
|
keyword = record['keyword']
|
|
306
326
|
if self.isGraphicType(keyword):
|
|
307
|
-
|
|
308
|
-
|
|
327
|
+
for index in range(0, record['elements']):
|
|
328
|
+
id = record['value'][index]['content']
|
|
329
|
+
data = Object()
|
|
330
|
+
data.pc = pc
|
|
331
|
+
data.index = index
|
|
332
|
+
self.ui.setOnClick(id, data, oncb)
|
|
309
333
|
else:
|
|
310
334
|
name = record['name']
|
|
311
335
|
RuntimeError(self.program, f'{name} is not a clickable object')
|
|
@@ -384,6 +408,21 @@ class Graphics(Handler):
|
|
|
384
408
|
self.ui.setAttribute(id, attribute, value)
|
|
385
409
|
return self.nextPC()
|
|
386
410
|
|
|
411
|
+
# Show an element (restore it to its current position)
|
|
412
|
+
def k_show(self, command):
|
|
413
|
+
if self.nextIsSymbol():
|
|
414
|
+
record = self.getSymbolRecord()
|
|
415
|
+
type = record['keyword']
|
|
416
|
+
if self.isGraphicType(type):
|
|
417
|
+
command['target'] = record['id']
|
|
418
|
+
self.add(command)
|
|
419
|
+
return True
|
|
420
|
+
return False
|
|
421
|
+
|
|
422
|
+
def r_show(self, command):
|
|
423
|
+
self.ui.setVisible(self.getRuntimeValue(command['target']), True)
|
|
424
|
+
return self.nextPC()
|
|
425
|
+
|
|
387
426
|
def k_text(self, command):
|
|
388
427
|
return self.compileVariable(command)
|
|
389
428
|
|
|
@@ -35,6 +35,8 @@ class Element():
|
|
|
35
35
|
def __init__(self, type, spec):
|
|
36
36
|
self.type = type
|
|
37
37
|
self.spec = spec
|
|
38
|
+
self.visible= True
|
|
39
|
+
self.actionCB = None
|
|
38
40
|
|
|
39
41
|
def getRelativePosition(self):
|
|
40
42
|
spec = self.spec
|
|
@@ -56,10 +58,11 @@ class Element():
|
|
|
56
58
|
return pos
|
|
57
59
|
|
|
58
60
|
def setPos(self, pos):
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
if self.visible:
|
|
62
|
+
# Update the spec
|
|
63
|
+
self.spec.realpos = pos
|
|
64
|
+
# Update the displayed item
|
|
65
|
+
self.spec.item.pos = pos
|
|
63
66
|
|
|
64
67
|
def getSize(self):
|
|
65
68
|
return self.spec.realsize
|
|
@@ -68,6 +71,13 @@ class Element():
|
|
|
68
71
|
self.spec.realsize = size
|
|
69
72
|
self.spec.item.size = size
|
|
70
73
|
|
|
74
|
+
def setVisible(self, vis):
|
|
75
|
+
self.visible = vis
|
|
76
|
+
if vis:
|
|
77
|
+
self.setPos(self.spec.realpos)
|
|
78
|
+
else:
|
|
79
|
+
self.spec.item.pos = (Window.width, self.getPos()[1])
|
|
80
|
+
|
|
71
81
|
def getChildren(self):
|
|
72
82
|
return self.spec.children
|
|
73
83
|
|
|
@@ -141,16 +151,22 @@ class UI(Widget):
|
|
|
141
151
|
self.moveElementBy(id, Vector(pos) - element.getPos())
|
|
142
152
|
return
|
|
143
153
|
|
|
154
|
+
def setVisible(self, id, vis):
|
|
155
|
+
element = self.getElement(id)
|
|
156
|
+
if element != None:
|
|
157
|
+
element.setVisible(vis)
|
|
158
|
+
for id in element.getChildren():
|
|
159
|
+
self.setVisible(id, vis)
|
|
160
|
+
return
|
|
161
|
+
|
|
144
162
|
def on_touch_down(self, touch):
|
|
145
163
|
tp = touch.pos
|
|
146
164
|
x = tp[0]
|
|
147
165
|
y = tp[1]
|
|
148
166
|
for element in reversed(self.zlist):
|
|
149
|
-
if element.
|
|
167
|
+
if element.actionCB != None:
|
|
150
168
|
spec = element.spec
|
|
151
169
|
pos = spec.realpos
|
|
152
|
-
# if spec.parent != None:
|
|
153
|
-
# pos = Vector(pos) + spec.parent.spec.getPos()
|
|
154
170
|
size = element.getSize()
|
|
155
171
|
if spec.type == 'ellipse':
|
|
156
172
|
a = int(size[0])/2
|
|
@@ -159,15 +175,17 @@ class UI(Widget):
|
|
|
159
175
|
h = ctr[0]
|
|
160
176
|
k = ctr[1]
|
|
161
177
|
if (math.pow((x - h), 2) / math.pow(a, 2)) + (math.pow((y - k), 2) / math.pow(b, 2)) <= 1:
|
|
162
|
-
element.
|
|
178
|
+
element.actionCB(element.data)
|
|
163
179
|
break
|
|
164
180
|
elif spec.type in ['rectangle', 'text', 'image']:
|
|
165
181
|
if tp[0] >= pos[0] and tp[0] < pos[0] + size[0] and tp[1] >= pos[1] and tp[1] < pos[1] + size[1]:
|
|
166
|
-
element.
|
|
182
|
+
element.actionCB(element.data)
|
|
167
183
|
break
|
|
168
184
|
|
|
169
|
-
def setOnClick(self, id, callback):
|
|
170
|
-
self.getElement(id)
|
|
185
|
+
def setOnClick(self, id, data, callback):
|
|
186
|
+
element = self.getElement(id)
|
|
187
|
+
element.data = data
|
|
188
|
+
element.actionCB = callback
|
|
171
189
|
|
|
172
190
|
def getWindowAttribute(self, attribute):
|
|
173
191
|
if attribute == 'left':
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
attach Image to `dawn`
|
|
38
38
|
on click Image print ` Click Image`
|
|
39
39
|
|
|
40
|
+
fork to FlashGreen
|
|
41
|
+
|
|
40
42
|
gosub to InitEllipse
|
|
41
43
|
clear UpDown
|
|
42
44
|
put 0 into N
|
|
@@ -97,3 +99,12 @@ MoveEllipse:
|
|
|
97
99
|
increment Step
|
|
98
100
|
if Step is Steps gosub to InitEllipse
|
|
99
101
|
return
|
|
102
|
+
|
|
103
|
+
FlashGreen:
|
|
104
|
+
while true
|
|
105
|
+
begin
|
|
106
|
+
wait 50 ticks
|
|
107
|
+
hide GreenCircle
|
|
108
|
+
wait 50 ticks
|
|
109
|
+
show GreenCircle
|
|
110
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|