easycoder 250724.2__py2.py3-none-any.whl → 250725.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
@@ -11,4 +11,4 @@ from .ec_pyside import *
11
11
  from .ec_timestamp import *
12
12
  from .ec_value import *
13
13
 
14
- __version__ = "250724.2"
14
+ __version__ = "250725.1"
easycoder/ec_keyboard.py CHANGED
@@ -48,10 +48,10 @@ class Keyboard(Handler):
48
48
  def mousePressEvent(self, event):
49
49
  x = self.width() - self.pixmap.width()
50
50
  y = 0
51
- icon_rect = self.pixmap.rect().translated(x, y)
52
- if icon_rect.contains(event.pos()):
51
+ iconRect = self.pixmap.rect().translated(x, y)
52
+ if iconRect.contains(event.pos()):
53
53
  self.iconClicked.emit()
54
- elif self._bar_rect().contains(event.pos()):
54
+ elif self.barRect().contains(event.pos()):
55
55
  if hasattr(self.window().windowHandle(), 'startSystemMove'):
56
56
  self.window().windowHandle().startSystemMove()
57
57
  else:
@@ -72,19 +72,19 @@ class Keyboard(Handler):
72
72
  self._drag_active = False
73
73
  super().mouseReleaseEvent(event)
74
74
 
75
- def _bar_rect(self):
75
+ def barRect(self):
76
76
  bar_width = 100
77
77
  bar_height = 20
78
78
  bar_x = (self.width() - bar_width) // 2
79
79
  bar_y = (self.height() - bar_height) // 2
80
80
  return QRect(bar_x, bar_y, bar_width, bar_height)
81
81
 
82
- def __init__(self, program, receiver, parent=None):
83
- Handler.__init__(self, program.compiler)
82
+ def __init__(self, program, receiver, caller = None, parent=None):
83
+ super().__init__(program.compiler)
84
84
 
85
85
  self.program = program
86
86
 
87
- dialog = QDialog()
87
+ dialog = QDialog(caller)
88
88
 
89
89
  # dialog.setWindowTitle('')
90
90
  dialog.setWindowFlags(Qt.FramelessWindowHint)
easycoder/ec_pyside.py CHANGED
@@ -1,7 +1,7 @@
1
1
  import sys
2
2
  from .ec_handler import Handler
3
3
  from .ec_classes import RuntimeError
4
- from .ec_keyboard import Keyboard
4
+ from .ec_keyboard import Keyboard, TextReceiver
5
5
  from PySide6.QtCore import Qt, QTimer
6
6
  from PySide6.QtGui import QPixmap
7
7
  from PySide6.QtWidgets import (
@@ -40,7 +40,7 @@ from PySide6.QtWidgets import (
40
40
  class Graphics(Handler):
41
41
 
42
42
  def __init__(self, compiler):
43
- Handler.__init__(self, compiler)
43
+ super().__init__(compiler)
44
44
  self.blocked = False
45
45
  self.runOnTick = 0
46
46
  self.vkb = False
@@ -54,6 +54,18 @@ class Graphics(Handler):
54
54
  def isWidget(self, keyword):
55
55
  return keyword in ['layout', 'groupbox', 'label', 'pushbutton', 'checkbox', 'lineinput', 'listbox', 'combobox']
56
56
 
57
+ class ECDialog(QDialog):
58
+ def __init__(self, parent, record):
59
+ super().__init__(parent)
60
+ self.record = record
61
+
62
+ def showEvent(self, event):
63
+ super().showEvent(event)
64
+ QTimer.singleShot(100, self.afterShown)
65
+
66
+ def afterShown(self):
67
+ if 'action' in self.record: self.record['action']()
68
+
57
69
  #############################################################################
58
70
  # Keyword handlers
59
71
 
@@ -471,7 +483,10 @@ class Graphics(Handler):
471
483
  return self.nextPC()
472
484
 
473
485
  def r_createDialog(self, command, record):
474
- dialog = QDialog()
486
+ win = command['window']
487
+ if win != None:
488
+ win = self.getVariable(win)['window']
489
+ dialog = self.ECDialog(win, record)
475
490
  mainLayout = QVBoxLayout(dialog)
476
491
  dialog.setWindowTitle(self.getRuntimeValue(command['title']))
477
492
  dialogType = command['type'].lower()
@@ -973,7 +988,6 @@ class Graphics(Handler):
973
988
  if dialog.dialogType == 'confirm':
974
989
  record['result'] = True if dialog.exec() == QDialog.Accepted else False
975
990
  elif dialog.dialogType == 'lineedit':
976
- if self.vkb: print('Show virtual keyboard')
977
991
  if dialog.exec() == QDialog.Accepted:
978
992
  record['result'] = dialog.lineEdit.text()
979
993
  else: record['result'] = dialog.value
@@ -1003,15 +1017,6 @@ class Graphics(Handler):
1003
1017
  self.app.lastWindowClosed.connect(on_last_window_closed)
1004
1018
  self.app.exec()
1005
1019
 
1006
- # use virtual keyboard
1007
- def k_use(self, command):
1008
- if self.nextIs('virtual'):
1009
- if self.nextIs('keyboard'):
1010
- print('Use the virtual keyboard')
1011
- self.vkb = True
1012
- return True
1013
- return False
1014
-
1015
1020
  # Declare a window variable
1016
1021
  def k_window(self, command):
1017
1022
  return self.compileVariable(command)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 250724.2
3
+ Version: 250725.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,17 +1,17 @@
1
- easycoder/__init__.py,sha256=j2BQW6jHjAJh7T5w18SvotjXXljIV-2dc9iIo-g-UsE,314
1
+ easycoder/__init__.py,sha256=i0hah_pn07mFI7wkEdfCU0OvuTQXYgB_fPv_K4KZEOg,314
2
2
  easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
3
3
  easycoder/ec_classes.py,sha256=PWPaJuTfaWD4-tgT-2WWOgeFV_jXxlxyKCxvXyylCUU,1824
4
4
  easycoder/ec_compiler.py,sha256=9byLqJZgMHAyFFyD8eGhY77oTsY1GY1aVcVrU4JAbd4,5287
5
5
  easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
6
6
  easycoder/ec_core.py,sha256=JHcxmD2xq4Fy35CVkOWJOikKO31eV22EwiRwqxg-ILs,97786
7
7
  easycoder/ec_handler.py,sha256=ohf3xUuWw_Qb5SZnulGtDhvCb11kvWtYfgbQTiOXpIY,2261
8
- easycoder/ec_keyboard.py,sha256=gxRUe4xPCkGImKC8zTlbVOJwCXtBsBKGo7ExZi4Vczc,19671
8
+ easycoder/ec_keyboard.py,sha256=ccxw7SdsL-KN91ueh_AGPWOsujfUZxPaBjvjl_TwsoI,19680
9
9
  easycoder/ec_program.py,sha256=SHg8NV9g-DclSWz8pQzgAiElreoYrI1FR1NrZS4_hIA,9968
10
- easycoder/ec_pyside.py,sha256=15-brpZnAZTkR111KYllbo7k3qbbqr4Umww_ngzhsmk,42243
10
+ easycoder/ec_pyside.py,sha256=2mqqtgyxidOb25FCLy3J6JC4WHcw_eJzzMHzeqtd3T4,42427
11
11
  easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
12
12
  easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
13
- easycoder-250724.2.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
14
- easycoder-250724.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
- easycoder-250724.2.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
16
- easycoder-250724.2.dist-info/METADATA,sha256=H4nBcI6JX0WV11O2AlNKCMM176uF86zCG0VClnR8rJ0,6897
17
- easycoder-250724.2.dist-info/RECORD,,
13
+ easycoder-250725.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
14
+ easycoder-250725.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
+ easycoder-250725.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
16
+ easycoder-250725.1.dist-info/METADATA,sha256=3ftzlFiLEWuV0DbzgMr63l69tzl0onKNdkgIwGQNNzk,6897
17
+ easycoder-250725.1.dist-info/RECORD,,