easycoder 250820.1__tar.gz → 250824.2__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.

Files changed (174) hide show
  1. {easycoder-250820.1 → easycoder-250824.2}/PKG-INFO +1 -1
  2. {easycoder-250820.1 → easycoder-250824.2}/easycoder/__init__.py +2 -1
  3. easycoder-250824.2/easycoder/ec_border.py +63 -0
  4. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_keyboard.py +2 -61
  5. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_pyside.py +106 -48
  6. {easycoder-250820.1 → easycoder-250824.2}/.gitignore +0 -0
  7. {easycoder-250820.1 → easycoder-250824.2}/LICENSE +0 -0
  8. {easycoder-250820.1 → easycoder-250824.2}/README.md +0 -0
  9. {easycoder-250820.1 → easycoder-250824.2}/backdrop.jpg +0 -0
  10. {easycoder-250820.1 → easycoder-250824.2}/doc/README.md +0 -0
  11. {easycoder-250820.1 → easycoder-250824.2}/doc/core/README.md +0 -0
  12. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/boolean.md +0 -0
  13. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/empty.md +0 -0
  14. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/ends.md +0 -0
  15. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/even.md +0 -0
  16. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/exists.md +0 -0
  17. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/greater.md +0 -0
  18. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/hasProperty.md +0 -0
  19. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/includes.md +0 -0
  20. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/is.md +0 -0
  21. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/less.md +0 -0
  22. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/list.md +0 -0
  23. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/none.md +0 -0
  24. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/not.md +0 -0
  25. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/numeric.md +0 -0
  26. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/object.md +0 -0
  27. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/odd.md +0 -0
  28. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/starts.md +0 -0
  29. {easycoder-250820.1 → easycoder-250824.2}/doc/core/conditions/string.md +0 -0
  30. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/add.md +0 -0
  31. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/append.md +0 -0
  32. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/assert.md +0 -0
  33. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/begin.md +0 -0
  34. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/clear.md +0 -0
  35. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/close.md +0 -0
  36. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/create.md +0 -0
  37. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/debug.md +0 -0
  38. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/decrement.md +0 -0
  39. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/delete.md +0 -0
  40. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/divide.md +0 -0
  41. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/exit.md +0 -0
  42. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/file.md +0 -0
  43. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/fork.md +0 -0
  44. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/get.md +0 -0
  45. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/go.md +0 -0
  46. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/gosub.md +0 -0
  47. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/if.md +0 -0
  48. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/import.md +0 -0
  49. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/increment.md +0 -0
  50. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/index.md +0 -0
  51. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/init.md +0 -0
  52. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/input.md +0 -0
  53. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/load.md +0 -0
  54. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/lock.md +0 -0
  55. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/log.md +0 -0
  56. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/module.md +0 -0
  57. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/multiply.md +0 -0
  58. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/negate.md +0 -0
  59. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/on.md +0 -0
  60. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/open.md +0 -0
  61. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/pop.md +0 -0
  62. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/post.md +0 -0
  63. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/print.md +0 -0
  64. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/push.md +0 -0
  65. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/put.md +0 -0
  66. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/read.md +0 -0
  67. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/release.md +0 -0
  68. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/replace.md +0 -0
  69. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/return.md +0 -0
  70. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/run.md +0 -0
  71. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/save.md +0 -0
  72. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/script.md +0 -0
  73. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/send.md +0 -0
  74. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/set.md +0 -0
  75. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/shuffle.md +0 -0
  76. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/split.md +0 -0
  77. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/stack.md +0 -0
  78. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/stop.md +0 -0
  79. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/system.md +0 -0
  80. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/take.md +0 -0
  81. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/toggle.md +0 -0
  82. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/truncate.md +0 -0
  83. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/unlock.md +0 -0
  84. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/use.md +0 -0
  85. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/variable.md +0 -0
  86. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/wait.md +0 -0
  87. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/while.md +0 -0
  88. {easycoder-250820.1 → easycoder-250824.2}/doc/core/keywords/write.md +0 -0
  89. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/arg.md +0 -0
  90. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/args.md +0 -0
  91. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/cos.md +0 -0
  92. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/datime.md +0 -0
  93. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/decode.md +0 -0
  94. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/element.md +0 -0
  95. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/elements.md +0 -0
  96. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/empty.md +0 -0
  97. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/encode.md +0 -0
  98. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/error.md +0 -0
  99. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/files.md +0 -0
  100. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/float.md +0 -0
  101. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/from.md +0 -0
  102. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/hash.md +0 -0
  103. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/index.md +0 -0
  104. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/integer.md +0 -0
  105. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/json.md +0 -0
  106. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/keys.md +0 -0
  107. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/left.md +0 -0
  108. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/length.md +0 -0
  109. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/lowercase.md +0 -0
  110. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/memory.md +0 -0
  111. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/modification.md +0 -0
  112. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/modulo.md +0 -0
  113. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/newline.md +0 -0
  114. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/now.md +0 -0
  115. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/position.md +0 -0
  116. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/property.md +0 -0
  117. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/random.md +0 -0
  118. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/right.md +0 -0
  119. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/sin.md +0 -0
  120. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/stringify.md +0 -0
  121. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/tab.md +0 -0
  122. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/tan.md +0 -0
  123. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/timestamp.md +0 -0
  124. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/today.md +0 -0
  125. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/trim.md +0 -0
  126. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/type.md +0 -0
  127. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/uppercase.md +0 -0
  128. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/value.md +0 -0
  129. {easycoder-250820.1 → easycoder-250824.2}/doc/core/values/weekday.md +0 -0
  130. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/README.md +0 -0
  131. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/attach.md +0 -0
  132. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/close.md +0 -0
  133. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/create.md +0 -0
  134. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/ellipse.md +0 -0
  135. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/image.md +0 -0
  136. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/move.md +0 -0
  137. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/on.md +0 -0
  138. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/rectangle.md +0 -0
  139. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/render.md +0 -0
  140. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/run.md +0 -0
  141. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/set.md +0 -0
  142. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/keywords/text.md +0 -0
  143. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/values/attribute.md +0 -0
  144. {easycoder-250820.1 → easycoder-250824.2}/doc/graphics/values/window.md +0 -0
  145. {easycoder-250820.1 → easycoder-250824.2}/easycoder/close.png +0 -0
  146. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_classes.py +0 -0
  147. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_compiler.py +0 -0
  148. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_condition.py +0 -0
  149. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_core.py +0 -0
  150. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_handler.py +0 -0
  151. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_program.py +0 -0
  152. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_timestamp.py +0 -0
  153. {easycoder-250820.1 → easycoder-250824.2}/easycoder/ec_value.py +0 -0
  154. {easycoder-250820.1 → easycoder-250824.2}/easycoder/tick.png +0 -0
  155. {easycoder-250820.1 → easycoder-250824.2}/images/Semoigo Dawn.jpg +0 -0
  156. {easycoder-250820.1 → easycoder-250824.2}/json/graphics-demo.json +0 -0
  157. {easycoder-250820.1 → easycoder-250824.2}/plugins/ec_keyboard.py +0 -0
  158. {easycoder-250820.1 → easycoder-250824.2}/plugins/ec_p100.py +0 -0
  159. {easycoder-250820.1 → easycoder-250824.2}/plugins/ec_pyside6.py +0 -0
  160. {easycoder-250820.1 → easycoder-250824.2}/plugins/points.py +0 -0
  161. {easycoder-250820.1 → easycoder-250824.2}/plugins/sql.py +0 -0
  162. {easycoder-250820.1 → easycoder-250824.2}/pyproject.toml +0 -0
  163. {easycoder-250820.1 → easycoder-250824.2}/scripts/benchmark.ecs +0 -0
  164. {easycoder-250820.1 → easycoder-250824.2}/scripts/config.ecg +0 -0
  165. {easycoder-250820.1 → easycoder-250824.2}/scripts/ec_keyboard.py +0 -0
  166. {easycoder-250820.1 → easycoder-250824.2}/scripts/fizzbuzz.ecs +0 -0
  167. {easycoder-250820.1 → easycoder-250824.2}/scripts/hello.ecs +0 -0
  168. {easycoder-250820.1 → easycoder-250824.2}/scripts/points.ecs +0 -0
  169. {easycoder-250820.1 → easycoder-250824.2}/scripts/test.ecs +0 -0
  170. {easycoder-250820.1 → easycoder-250824.2}/scripts/tests.ecs +0 -0
  171. {easycoder-250820.1 → easycoder-250824.2}/test.py +0 -0
  172. {easycoder-250820.1 → easycoder-250824.2}/testrc.py +0 -0
  173. {easycoder-250820.1 → easycoder-250824.2}/testsql.py +0 -0
  174. {easycoder-250820.1 → easycoder-250824.2}/testui.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 250820.1
3
+ Version: 250824.2
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>
@@ -6,9 +6,10 @@ from .ec_condition import *
6
6
  from .ec_core import *
7
7
  from .ec_handler import *
8
8
  from .ec_keyboard import *
9
+ from .ec_border import *
9
10
  from .ec_program import *
10
11
  from .ec_pyside import *
11
12
  from .ec_timestamp import *
12
13
  from .ec_value import *
13
14
 
14
- __version__ = "250820.1"
15
+ __version__ = "250824.2"
@@ -0,0 +1,63 @@
1
+ import os
2
+ from PySide6.QtWidgets import QWidget
3
+ from PySide6.QtGui import QPixmap, QPainter
4
+ from PySide6.QtCore import Qt, Signal, QRect
5
+
6
+ class Border(QWidget):
7
+ tickClicked = Signal()
8
+ closeClicked = Signal()
9
+
10
+ def __init__(self):
11
+ super().__init__()
12
+ self.size = 40
13
+ self.setFixedHeight(self.size)
14
+ self._drag_active = False
15
+ self._drag_start_pos = None
16
+
17
+ def paintEvent(self, event):
18
+ painter = QPainter(self)
19
+ painter.setRenderHint(QPainter.Antialiasing)
20
+ # Draw the tick icon
21
+ self.tick = QPixmap(f'{os.path.dirname(os.path.abspath(__file__))}/tick.png').scaled(self.size, self.size, Qt.KeepAspectRatio, Qt.SmoothTransformation)
22
+ x = 0
23
+ y = 0
24
+ painter.drawPixmap(x, y, self.tick)
25
+ # Draw the close icon
26
+ self.close = QPixmap(f'{os.path.dirname(os.path.abspath(__file__))}/close.png').scaled(self.size, self.size, Qt.KeepAspectRatio, Qt.SmoothTransformation)
27
+ x = self.width() - self.close.width()
28
+ y = 0
29
+ painter.drawPixmap(x, y, self.close)
30
+
31
+ def mousePressEvent(self, event):
32
+ # Tick icon
33
+ x = 0
34
+ y = 0
35
+ tickRect = self.tick.rect().translated(x, y)
36
+ # Close icon
37
+ x = self.width() - self.close.width()
38
+ y = 0
39
+ closeRect = self.close.rect().translated(x, y)
40
+ if tickRect.contains(event.pos()):
41
+ self.tickClicked.emit()
42
+ if closeRect.contains(event.pos()):
43
+ self.closeClicked.emit()
44
+ elif QRect(0, 0, self.width(), self.height()).contains(event.pos()):
45
+ if hasattr(self.window().windowHandle(), 'startSystemMove'):
46
+ self.window().windowHandle().startSystemMove()
47
+ else:
48
+ self._drag_active = True
49
+ self._drag_start_pos = event.globalPosition().toPoint()
50
+ self._dialog_start_pos = self.window().pos()
51
+ else:
52
+ super().mousePressEvent(event)
53
+
54
+ def mouseMoveEvent(self, event):
55
+ if self._drag_active:
56
+ delta = event.globalPosition().toPoint() - self._drag_start_pos
57
+ self.window().move(self._dialog_start_pos + delta)
58
+ else:
59
+ super().mouseMoveEvent(event)
60
+
61
+ def mouseReleaseEvent(self, event):
62
+ self._drag_active = False
63
+ super().mouseReleaseEvent(event)
@@ -1,5 +1,5 @@
1
- import os
2
1
  from .ec_handler import Handler
2
+ from .ec_border import Border
3
3
  from PySide6.QtWidgets import (
4
4
  QDialog,
5
5
  QVBoxLayout,
@@ -18,65 +18,6 @@ from PySide6.QtCore import Qt, QTimer, Signal, QRect
18
18
 
19
19
  class Keyboard(Handler):
20
20
  iconClicked = Signal()
21
-
22
- class Border(QWidget):
23
- tickClicked = Signal()
24
- closeClicked = Signal()
25
-
26
- def __init__(self):
27
- super().__init__()
28
- self.size = 40
29
- self.setFixedHeight(self.size)
30
- self._drag_active = False
31
- self._drag_start_pos = None
32
-
33
- def paintEvent(self, event):
34
- painter = QPainter(self)
35
- painter.setRenderHint(QPainter.Antialiasing)
36
- # Draw the tick icon
37
- self.tick = QPixmap(f'{os.path.dirname(os.path.abspath(__file__))}/tick.png').scaled(self.size, self.size, Qt.KeepAspectRatio, Qt.SmoothTransformation)
38
- x = 0
39
- y = 0
40
- painter.drawPixmap(x, y, self.tick)
41
- # Draw the close icon
42
- self.close = QPixmap(f'{os.path.dirname(os.path.abspath(__file__))}/close.png').scaled(self.size, self.size, Qt.KeepAspectRatio, Qt.SmoothTransformation)
43
- x = self.width() - self.close.width()
44
- y = 0
45
- painter.drawPixmap(x, y, self.close)
46
-
47
- def mousePressEvent(self, event):
48
- # Tick icon
49
- x = 0
50
- y = 0
51
- tickRect = self.tick.rect().translated(x, y)
52
- # Close icon
53
- x = self.width() - self.close.width()
54
- y = 0
55
- closeRect = self.close.rect().translated(x, y)
56
- if tickRect.contains(event.pos()):
57
- self.tickClicked.emit()
58
- if closeRect.contains(event.pos()):
59
- self.closeClicked.emit()
60
- elif QRect(0, 0, self.width(), self.height()).contains(event.pos()):
61
- if hasattr(self.window().windowHandle(), 'startSystemMove'):
62
- self.window().windowHandle().startSystemMove()
63
- else:
64
- self._drag_active = True
65
- self._drag_start_pos = event.globalPosition().toPoint()
66
- self._dialog_start_pos = self.window().pos()
67
- else:
68
- super().mousePressEvent(event)
69
-
70
- def mouseMoveEvent(self, event):
71
- if self._drag_active:
72
- delta = event.globalPosition().toPoint() - self._drag_start_pos
73
- self.window().move(self._dialog_start_pos + delta)
74
- else:
75
- super().mouseMoveEvent(event)
76
-
77
- def mouseReleaseEvent(self, event):
78
- self._drag_active = False
79
- super().mouseReleaseEvent(event)
80
21
 
81
22
  def __init__(self, program, keyboardType, receiverLayout, receivers, caller = None, parent=None):
82
23
  super().__init__(program.compiler)
@@ -103,7 +44,7 @@ class Keyboard(Handler):
103
44
  # Add the keyboard
104
45
  layout = QVBoxLayout(dialog)
105
46
 
106
- border = self.Border()
47
+ border = Border()
107
48
  border.tickClicked.connect(self.dialog.accept)
108
49
  border.closeClicked.connect(self.reject)
109
50
  layout.addWidget(border)
@@ -1,8 +1,9 @@
1
- import sys
1
+ import sys, os
2
2
  from .ec_handler import Handler
3
3
  from .ec_classes import RuntimeError
4
- from PySide6.QtCore import Qt, QTimer, Signal
5
- from PySide6.QtGui import QPixmap
4
+ from .ec_border import Border
5
+ from PySide6.QtCore import Qt, QTimer, Signal, QRect
6
+ from PySide6.QtGui import QPixmap, QPainter
6
7
  from PySide6.QtWidgets import (
7
8
  QApplication,
8
9
  QCheckBox,
@@ -34,7 +35,8 @@ from PySide6.QtWidgets import (
34
35
  QSizePolicy,
35
36
  QDialog,
36
37
  QMessageBox,
37
- QDialogButtonBox
38
+ QDialogButtonBox,
39
+ QGraphicsDropShadowEffect
38
40
  )
39
41
 
40
42
  class Graphics(Handler):
@@ -65,19 +67,7 @@ class Graphics(Handler):
65
67
  ]
66
68
 
67
69
  def dialogTypes(self):
68
- return ['confirm', 'lineedit', 'multiline']
69
-
70
- class ECDialog(QDialog):
71
- def __init__(self, parent, record):
72
- super().__init__(parent)
73
- self.record = record
74
-
75
- def showEvent(self, event):
76
- super().showEvent(event)
77
- QTimer.singleShot(100, self.afterShown)
78
-
79
- def afterShown(self):
80
- if 'action' in self.record: self.record['action']()
70
+ return ['confirm', 'lineedit', 'multiline', 'generic']
81
71
 
82
72
  class ClickableLineEdit(QLineEdit):
83
73
  clicked = Signal()
@@ -300,7 +290,7 @@ class Graphics(Handler):
300
290
 
301
291
  # Create a window
302
292
  def k_createWindow(self, command):
303
- command['title'] = 'Default'
293
+ title = None
304
294
  x = None
305
295
  y = None
306
296
  w = self.compileConstant(640)
@@ -309,7 +299,7 @@ class Graphics(Handler):
309
299
  token = self.peek()
310
300
  if token in ['title', 'at', 'size', 'layout']:
311
301
  self.nextToken()
312
- if token == 'title': command['title'] = self.nextValue()
302
+ if token == 'title': title = self.nextValue()
313
303
  elif token == 'at':
314
304
  x = self.nextValue()
315
305
  y = self.nextValue()
@@ -323,6 +313,7 @@ class Graphics(Handler):
323
313
  command['layout'] = record['name']
324
314
  else: return False
325
315
  else: break
316
+ command['title'] = title
326
317
  command['x'] = x
327
318
  command['y'] = y
328
319
  command['w'] = w
@@ -456,6 +447,9 @@ class Graphics(Handler):
456
447
  elif self.peek() == 'value':
457
448
  self.nextToken()
458
449
  command['value'] = self.nextValue()
450
+ elif self.peek() == 'with':
451
+ self.nextToken()
452
+ command['layout'] = self.nextToken()
459
453
  else: break
460
454
  if not 'title' in command: command['title'] = self.compileConstant('')
461
455
  if not 'value' in command: command['value'] = self.compileConstant('')
@@ -510,7 +504,9 @@ class Graphics(Handler):
510
504
 
511
505
  def r_createWindow(self, command, record):
512
506
  window = QMainWindow()
513
- window.setWindowTitle(self.getRuntimeValue(command['title']))
507
+ title = self.getRuntimeValue(command['title'])
508
+ if title == None: title = 'EasyCoder Main Window'
509
+ window.setWindowTitle(title)
514
510
  w = self.getRuntimeValue(command['w'])
515
511
  h = self.getRuntimeValue(command['h'])
516
512
  x = command['x']
@@ -629,32 +625,61 @@ class Graphics(Handler):
629
625
  return self.nextPC()
630
626
 
631
627
  def r_createDialog(self, command, record):
628
+
629
+ class ECDialog(QDialog):
630
+ def __init__(self, parent, record):
631
+ super().__init__(parent)
632
+ self.record = record
633
+
634
+ def showEvent(self, event):
635
+ super().showEvent(event)
636
+ QTimer.singleShot(100, self.afterShown)
637
+
638
+ def afterShown(self):
639
+ if 'action' in self.record: self.record['action']()
640
+
632
641
  win = command['window']
633
642
  if win != None:
634
643
  win = self.getVariable(win)['window']
635
- dialog = self.ECDialog(win, record)
636
- mainLayout = QVBoxLayout(dialog)
637
- dialog.setWindowTitle(self.getRuntimeValue(command['title']))
644
+ dialog = ECDialog(win, record)
638
645
  dialogType = command['type'].lower()
639
646
  dialog.dialogType = dialogType
640
- prompt = self.getRuntimeValue(command['prompt'])
641
- if dialogType == 'confirm':
642
- mainLayout.addWidget(QLabel(prompt))
643
- elif dialogType == 'lineedit':
644
- mainLayout.addWidget(QLabel(prompt))
645
- dialog.lineEdit = self.ClickableLineEdit(dialog)
646
- dialog.value = self.getRuntimeValue(command['value'])
647
- dialog.lineEdit.setText(dialog.value)
648
- mainLayout.addWidget(dialog.lineEdit)
649
- elif dialogType == 'multiline':
650
- mainLayout.addWidget(QLabel(prompt))
651
- dialog.textEdit = self.ClickablePlainTextEdit(self)
652
- dialog.textEdit.setText(dialog.value)
653
- mainLayout.addWidget(dialog.textEdit)
654
- buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
655
- buttonBox.accepted.connect(dialog.accept)
656
- buttonBox.rejected.connect(dialog.reject)
657
- mainLayout.addWidget(buttonBox, alignment=Qt.AlignHCenter)
647
+ mainLayout = QVBoxLayout(dialog)
648
+ if dialogType == 'generic':
649
+ dialog.setFixedWidth(500)
650
+ dialog.setFixedHeight(500)
651
+ dialog.setWindowFlags(Qt.FramelessWindowHint)
652
+ dialog.setModal(True)
653
+ dialog.setStyleSheet('background-color: white;border:1px solid black;')
654
+
655
+ border = Border()
656
+ border.tickClicked.connect(dialog.accept)
657
+ border.closeClicked.connect(dialog.reject)
658
+ mainLayout.addWidget(border)
659
+ if 'layout' in command:
660
+ layout = self.getVariable(command['layout'])['widget']
661
+ mainLayout.addLayout(layout)
662
+ dialog.setLayout(mainLayout)
663
+ else:
664
+ dialog.setWindowTitle(self.getRuntimeValue(command['title']))
665
+ prompt = self.getRuntimeValue(command['prompt'])
666
+ if dialogType == 'confirm':
667
+ mainLayout.addWidget(QLabel(prompt))
668
+ elif dialogType == 'lineedit':
669
+ mainLayout.addWidget(QLabel(prompt))
670
+ dialog.lineEdit = self.ClickableLineEdit(dialog)
671
+ dialog.value = self.getRuntimeValue(command['value'])
672
+ dialog.lineEdit.setText(dialog.value)
673
+ mainLayout.addWidget(dialog.lineEdit)
674
+ elif dialogType == 'multiline':
675
+ mainLayout.addWidget(QLabel(prompt))
676
+ dialog.textEdit = self.ClickablePlainTextEdit(self)
677
+ dialog.textEdit.setText(dialog.value)
678
+ mainLayout.addWidget(dialog.textEdit)
679
+ buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
680
+ buttonBox.accepted.connect(dialog.accept)
681
+ buttonBox.rejected.connect(dialog.reject)
682
+ mainLayout.addWidget(buttonBox, alignment=Qt.AlignHCenter)
658
683
  record['dialog'] = dialog
659
684
  return self.nextPC()
660
685
 
@@ -938,11 +963,12 @@ class Graphics(Handler):
938
963
  return self.nextPC()
939
964
 
940
965
  # set [the] width/height [of] {widget} [to] {value}
941
- # set [the] layout of {window} to {layout}
966
+ # set [the] layout of {window}/{widget} to {layout}
942
967
  # set [the] spacing of {layout} to {value}
943
968
  # set [the] text [of] {label}/{button}/{lineinput}/{multiline} [to] {text}
944
969
  # set [the] color [of] {label}/{button}/{lineinput}/{multiline} [to] {color}
945
970
  # set [the] state [of] {checkbox} [to] {state}
971
+ # set [the] style of {widget} to {style}
946
972
  # set {listbox} to {list}
947
973
  # set blocked true/false
948
974
  def k_set(self, command):
@@ -963,7 +989,8 @@ class Graphics(Handler):
963
989
  self.skip('of')
964
990
  if self.nextIsSymbol():
965
991
  record = self.getSymbolRecord()
966
- if record['keyword'] == 'window':
992
+ keyword = record['keyword']
993
+ if keyword in ['window', 'widget']:
967
994
  command['name'] = record['name']
968
995
  self.skip('to')
969
996
  if self.nextIsSymbol():
@@ -996,6 +1023,22 @@ class Graphics(Handler):
996
1023
  if self.nextIsSymbol():
997
1024
  record = self.getSymbolRecord()
998
1025
  if record['keyword'] == 'checkbox':
1026
+ command['name'] = record['name']
1027
+ self.skip('to')
1028
+ if self.peek() == 'checked':
1029
+ command['value'] = self.compileConstant(True)
1030
+ self.nextToken()
1031
+ elif self.peek() == 'unchecked':
1032
+ command['value'] = self.compileConstant(False)
1033
+ self.nextToken()
1034
+ else: command['value'] = self.nextValue()
1035
+ self.add(command)
1036
+ return True
1037
+ elif token == 'style':
1038
+ self.skip('of')
1039
+ if self.nextIsSymbol():
1040
+ record = self.getSymbolRecord()
1041
+ if record['extra'] == 'gui':
999
1042
  command['name'] = record['name']
1000
1043
  self.skip('to')
1001
1044
  command['value'] = self.nextValue()
@@ -1068,11 +1111,17 @@ class Graphics(Handler):
1068
1111
  widget = self.getVariable(command['name'])['widget']
1069
1112
  widget.setFixedWidth(self.getRuntimeValue(command['value']))
1070
1113
  elif what == 'layout':
1071
- window = self.getVariable(command['name'])['window']
1072
1114
  content = self.getVariable(command['layout'])['widget']
1073
- container = QWidget()
1074
- container.setLayout(content)
1075
- window.setCentralWidget(container)
1115
+ record = self.getVariable(command['name'])
1116
+ keyword = record['keyword']
1117
+ if keyword == 'window':
1118
+ window = record['widget']
1119
+ container = QWidget()
1120
+ container.setLayout(content)
1121
+ window.setCentralWidget(container)
1122
+ elif keyword == 'widget':
1123
+ widget = record['widget']
1124
+ widget.setLayout(content)
1076
1125
  elif what == 'spacing':
1077
1126
  layout = self.getVariable(command['name'])['widget']
1078
1127
  layout.setSpacing(self.getRuntimeValue(command['value']))
@@ -1188,7 +1237,9 @@ class Graphics(Handler):
1188
1237
  elif 'dialog' in command:
1189
1238
  record = self.getVariable(command['dialog'])
1190
1239
  dialog = record['dialog']
1191
- if dialog.dialogType == 'confirm':
1240
+ if dialog.dialogType == 'generic':
1241
+ record['result'] = dialog.exec()
1242
+ elif dialog.dialogType == 'confirm':
1192
1243
  record['result'] = True if dialog.exec() == QDialog.Accepted else False
1193
1244
  elif dialog.dialogType == 'lineedit':
1194
1245
  if dialog.exec() == QDialog.Accepted:
@@ -1224,6 +1275,13 @@ class Graphics(Handler):
1224
1275
  self.app.lastWindowClosed.connect(on_last_window_closed)
1225
1276
  self.app.exec()
1226
1277
 
1278
+ # Declare a widget variable
1279
+ def k_widget(self, command):
1280
+ return self.compileVariable(command, 'gui')
1281
+
1282
+ def r_widget(self, command):
1283
+ return self.nextPC()
1284
+
1227
1285
  # Declare a window variable
1228
1286
  def k_window(self, command):
1229
1287
  return self.compileVariable(command)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes