easycoder 251004.1__py2.py3-none-any.whl → 251015.1__py2.py3-none-any.whl

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/__init__.py CHANGED
@@ -12,4 +12,4 @@ from .ec_pyside import *
12
12
  from .ec_timestamp import *
13
13
  from .ec_value import *
14
14
 
15
- __version__ = "251004.1"
15
+ __version__ = "251015.1"
easycoder/ec_keyboard.py CHANGED
@@ -158,6 +158,8 @@ class KeyboardView(QVBoxLayout):
158
158
  for row in rows:
159
159
  self.addLayout(row)
160
160
 
161
+ ###############################################################################
162
+ # VirtualKeyboard Class
161
163
  class VirtualKeyboard(QStackedWidget):
162
164
  def __init__(self, keyboardType, buttonHeight, receiver, onFinished):
163
165
  super().__init__()
@@ -173,6 +175,8 @@ class VirtualKeyboard(QStackedWidget):
173
175
  self.addKeyboardLayout2()
174
176
  self.addKeyboardLayout3()
175
177
 
178
+ ###########################################################################
179
+ # Add the first keyboard layout (lowercase letters)
176
180
  def addKeyboardLayout0(self):
177
181
  rowList = []
178
182
 
@@ -214,7 +218,7 @@ class VirtualKeyboard(QStackedWidget):
214
218
  KeyboardButton(self.buttonHeight * 1.5, self.buttonHeight, self.onClickNumbers, None, 'img/numbers.png'),
215
219
  QSpacerItem(self.buttonHeight * 0.05, 0, QSizePolicy.Fixed, QSizePolicy.Minimum),
216
220
  KeyboardButton(self.buttonHeight, self.buttonHeight, self.onClickChar, ","),
217
- KeyboardButton(self.buttonHeight * 5, self.buttonHeight, self.onClickSpace, None, 'skeyboard/pace.png'),
221
+ KeyboardButton(self.buttonHeight * 5, self.buttonHeight, self.onClickSpace, None, 'keyboard/space.png'),
218
222
  KeyboardButton(self.buttonHeight, self.buttonHeight, self.onClickChar, "."),
219
223
  QSpacerItem(self.buttonHeight * 0.05, 0, QSizePolicy.Fixed, QSizePolicy.Minimum),
220
224
  KeyboardButton(self.buttonHeight * 1.5, self.buttonHeight, self.onClickEnter, None, 'img/enter.png'),
@@ -228,6 +232,8 @@ class VirtualKeyboard(QStackedWidget):
228
232
  container.setLayout(keyboardView)
229
233
  self.addWidget(container)
230
234
 
235
+ ###########################################################################
236
+ # Add the second keyboard layout (uppercase letters)
231
237
  def addKeyboardLayout1(self):
232
238
  rowList = []
233
239
 
@@ -283,6 +289,8 @@ class VirtualKeyboard(QStackedWidget):
283
289
  container.setLayout(keyboardView)
284
290
  self.addWidget(container)
285
291
 
292
+ ###########################################################################
293
+ # Add the third keyboard layout (numbers and symbols)
286
294
  def addKeyboardLayout2(self):
287
295
  rowList = []
288
296
 
@@ -320,11 +328,11 @@ class VirtualKeyboard(QStackedWidget):
320
328
  KeyboardButton(self.buttonHeight * 1.5, self.buttonHeight, self.onClickLetters, None, 'img/letters.png'),
321
329
  QSpacerItem(self.buttonHeight * 0.05, 0, QSizePolicy.Fixed, QSizePolicy.Minimum),
322
330
  KeyboardButton(self.buttonHeight, self.buttonHeight, self.onClickChar, ","),
323
- KeyboardButton(self.buttonHeight * 6, self.buttonHeight, self.onClickSpace, None, 'img/space.png'),
331
+ KeyboardButton(self.buttonHeight * 5.2, self.buttonHeight, self.onClickSpace, None, 'keyboard/space.png'),
324
332
  KeyboardButton(self.buttonHeight, self.buttonHeight, self.onClickChar, "."),
325
333
  QSpacerItem(self.buttonHeight * 0.05, 0, QSizePolicy.Fixed, QSizePolicy.Minimum),
326
334
  KeyboardButton(self.buttonHeight * 1.5, self.buttonHeight, self.onClickEnter, None, 'img/enter.png'),
327
- QSpacerItem(20, 40, QSizePolicy.Expanding, QSizePolicy.Minimum)
335
+ QSpacerItem(10, 40, QSizePolicy.Expanding, QSizePolicy.Minimum)
328
336
  ])
329
337
  rowList.append(row4)
330
338
 
@@ -334,6 +342,8 @@ class VirtualKeyboard(QStackedWidget):
334
342
  container.setLayout(keyboardView)
335
343
  self.addWidget(container)
336
344
 
345
+ ###########################################################################
346
+ # Add the fourth keyboard layout (additional symbols)
337
347
  def addKeyboardLayout3(self):
338
348
  rowList = []
339
349
 
easycoder/ec_pyside.py CHANGED
@@ -370,17 +370,18 @@ class Graphics(Handler):
370
370
  return True
371
371
 
372
372
  def k_createPushbutton(self, command):
373
- text = ''
374
373
  while True:
375
374
  token = self.peek()
376
375
  if token == 'text':
377
376
  self.nextToken()
378
- text = self.nextValue()
377
+ command['text'] = self.nextValue()
378
+ if token == 'icon':
379
+ self.nextToken()
380
+ command['icon'] = self.nextValue()
379
381
  elif token == 'size':
380
382
  self.nextToken()
381
383
  command['size'] = self.nextValue()
382
384
  else: break
383
- command['text'] = text
384
385
  self.add(command)
385
386
  return True
386
387
 
@@ -566,15 +567,29 @@ class Graphics(Handler):
566
567
  return self.nextPC()
567
568
 
568
569
  def r_createPushbutton(self, command, record):
569
- text = self.getRuntimeValue(command['text'])
570
- pushbutton = QPushButton(text)
571
- pushbutton.setAccessibleName(text)
572
570
  if 'size' in command:
573
- fm = pushbutton.fontMetrics()
574
- c = pushbutton.contentsMargins()
575
- w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
576
- pushbutton.setMaximumWidth(w)
571
+ size = self.getRuntimeValue(command['size'])
572
+ else: size = None
573
+ if 'icon' in command:
574
+ iconPath = self.getRuntimeValue(command['icon'])
575
+ pixmap = QPixmap(iconPath)
576
+ if pixmap.isNull():
577
+ RuntimeError(self.program, f'Icon not found: {iconPath}')
578
+ icon = pixmap.scaledToHeight(size if size != None else 24, Qt.SmoothTransformation)
579
+ pushbutton = QPushButton()
580
+ pushbutton.setIcon(icon)
581
+ pushbutton.setIconSize(icon.size())
582
+ elif 'text' in command:
583
+ text = self.getRuntimeValue(command['text'])
584
+ pushbutton = QPushButton(text)
585
+ pushbutton.setAccessibleName(text)
586
+ if size != None:
587
+ fm = pushbutton.fontMetrics()
588
+ c = pushbutton.contentsMargins()
589
+ w = fm.horizontalAdvance('m') * self.getRuntimeValue(command['size']) + c.left()+c.right()
590
+ pushbutton.setMaximumWidth(w)
577
591
  self.putSymbolValue(record, pushbutton)
592
+ record['widget'] = pushbutton
578
593
  return self.nextPC()
579
594
 
580
595
  def r_createCheckBox(self, command, record):
@@ -757,6 +772,21 @@ class Graphics(Handler):
757
772
  def r_group(self, command):
758
773
  return self.nextPC()
759
774
 
775
+ # hide {widget}
776
+ def k_hide(self, command):
777
+ if self.nextIsSymbol():
778
+ record = self.getSymbolRecord()
779
+ if self.isWidget(record['keyword']):
780
+ command['widget'] = record['name']
781
+ self.add(command)
782
+ return True
783
+ return False
784
+
785
+ def r_hide(self, command):
786
+ widget = self.getVariable(command['widget'])['widget']
787
+ widget.hide()
788
+ return self.nextPC()
789
+
760
790
  # Initialize the graphics environment
761
791
  def k_init(self, command):
762
792
  if self.nextIs('graphics'):
@@ -1217,6 +1247,10 @@ class Graphics(Handler):
1217
1247
  command['result'] = self.getSymbolRecord()['name']
1218
1248
  self.add(command)
1219
1249
  return True
1250
+ elif self.isWidget(keyword):
1251
+ command['name'] = record['name']
1252
+ self.add(command)
1253
+ return True
1220
1254
  return False
1221
1255
 
1222
1256
  def r_show(self, command):
@@ -1270,6 +1304,9 @@ class Graphics(Handler):
1270
1304
  if dialog.exec() == QDialog.Accepted:
1271
1305
  record['result'] = dialog.textEdit.toPlainText()
1272
1306
  else: record['result'] = dialog.value
1307
+ elif 'name' in command:
1308
+ record = self.getVariable(command['name'])
1309
+ if 'widget' in record: record['widget'].show()
1273
1310
  return self.nextPC()
1274
1311
 
1275
1312
  # Start the graphics
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 251004.1
3
+ Version: 251015.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>
@@ -1,4 +1,4 @@
1
- easycoder/__init__.py,sha256=q9lIBFHBsL7m8IFo13YFUlg_4clZurFfRFYX7kZnBCo,339
1
+ easycoder/__init__.py,sha256=UvV0rNaqW7_y06ZiWLdoAs_zsyC2HCXODR1Glc3l07A,339
2
2
  easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
3
3
  easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
4
4
  easycoder/ec_classes.py,sha256=bejrby7mLHTeAQXhhz-1l8iv6LSbNSy30lW21KJKjXE,1832
@@ -6,14 +6,14 @@ easycoder/ec_compiler.py,sha256=LYwGNs8dcHKXI_nnu1sVFe1N36vjvylcUO_tX_bLjrk,5359
6
6
  easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
7
7
  easycoder/ec_core.py,sha256=VTAnhdLp3ftZ1tLPhovKX0PQ1CplmC9x17jH_DfrJsQ,99650
8
8
  easycoder/ec_handler.py,sha256=ED08ULiOlZkcs4XHxAguvdPZw_dFXuwGDFLbFuo0kLs,2317
9
- easycoder/ec_keyboard.py,sha256=ru-HdWolBMZJPyck2s72In9tXFeLJQSPtR1TpjmIo90,18350
9
+ easycoder/ec_keyboard.py,sha256=H8DhPT8-IvAIGgRxCs4qSaF_AQLaS6lxxtDteejbktM,19010
10
10
  easycoder/ec_program.py,sha256=srVDRlELMElvnkjxmREczUVPkvPXPvanZglN4hKreLI,10324
11
- easycoder/ec_pyside.py,sha256=bnGwnlYyN-4KI4ECpocrgVx2uGO_9aDrDZNjT4AK7ak,54148
11
+ easycoder/ec_pyside.py,sha256=JTHBpQOU8UVUBZmivfjTJbvT_00dDqaWQ70rthpeBRg,55655
12
12
  easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
13
13
  easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
14
14
  easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
15
- easycoder-251004.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
16
- easycoder-251004.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
- easycoder-251004.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
18
- easycoder-251004.1.dist-info/METADATA,sha256=O3CZb_23D8wHS9r_IMN0TLjZVRg1JMgq_SgOuxU6nb8,6897
19
- easycoder-251004.1.dist-info/RECORD,,
15
+ easycoder-251015.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
16
+ easycoder-251015.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
+ easycoder-251015.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
18
+ easycoder-251015.1.dist-info/METADATA,sha256=Vwk_KyMawENpm9Jg46Q5lLBdk7gYajoYZ9rZ44MeJM4,6897
19
+ easycoder-251015.1.dist-info/RECORD,,