easycoder 251015.1__tar.gz → 251017.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.

Files changed (173) hide show
  1. {easycoder-251015.1 → easycoder-251017.1}/PKG-INFO +1 -1
  2. {easycoder-251015.1 → easycoder-251017.1}/easycoder/__init__.py +1 -1
  3. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_pyside.py +65 -53
  4. {easycoder-251015.1 → easycoder-251017.1}/.gitignore +0 -0
  5. {easycoder-251015.1 → easycoder-251017.1}/LICENSE +0 -0
  6. {easycoder-251015.1 → easycoder-251017.1}/README.md +0 -0
  7. {easycoder-251015.1 → easycoder-251017.1}/backdrop.jpg +0 -0
  8. {easycoder-251015.1 → easycoder-251017.1}/doc/README.md +0 -0
  9. {easycoder-251015.1 → easycoder-251017.1}/doc/core/README.md +0 -0
  10. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/boolean.md +0 -0
  11. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/empty.md +0 -0
  12. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/ends.md +0 -0
  13. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/even.md +0 -0
  14. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/exists.md +0 -0
  15. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/greater.md +0 -0
  16. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/hasProperty.md +0 -0
  17. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/includes.md +0 -0
  18. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/is.md +0 -0
  19. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/less.md +0 -0
  20. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/list.md +0 -0
  21. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/none.md +0 -0
  22. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/not.md +0 -0
  23. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/numeric.md +0 -0
  24. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/object.md +0 -0
  25. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/odd.md +0 -0
  26. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/starts.md +0 -0
  27. {easycoder-251015.1 → easycoder-251017.1}/doc/core/conditions/string.md +0 -0
  28. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/add.md +0 -0
  29. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/append.md +0 -0
  30. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/assert.md +0 -0
  31. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/begin.md +0 -0
  32. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/clear.md +0 -0
  33. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/close.md +0 -0
  34. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/create.md +0 -0
  35. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/debug.md +0 -0
  36. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/decrement.md +0 -0
  37. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/delete.md +0 -0
  38. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/divide.md +0 -0
  39. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/exit.md +0 -0
  40. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/file.md +0 -0
  41. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/fork.md +0 -0
  42. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/get.md +0 -0
  43. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/go.md +0 -0
  44. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/gosub.md +0 -0
  45. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/if.md +0 -0
  46. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/import.md +0 -0
  47. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/increment.md +0 -0
  48. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/index.md +0 -0
  49. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/init.md +0 -0
  50. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/input.md +0 -0
  51. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/load.md +0 -0
  52. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/lock.md +0 -0
  53. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/log.md +0 -0
  54. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/module.md +0 -0
  55. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/multiply.md +0 -0
  56. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/negate.md +0 -0
  57. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/on.md +0 -0
  58. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/open.md +0 -0
  59. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/pop.md +0 -0
  60. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/post.md +0 -0
  61. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/print.md +0 -0
  62. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/push.md +0 -0
  63. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/put.md +0 -0
  64. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/read.md +0 -0
  65. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/release.md +0 -0
  66. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/replace.md +0 -0
  67. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/return.md +0 -0
  68. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/run.md +0 -0
  69. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/save.md +0 -0
  70. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/script.md +0 -0
  71. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/send.md +0 -0
  72. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/set.md +0 -0
  73. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/shuffle.md +0 -0
  74. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/split.md +0 -0
  75. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/stack.md +0 -0
  76. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/stop.md +0 -0
  77. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/system.md +0 -0
  78. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/take.md +0 -0
  79. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/toggle.md +0 -0
  80. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/truncate.md +0 -0
  81. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/unlock.md +0 -0
  82. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/use.md +0 -0
  83. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/variable.md +0 -0
  84. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/wait.md +0 -0
  85. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/while.md +0 -0
  86. {easycoder-251015.1 → easycoder-251017.1}/doc/core/keywords/write.md +0 -0
  87. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/arg.md +0 -0
  88. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/args.md +0 -0
  89. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/cos.md +0 -0
  90. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/datime.md +0 -0
  91. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/decode.md +0 -0
  92. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/element.md +0 -0
  93. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/elements.md +0 -0
  94. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/empty.md +0 -0
  95. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/encode.md +0 -0
  96. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/error.md +0 -0
  97. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/files.md +0 -0
  98. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/float.md +0 -0
  99. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/from.md +0 -0
  100. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/hash.md +0 -0
  101. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/index.md +0 -0
  102. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/integer.md +0 -0
  103. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/json.md +0 -0
  104. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/keys.md +0 -0
  105. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/left.md +0 -0
  106. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/length.md +0 -0
  107. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/lowercase.md +0 -0
  108. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/memory.md +0 -0
  109. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/modification.md +0 -0
  110. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/modulo.md +0 -0
  111. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/newline.md +0 -0
  112. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/now.md +0 -0
  113. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/position.md +0 -0
  114. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/property.md +0 -0
  115. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/random.md +0 -0
  116. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/right.md +0 -0
  117. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/sin.md +0 -0
  118. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/stringify.md +0 -0
  119. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/tab.md +0 -0
  120. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/tan.md +0 -0
  121. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/timestamp.md +0 -0
  122. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/today.md +0 -0
  123. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/trim.md +0 -0
  124. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/type.md +0 -0
  125. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/uppercase.md +0 -0
  126. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/value.md +0 -0
  127. {easycoder-251015.1 → easycoder-251017.1}/doc/core/values/weekday.md +0 -0
  128. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/README.md +0 -0
  129. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/attach.md +0 -0
  130. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/close.md +0 -0
  131. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/create.md +0 -0
  132. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/ellipse.md +0 -0
  133. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/image.md +0 -0
  134. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/move.md +0 -0
  135. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/on.md +0 -0
  136. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/rectangle.md +0 -0
  137. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/render.md +0 -0
  138. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/run.md +0 -0
  139. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/set.md +0 -0
  140. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/keywords/text.md +0 -0
  141. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/values/attribute.md +0 -0
  142. {easycoder-251015.1 → easycoder-251017.1}/doc/graphics/values/window.md +0 -0
  143. {easycoder-251015.1 → easycoder-251017.1}/easycoder/close.png +0 -0
  144. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_border.py +0 -0
  145. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_classes.py +0 -0
  146. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_compiler.py +0 -0
  147. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_condition.py +0 -0
  148. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_core.py +0 -0
  149. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_handler.py +0 -0
  150. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_keyboard.py +0 -0
  151. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_program.py +0 -0
  152. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_timestamp.py +0 -0
  153. {easycoder-251015.1 → easycoder-251017.1}/easycoder/ec_value.py +0 -0
  154. {easycoder-251015.1 → easycoder-251017.1}/easycoder/tick.png +0 -0
  155. {easycoder-251015.1 → easycoder-251017.1}/images/Semoigo Dawn.jpg +0 -0
  156. {easycoder-251015.1 → easycoder-251017.1}/json/graphics-demo.json +0 -0
  157. {easycoder-251015.1 → easycoder-251017.1}/plugins/ec_keyboard.py +0 -0
  158. {easycoder-251015.1 → easycoder-251017.1}/plugins/ec_p100.py +0 -0
  159. {easycoder-251015.1 → easycoder-251017.1}/plugins/ec_pyside6.py +0 -0
  160. {easycoder-251015.1 → easycoder-251017.1}/plugins/points.py +0 -0
  161. {easycoder-251015.1 → easycoder-251017.1}/plugins/sql.py +0 -0
  162. {easycoder-251015.1 → easycoder-251017.1}/pyproject.toml +0 -0
  163. {easycoder-251015.1 → easycoder-251017.1}/scripts/benchmark.ecs +0 -0
  164. {easycoder-251015.1 → easycoder-251017.1}/scripts/ec_keyboard.py +0 -0
  165. {easycoder-251015.1 → easycoder-251017.1}/scripts/fizzbuzz.ecs +0 -0
  166. {easycoder-251015.1 → easycoder-251017.1}/scripts/hello.ecs +0 -0
  167. {easycoder-251015.1 → easycoder-251017.1}/scripts/points.ecs +0 -0
  168. {easycoder-251015.1 → easycoder-251017.1}/scripts/test.ecs +0 -0
  169. {easycoder-251015.1 → easycoder-251017.1}/scripts/tests.ecs +0 -0
  170. {easycoder-251015.1 → easycoder-251017.1}/test.py +0 -0
  171. {easycoder-251015.1 → easycoder-251017.1}/testrc.py +0 -0
  172. {easycoder-251015.1 → easycoder-251017.1}/testsql.py +0 -0
  173. {easycoder-251015.1 → easycoder-251017.1}/testui.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 251015.1
3
+ Version: 251017.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>
@@ -12,4 +12,4 @@ from .ec_pyside import *
12
12
  from .ec_timestamp import *
13
13
  from .ec_value import *
14
14
 
15
- __version__ = "251015.1"
15
+ __version__ = "251017.1"
@@ -67,13 +67,21 @@ class Graphics(Handler):
67
67
  'combobox',
68
68
  'widget'
69
69
  ]
70
+
71
+ def setWidget(self, record, widget):
72
+ if not 'widget' in record:
73
+ record['widget'] = [None] * record['elements']
74
+ record['widget'][record['index']] = widget
75
+
76
+ def getWidget(self, record):
77
+ if 'widget' in record and record['widget'] != None:
78
+ if record['keyword'] == 'layout': return record['widget']
79
+ return record['widget'][record['index']]
80
+ else:
81
+ return None
70
82
 
71
83
  def dialogTypes(self):
72
84
  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']
77
85
 
78
86
  class ClickableLineEdit(QLineEdit):
79
87
  clicked = Signal()
@@ -114,7 +122,7 @@ class Graphics(Handler):
114
122
  # (2) add {widget} to {layout}
115
123
  # (3) add stretch {widget} to {layout}
116
124
  # (4) add stretch to {layout}
117
- # (5) add spacer {size} to {layout}
125
+ # (5) add spacer [size] {size} to {layout}
118
126
  # (6) add {widget} at {col} {row} in {grid layout}
119
127
  def k_add(self, command):
120
128
  def addToLayout():
@@ -146,6 +154,7 @@ class Graphics(Handler):
146
154
 
147
155
  elif token == 'spacer':
148
156
  self.nextToken()
157
+ self.skip('size')
149
158
  command['widget'] = 'spacer'
150
159
  command['size'] = self.nextValue()
151
160
  self.skip('to')
@@ -186,19 +195,19 @@ class Graphics(Handler):
186
195
  def r_add(self, command):
187
196
  if 'value' in command:
188
197
  value = self.getRuntimeValue(command['value'])
189
- widget = self.getVariable(command['widget'])
198
+ record = self.getVariable(command['widget'])
190
199
  if widget['keyword'] == 'listbox':
191
- widget['widget'].addItem(value)
192
- elif widget['keyword'] == 'combobox':
193
- if isinstance(value, list): widget['widget'].addItems(value)
194
- else: widget['widget'].addItem(value)
200
+ record['widget'].addItem(value)
201
+ elif record['keyword'] == 'combobox':
202
+ if isinstance(value, list): record['widget'].addItems(value)
203
+ else: record['widget'].addItem(value)
195
204
  elif 'row' in command and 'col' in command:
196
205
  layout = self.getVariable(command['layout'])['widget']
197
- widgetVar = self.getVariable(command['widget'])
198
- widget = widgetVar['widget']
206
+ record = self.getVariable(command['widget'])
207
+ widget = self.getWidget(record)
199
208
  row = self.getRuntimeValue(command['row'])
200
209
  col = self.getRuntimeValue(command['col'])
201
- if widgetVar['keyword'] == 'layout':
210
+ if record['keyword'] == 'layout':
202
211
  layout.addLayout(widget, row, col)
203
212
  else:
204
213
  layout.addWidget(widget, row, col)
@@ -272,7 +281,7 @@ class Graphics(Handler):
272
281
  return False
273
282
 
274
283
  def r_clear(self, command):
275
- widget = self.getVariable(command['name'])['widget']
284
+ widget = self.getWidget(self.getVariable(command['name']))
276
285
  widget.clear()
277
286
  return self.nextPC()
278
287
 
@@ -375,7 +384,7 @@ class Graphics(Handler):
375
384
  if token == 'text':
376
385
  self.nextToken()
377
386
  command['text'] = self.nextValue()
378
- if token == 'icon':
387
+ elif token == 'icon':
379
388
  self.nextToken()
380
389
  command['icon'] = self.nextValue()
381
390
  elif token == 'size':
@@ -563,7 +572,7 @@ class Graphics(Handler):
563
572
  elif alignment == 'justify': label.setAlignment(Qt.AlignJustify)
564
573
  if 'expand' in command:
565
574
  label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
566
- record['widget'] = label
575
+ self.setWidget(record, label)
567
576
  return self.nextPC()
568
577
 
569
578
  def r_createPushbutton(self, command, record):
@@ -589,7 +598,7 @@ class Graphics(Handler):
589
598
  w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
590
599
  pushbutton.setMaximumWidth(w)
591
600
  self.putSymbolValue(record, pushbutton)
592
- record['widget'] = pushbutton
601
+ self.setWidget(record, pushbutton)
593
602
  return self.nextPC()
594
603
 
595
604
  def r_createCheckBox(self, command, record):
@@ -611,7 +620,7 @@ class Graphics(Handler):
611
620
  }
612
621
  """)
613
622
  checkbox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
614
- record['widget'] = checkbox
623
+ self.setWidget(record, checkbox)
615
624
  return self.nextPC()
616
625
 
617
626
  def r_createLineEdit(self, command, record):
@@ -622,7 +631,7 @@ class Graphics(Handler):
622
631
  c = lineinput.contentsMargins()
623
632
  w = fm.horizontalAdvance('x') * self.getRuntimeValue(command['size']) +m.left()+m.right()+c.left()+c.right()
624
633
  lineinput.setMaximumWidth(w)
625
- record['widget'] = lineinput
634
+ self.setWidget(record, lineinput)
626
635
  return self.nextPC()
627
636
 
628
637
  def r_createMultiLineEdit(self, command, record):
@@ -632,19 +641,19 @@ class Graphics(Handler):
632
641
  charHeight = fontMetrics.height()
633
642
  textinput.setFixedWidth(charWidth * self.getRuntimeValue(command['cols']))
634
643
  textinput.setFixedHeight(charHeight * self.getRuntimeValue(command['rows']))
635
- record['widget'] = textinput
644
+ self.setWidget(record, textinput)
636
645
  return self.nextPC()
637
646
 
638
647
  def r_createListWidget(self, command, record):
639
- record['widget'] = QListWidget()
648
+ self.setWidget(record, QListWidget())
640
649
  return self.nextPC()
641
650
 
642
651
  def r_createComboBox(self, command, record):
643
- record['widget'] = QComboBox()
652
+ self.setWidget(record, QComboBox())
644
653
  return self.nextPC()
645
654
 
646
655
  def r_createWidget(self, command, record):
647
- record['widget'] = QWidget()
656
+ self.setWidget(record, QWidget())
648
657
  return self.nextPC()
649
658
 
650
659
  def r_createDialog(self, command, record):
@@ -783,8 +792,8 @@ class Graphics(Handler):
783
792
  return False
784
793
 
785
794
  def r_hide(self, command):
786
- widget = self.getVariable(command['widget'])['widget']
787
- widget.hide()
795
+ record = self.getVariable(command['widget'])
796
+ if 'widget' in record: self.getWidget(record).hide()
788
797
  return self.nextPC()
789
798
 
790
799
  # Initialize the graphics environment
@@ -917,7 +926,7 @@ class Graphics(Handler):
917
926
 
918
927
  def r_on(self, command):
919
928
  def run(widget, record):
920
- for i, w in enumerate(record['value']):
929
+ for i, w in enumerate(record['widget']):
921
930
  if w == widget:
922
931
  record['index'] = i
923
932
  self.run(command['goto'])
@@ -971,10 +980,10 @@ class Graphics(Handler):
971
980
  record = self.getVariable(command['name'])
972
981
  if variant == 'current':
973
982
  if record['keyword'] == 'combobox':
974
- widget = record['widget']
983
+ widget = self.getWidget(record)
975
984
  widget.removeItem(widget.currentIndex())
976
985
  if record['keyword'] == 'listbox':
977
- widget = record['widget']
986
+ widget = self.getWidget(record)
978
987
  selectedItem = widget.currentItem()
979
988
  if selectedItem:
980
989
  row = widget.row(selectedItem)
@@ -999,7 +1008,7 @@ class Graphics(Handler):
999
1008
  return False
1000
1009
 
1001
1010
  def r_select(self, command):
1002
- widget = self.getVariable(command['widget'])['widget']
1011
+ widget = self.getWidget(self.getVariable(command['widget']))
1003
1012
  if 'index' in command:
1004
1013
  index = self.getRuntimeValue(command['index'])
1005
1014
  else:
@@ -1042,9 +1051,10 @@ class Graphics(Handler):
1042
1051
  self.skip('to')
1043
1052
  if self.nextIsSymbol():
1044
1053
  record = self.getSymbolRecord()
1045
- command['layout'] = record['name']
1046
- self.add(command)
1047
- return True
1054
+ if record['keyword'] == 'layout':
1055
+ command['layout'] = record['name']
1056
+ self.add(command)
1057
+ return True
1048
1058
  elif token == 'spacing':
1049
1059
  self.skip('of')
1050
1060
  if self.nextIsSymbol():
@@ -1152,25 +1162,26 @@ class Graphics(Handler):
1152
1162
  def r_set(self, command):
1153
1163
  what = command['what']
1154
1164
  if what == 'height':
1155
- widget = self.getVariable(command['name'])['widget']
1165
+ widget = self.getWidget(self.getVariable(command['name']))
1156
1166
  widget.setFixedHeight(self.getRuntimeValue(command['value']))
1157
1167
  elif what == 'width':
1158
- widget = self.getVariable(command['name'])['widget']
1168
+ widget = self.getWidget(self.getVariable(command['name']))
1159
1169
  widget.setFixedWidth(self.getRuntimeValue(command['value']))
1160
1170
  elif what == 'layout':
1161
- content = self.getVariable(command['layout'])['widget']
1171
+ record = self.getVariable(command['layout'])
1172
+ layout = record['widget']
1162
1173
  record = self.getVariable(command['name'])
1163
1174
  keyword = record['keyword']
1164
1175
  if keyword == 'window':
1165
1176
  window = record['window']
1166
1177
  container = QWidget()
1167
- container.setLayout(content)
1178
+ container.setLayout(layout)
1168
1179
  window.setCentralWidget(container)
1169
1180
  elif keyword == 'widget':
1170
- widget = record['widget']
1171
- widget.setLayout(content)
1181
+ widget = self.getWidget(record)
1182
+ widget.setLayout(layout)
1172
1183
  elif what == 'spacing':
1173
- layout = self.getVariable(command['name'])['widget']
1184
+ layout = self.getWidget(self.getVariable(command['name']))
1174
1185
  layout.setSpacing(self.getRuntimeValue(command['value']))
1175
1186
  elif what == 'text':
1176
1187
  record = self.getVariable(command['name'])
@@ -1188,7 +1199,7 @@ class Graphics(Handler):
1188
1199
  record = self.getVariable(command['name'])
1189
1200
  if record['keyword'] == 'checkbox':
1190
1201
  state = self.getRuntimeValue(command['value'])
1191
- record['widget'].setChecked(state)
1202
+ self.getWidget(record).setChecked(state)
1192
1203
  elif what == 'alignment':
1193
1204
  widget = self.getVariable(command['name'])['widget']
1194
1205
  flags = command['value']
@@ -1227,6 +1238,7 @@ class Graphics(Handler):
1227
1238
 
1228
1239
  # show {window}
1229
1240
  # show {dialog}
1241
+ # show {widget}
1230
1242
  # show {messagebox} giving {result}}
1231
1243
  def k_show(self, command):
1232
1244
  if self.nextIsSymbol():
@@ -1240,6 +1252,10 @@ class Graphics(Handler):
1240
1252
  command['dialog'] = record['name']
1241
1253
  self.add(command)
1242
1254
  return True
1255
+ elif self.isWidget(keyword):
1256
+ command['name'] = record['name']
1257
+ self.add(command)
1258
+ return True
1243
1259
  elif keyword == 'messagebox':
1244
1260
  command['messagebox'] = record['name']
1245
1261
  self.skip('giving')
@@ -1247,10 +1263,6 @@ class Graphics(Handler):
1247
1263
  command['result'] = self.getSymbolRecord()['name']
1248
1264
  self.add(command)
1249
1265
  return True
1250
- elif self.isWidget(keyword):
1251
- command['name'] = record['name']
1252
- self.add(command)
1253
- return True
1254
1266
  return False
1255
1267
 
1256
1268
  def r_show(self, command):
@@ -1306,7 +1318,7 @@ class Graphics(Handler):
1306
1318
  else: record['result'] = dialog.value
1307
1319
  elif 'name' in command:
1308
1320
  record = self.getVariable(command['name'])
1309
- if 'widget' in record: record['widget'].show()
1321
+ if 'widget' in record: self.getWidget(record).show()
1310
1322
  return self.nextPC()
1311
1323
 
1312
1324
  # Start the graphics
@@ -1401,38 +1413,38 @@ class Graphics(Handler):
1401
1413
  symbolRecord = self.getVariable(symbolRecord['name'])
1402
1414
  keyword = symbolRecord['keyword']
1403
1415
  if keyword == 'pushbutton':
1404
- pushbutton = self.getSymbolContent(symbolRecord) # symbolRecord['widget']
1416
+ pushbutton = self.getWidget(symbolRecord)
1405
1417
  v = {}
1406
1418
  v['type'] = 'text'
1407
1419
  v['content'] = pushbutton.accessibleName()
1408
1420
  return v
1409
1421
  elif keyword == 'lineinput':
1410
- lineinput = symbolRecord['widget']
1422
+ lineinput = self.getWidget(symbolRecord)
1411
1423
  v = {}
1412
1424
  v['type'] = 'text'
1413
1425
  v['content'] = lineinput.displayText()
1414
1426
  return v
1415
1427
  elif keyword == 'multiline':
1416
- multiline = symbolRecord['widget']
1428
+ multiline = self.getWidget(symbolRecord)
1417
1429
  v = {}
1418
1430
  v['type'] = 'text'
1419
1431
  v['content'] = multiline.toPlainText()
1420
1432
  return v
1421
1433
  elif keyword == 'combobox':
1422
- combobox = symbolRecord['widget']
1434
+ combobox = self.getWidget(symbolRecord)
1423
1435
  v = {}
1424
1436
  v['type'] = 'text'
1425
1437
  v['content'] = combobox.currentText()
1426
1438
  return v
1427
1439
  elif keyword == 'listbox':
1428
- listbox = symbolRecord['widget']
1440
+ listbox = self.getWidget(symbolRecord)
1429
1441
  content = listbox.currentItem().text()
1430
1442
  v = {}
1431
1443
  v['type'] = 'text'
1432
1444
  v['content'] = content
1433
1445
  return v
1434
1446
  elif keyword == 'checkbox':
1435
- checkbox = symbolRecord['widget']
1447
+ checkbox =self.getWidget(symbolRecord)
1436
1448
  content = checkbox.isChecked()
1437
1449
  v = {}
1438
1450
  v['type'] = 'boolean'
@@ -1449,7 +1461,7 @@ class Graphics(Handler):
1449
1461
  def v_count(self, v):
1450
1462
  record = self.getVariable(v['name'])
1451
1463
  keyword = record['keyword']
1452
- widget = record['widget']
1464
+ widget = self.getWidget(record)
1453
1465
  if keyword in ['combobox', 'listbox']: content = widget.count()
1454
1466
  value = {}
1455
1467
  value['type'] = 'int'
@@ -1459,7 +1471,7 @@ class Graphics(Handler):
1459
1471
  def v_current(self, v):
1460
1472
  record = self.getVariable(v['name'])
1461
1473
  keyword = record['keyword']
1462
- widget = record['widget']
1474
+ widget = self.getWidget(record)
1463
1475
  if keyword == 'listbox': content = widget.currentItem().text()
1464
1476
  value = {}
1465
1477
  value['type'] = 'text'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes