qpuiq 0.10__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 qpuiq might be problematic. Click here for more details.
- PUI/PySide6/__init__.py +49 -0
- PUI/PySide6/application.py +58 -0
- PUI/PySide6/base.py +222 -0
- PUI/PySide6/button.py +21 -0
- PUI/PySide6/canvas.py +288 -0
- PUI/PySide6/checkbox.py +32 -0
- PUI/PySide6/combobox.py +75 -0
- PUI/PySide6/dialog.py +72 -0
- PUI/PySide6/divider.py +23 -0
- PUI/PySide6/image.py +30 -0
- PUI/PySide6/label.py +33 -0
- PUI/PySide6/layout.py +72 -0
- PUI/PySide6/matplotlib.py +23 -0
- PUI/PySide6/mdi.py +33 -0
- PUI/PySide6/menu.py +85 -0
- PUI/PySide6/modal.py +132 -0
- PUI/PySide6/progressbar.py +17 -0
- PUI/PySide6/radiobutton.py +29 -0
- PUI/PySide6/scroll.py +153 -0
- PUI/PySide6/splitter.py +25 -0
- PUI/PySide6/tab.py +39 -0
- PUI/PySide6/table.py +89 -0
- PUI/PySide6/text.py +35 -0
- PUI/PySide6/textfield.py +62 -0
- PUI/PySide6/toolbar.py +57 -0
- PUI/PySide6/tree.py +120 -0
- PUI/PySide6/window.py +81 -0
- PUI/__init__.py +46 -0
- PUI/common.py +20 -0
- PUI/decorator.py +20 -0
- PUI/dom.py +238 -0
- PUI/flet/__init__.py +21 -0
- PUI/flet/application.py +42 -0
- PUI/flet/base.py +37 -0
- PUI/flet/button.py +20 -0
- PUI/flet/canvas.py +86 -0
- PUI/flet/checkbox.py +23 -0
- PUI/flet/label.py +27 -0
- PUI/flet/layout.py +50 -0
- PUI/flet/progressbar.py +21 -0
- PUI/flet/radiobutton.py +27 -0
- PUI/flet/scroll.py +83 -0
- PUI/flet/tab.py +42 -0
- PUI/flet/text.py +55 -0
- PUI/flet/textfield.py +58 -0
- PUI/flet/window.py +25 -0
- PUI/interfaces.py +97 -0
- PUI/node.py +407 -0
- PUI/state.py +698 -0
- PUI/textual/__init__.py +34 -0
- PUI/textual/application.py +82 -0
- PUI/textual/base.py +113 -0
- PUI/textual/button.py +17 -0
- PUI/textual/checkbox.py +21 -0
- PUI/textual/label.py +36 -0
- PUI/textual/layout.py +48 -0
- PUI/textual/progressbar.py +17 -0
- PUI/textual/radiobutton.py +24 -0
- PUI/textual/scroll.py +72 -0
- PUI/textual/tab.py +75 -0
- PUI/textual/text.py +32 -0
- PUI/textual/textfield.py +49 -0
- PUI/textual/window.py +7 -0
- PUI/timeline.py +36 -0
- PUI/tkinter/__init__.py +43 -0
- PUI/tkinter/application.py +49 -0
- PUI/tkinter/base.py +68 -0
- PUI/tkinter/button.py +15 -0
- PUI/tkinter/canvas.py +49 -0
- PUI/tkinter/checkbox.py +27 -0
- PUI/tkinter/label.py +17 -0
- PUI/tkinter/layout.py +114 -0
- PUI/tkinter/progressbar.py +17 -0
- PUI/tkinter/radiobutton.py +26 -0
- PUI/tkinter/scroll.py +201 -0
- PUI/tkinter/tab.py +52 -0
- PUI/tkinter/text.py +20 -0
- PUI/tkinter/textfield.py +53 -0
- PUI/tkinter/window.py +51 -0
- PUI/utils.py +15 -0
- PUI/view.py +161 -0
- PUI/wx/__init__.py +19 -0
- PUI/wx/application.py +44 -0
- PUI/wx/base.py +202 -0
- PUI/wx/button.py +16 -0
- PUI/wx/canvas.py +255 -0
- PUI/wx/checkbox.py +25 -0
- PUI/wx/combobox.py +72 -0
- PUI/wx/dialog.py +66 -0
- PUI/wx/divider.py +19 -0
- PUI/wx/label.py +18 -0
- PUI/wx/layout.py +46 -0
- PUI/wx/progressbar.py +17 -0
- PUI/wx/radiobutton.py +27 -0
- PUI/wx/scroll.py +44 -0
- PUI/wx/text.py +23 -0
- PUI/wx/textfield.py +56 -0
- PUI/wx/window.py +58 -0
- qpuiq-0.10.dist-info/LICENSE.txt +21 -0
- qpuiq-0.10.dist-info/METADATA +227 -0
- qpuiq-0.10.dist-info/RECORD +103 -0
- qpuiq-0.10.dist-info/WHEEL +5 -0
- qpuiq-0.10.dist-info/top_level.txt +1 -0
PUI/flet/scroll.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from .. import *
|
|
2
|
+
from .base import *
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
class Scroll(FBase):
|
|
6
|
+
END = -0.0
|
|
7
|
+
|
|
8
|
+
def __init__(self, vertical=None, horizontal=False):
|
|
9
|
+
self.vertical = vertical
|
|
10
|
+
self.horizontal = horizontal
|
|
11
|
+
self.align_x = 0
|
|
12
|
+
self.align_y = 0
|
|
13
|
+
self.widget = None
|
|
14
|
+
super().__init__()
|
|
15
|
+
self.layout_weight = 1
|
|
16
|
+
|
|
17
|
+
def update(self, prev):
|
|
18
|
+
if prev and hasattr(prev, "hframe"):
|
|
19
|
+
self.vframe = prev.vframe
|
|
20
|
+
self.hframe = prev.hframe
|
|
21
|
+
else:
|
|
22
|
+
self.vframe = ft.Column() # outer
|
|
23
|
+
self.hframe = ft.Row() # inner
|
|
24
|
+
self.vframe.controls.append(self.hframe)
|
|
25
|
+
self.vframe.expand = self.layout_weight
|
|
26
|
+
if self.vertical is None:
|
|
27
|
+
self.vframe.scroll = ft.ScrollMode.AUTO
|
|
28
|
+
elif self.vertical:
|
|
29
|
+
self.vframe.scroll = ft.ScrollMode.ADAPTIVE
|
|
30
|
+
else:
|
|
31
|
+
self.vframe.scroll = None
|
|
32
|
+
if self.horizontal is None:
|
|
33
|
+
self.hframe.scroll = ft.ScrollMode.AUTO
|
|
34
|
+
elif self.horizontal:
|
|
35
|
+
self.hframe.scroll = ft.ScrollMode.ADAPTIVE
|
|
36
|
+
else:
|
|
37
|
+
self.hframe.scroll = None
|
|
38
|
+
try:
|
|
39
|
+
self.vframe.update()
|
|
40
|
+
except:
|
|
41
|
+
pass
|
|
42
|
+
super().update(prev)
|
|
43
|
+
|
|
44
|
+
def addChild(self, idx, child):
|
|
45
|
+
if idx != 0:
|
|
46
|
+
return
|
|
47
|
+
self.hframe.controls.insert(idx, child.outer)
|
|
48
|
+
try:
|
|
49
|
+
self.hframe.update()
|
|
50
|
+
except:
|
|
51
|
+
pass
|
|
52
|
+
|
|
53
|
+
def removeChild(self, idx, child):
|
|
54
|
+
if idx != 0:
|
|
55
|
+
return
|
|
56
|
+
self.hframe.controls.pop(idx)
|
|
57
|
+
self.hframe.update()
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def outer(self):
|
|
61
|
+
return self.vframe
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def inner(self):
|
|
65
|
+
return self.hframe
|
|
66
|
+
|
|
67
|
+
def scrollX(self, pos=0):
|
|
68
|
+
if math.copysign(1, pos) >= 0:
|
|
69
|
+
self.align_x = 0
|
|
70
|
+
self.hsb_offset = pos
|
|
71
|
+
else:
|
|
72
|
+
self.align_x = 1
|
|
73
|
+
self.hsb_offset = abs(pos)
|
|
74
|
+
return self
|
|
75
|
+
|
|
76
|
+
def scrollY(self, pos=0):
|
|
77
|
+
if math.copysign(1, pos) >= 0:
|
|
78
|
+
self.align_y = 0
|
|
79
|
+
self.vsb_offset = pos
|
|
80
|
+
else:
|
|
81
|
+
self.align_y = 1
|
|
82
|
+
self.vsb_offset = abs(pos)
|
|
83
|
+
return self
|
PUI/flet/tab.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from .. import *
|
|
2
|
+
from .base import *
|
|
3
|
+
|
|
4
|
+
class Tabs(FBase):
|
|
5
|
+
NORTH = "n"
|
|
6
|
+
SOUTH = "s"
|
|
7
|
+
EAST = "e"
|
|
8
|
+
WEST = "w"
|
|
9
|
+
pui_terminal = False
|
|
10
|
+
def __init__(self, tabposition=NORTH):
|
|
11
|
+
super().__init__()
|
|
12
|
+
self.tabposition = tabposition
|
|
13
|
+
|
|
14
|
+
def update(self, prev):
|
|
15
|
+
if prev and prev.ui:
|
|
16
|
+
self.ui = prev.ui
|
|
17
|
+
else:
|
|
18
|
+
self.ui = ft.Tabs(tabs=[], expand=1)
|
|
19
|
+
super().update(prev)
|
|
20
|
+
|
|
21
|
+
def addChild(self, idx, child):
|
|
22
|
+
tab = ft.Tab(text=child.parent.label, content=child.outer)
|
|
23
|
+
self.ui.tabs.insert(idx, tab)
|
|
24
|
+
|
|
25
|
+
def removeChild(self, idx, child):
|
|
26
|
+
self.ui.tabs.pop(idx)
|
|
27
|
+
|
|
28
|
+
def postSync(self):
|
|
29
|
+
for i,c in enumerate(self.children):
|
|
30
|
+
self.ui.tabs[i].text = c.label
|
|
31
|
+
try:
|
|
32
|
+
self.ui.update()
|
|
33
|
+
except:
|
|
34
|
+
pass
|
|
35
|
+
return super().postSync()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class Tab(PUINode):
|
|
39
|
+
pui_virtual = True
|
|
40
|
+
def __init__(self, label):
|
|
41
|
+
super().__init__()
|
|
42
|
+
self.label = label
|
PUI/flet/text.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from .. import *
|
|
2
|
+
from .base import *
|
|
3
|
+
|
|
4
|
+
class Text(FBase):
|
|
5
|
+
def __init__(self, text, selectable=False):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.text = text
|
|
8
|
+
|
|
9
|
+
def update(self, prev):
|
|
10
|
+
if prev and prev.ui:
|
|
11
|
+
self.ui = prev.ui
|
|
12
|
+
self.ui.value = self.text
|
|
13
|
+
try:
|
|
14
|
+
self.ui.update()
|
|
15
|
+
except:
|
|
16
|
+
pass
|
|
17
|
+
else:
|
|
18
|
+
self.ui = ft.Text(self.text, expand=self.layout_weight)
|
|
19
|
+
super().update(prev)
|
|
20
|
+
|
|
21
|
+
class Html(FBase):
|
|
22
|
+
pui_supported = False
|
|
23
|
+
def __init__(self, text, **kwargs):
|
|
24
|
+
super().__init__(**kwargs)
|
|
25
|
+
self.text = text
|
|
26
|
+
|
|
27
|
+
def update(self, prev):
|
|
28
|
+
if prev and prev.ui:
|
|
29
|
+
self.ui = prev.ui
|
|
30
|
+
self.ui.value = self.text
|
|
31
|
+
try:
|
|
32
|
+
self.ui.update()
|
|
33
|
+
except:
|
|
34
|
+
pass
|
|
35
|
+
else:
|
|
36
|
+
self.ui = ft.Text(self.text, expand=self.layout_weight)
|
|
37
|
+
super().update(prev)
|
|
38
|
+
|
|
39
|
+
class MarkDown(FBase):
|
|
40
|
+
pui_supported = False
|
|
41
|
+
def __init__(self, text, **kwargs):
|
|
42
|
+
super().__init__(**kwargs)
|
|
43
|
+
self.text = text
|
|
44
|
+
|
|
45
|
+
def update(self, prev):
|
|
46
|
+
if prev and prev.ui:
|
|
47
|
+
self.ui = prev.ui
|
|
48
|
+
self.ui.value = self.text
|
|
49
|
+
try:
|
|
50
|
+
self.ui.update()
|
|
51
|
+
except:
|
|
52
|
+
pass
|
|
53
|
+
else:
|
|
54
|
+
self.ui = ft.Markdown(self.text, expand=self.layout_weight, auto_follow_links=True)
|
|
55
|
+
super().update(prev)
|
PUI/flet/textfield.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from .. import *
|
|
2
|
+
from .base import *
|
|
3
|
+
|
|
4
|
+
class TextField(FBase):
|
|
5
|
+
def __init__(self, model, edit_model=None, label="", **kwargs):
|
|
6
|
+
super().__init__(**kwargs)
|
|
7
|
+
self.model = model
|
|
8
|
+
self.label = label
|
|
9
|
+
self.edit_model = edit_model
|
|
10
|
+
self.editing = False
|
|
11
|
+
|
|
12
|
+
def update(self, prev):
|
|
13
|
+
model_value = str(self.model.value)
|
|
14
|
+
if prev and prev.ui:
|
|
15
|
+
self.editing = prev.editing
|
|
16
|
+
self.ui = prev.ui
|
|
17
|
+
self.curr_value = prev.curr_value
|
|
18
|
+
if self.curr_value.set(model_value):
|
|
19
|
+
self.ui.value = model_value
|
|
20
|
+
try:
|
|
21
|
+
self.ui.update()
|
|
22
|
+
except:
|
|
23
|
+
pass
|
|
24
|
+
else:
|
|
25
|
+
self.curr_value = Prop(model_value)
|
|
26
|
+
self.ui = ft.TextField(label=self.label, value=model_value, on_change=self.on_textbox_changed, on_blur=self.on_blur, on_submit=self.on_submit, expand=self.layout_weight)
|
|
27
|
+
|
|
28
|
+
if self.edit_model and not self.editing:
|
|
29
|
+
self.edit_model.value = model_value
|
|
30
|
+
|
|
31
|
+
super().update(prev)
|
|
32
|
+
|
|
33
|
+
def on_textbox_changed(self, e):
|
|
34
|
+
node = self.get_node()
|
|
35
|
+
node.editing = True
|
|
36
|
+
value = e.control.value
|
|
37
|
+
if node.edit_model:
|
|
38
|
+
node.edit_model.value = value
|
|
39
|
+
e = PUIEvent()
|
|
40
|
+
e.value = value
|
|
41
|
+
self._input(e)
|
|
42
|
+
|
|
43
|
+
def on_change(self, e):
|
|
44
|
+
node = self.get_node()
|
|
45
|
+
node.editing = False
|
|
46
|
+
value = e.control.value
|
|
47
|
+
node.model.value = value
|
|
48
|
+
if node.edit_model:
|
|
49
|
+
node.edit_model.value = value
|
|
50
|
+
e = PUIEvent()
|
|
51
|
+
e.value = value
|
|
52
|
+
self._change(e)
|
|
53
|
+
|
|
54
|
+
def on_blur(self, e):
|
|
55
|
+
self.on_change(e)
|
|
56
|
+
|
|
57
|
+
def on_submit(self, e):
|
|
58
|
+
self.on_change(e)
|
PUI/flet/window.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from .. import *
|
|
2
|
+
from .base import *
|
|
3
|
+
|
|
4
|
+
class Window(FBase):
|
|
5
|
+
def __init__(self, title=None, size=None, maximize=None, fullscreen=None):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.title = title
|
|
8
|
+
self.size = size
|
|
9
|
+
self.maximize = maximize
|
|
10
|
+
self.fullscreen = fullscreen
|
|
11
|
+
self.child_weight = 1
|
|
12
|
+
|
|
13
|
+
def update(self, prev=None):
|
|
14
|
+
self.inner.title = self.title
|
|
15
|
+
super().update(prev)
|
|
16
|
+
|
|
17
|
+
def addChild(self, idx, child):
|
|
18
|
+
if idx != 0:
|
|
19
|
+
return
|
|
20
|
+
self.inner.add(child.outer)
|
|
21
|
+
|
|
22
|
+
def removeChild(self, idx, child):
|
|
23
|
+
if idx != 0:
|
|
24
|
+
return
|
|
25
|
+
self.inner.remove(child.outer)
|
PUI/interfaces.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
class BaseTableAdapter():
|
|
2
|
+
def data(self, row, col):
|
|
3
|
+
"""
|
|
4
|
+
Return cell content
|
|
5
|
+
"""
|
|
6
|
+
raise NotImplementedError("data() must be implemented")
|
|
7
|
+
|
|
8
|
+
def editData(self, row, col):
|
|
9
|
+
"""
|
|
10
|
+
Return data to be edited
|
|
11
|
+
"""
|
|
12
|
+
return self.data(row, col)
|
|
13
|
+
|
|
14
|
+
def setData(self, row, col, value):
|
|
15
|
+
"""
|
|
16
|
+
Accepts the edited value
|
|
17
|
+
"""
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
def editable(self, row, col):
|
|
21
|
+
"""
|
|
22
|
+
Return whether the cell is editable
|
|
23
|
+
"""
|
|
24
|
+
return False
|
|
25
|
+
|
|
26
|
+
def columnHeader(self, col):
|
|
27
|
+
"""
|
|
28
|
+
Return column header, set to None to hide column header
|
|
29
|
+
"""
|
|
30
|
+
return f"Col {col}"
|
|
31
|
+
|
|
32
|
+
def rowHeader(self, row):
|
|
33
|
+
"""
|
|
34
|
+
Return row header, set to None to hide row header
|
|
35
|
+
"""
|
|
36
|
+
return f"Row {row}"
|
|
37
|
+
|
|
38
|
+
def rowCount(self):
|
|
39
|
+
"""
|
|
40
|
+
Return number of rows
|
|
41
|
+
"""
|
|
42
|
+
raise NotImplementedError("rowCount() must be implemented")
|
|
43
|
+
|
|
44
|
+
def columnCount(self):
|
|
45
|
+
"""
|
|
46
|
+
Return number of columns
|
|
47
|
+
"""
|
|
48
|
+
raise NotImplementedError("columnCount() must be implemented")
|
|
49
|
+
|
|
50
|
+
class BaseTreeAdapter():
|
|
51
|
+
def parent(self, node):
|
|
52
|
+
"""
|
|
53
|
+
Return parent node
|
|
54
|
+
"""
|
|
55
|
+
raise NotImplementedError("parent() must be implemented")
|
|
56
|
+
|
|
57
|
+
def child(self, parent, index):
|
|
58
|
+
"""
|
|
59
|
+
Return child node
|
|
60
|
+
"""
|
|
61
|
+
raise NotImplementedError("child() must be implemented")
|
|
62
|
+
|
|
63
|
+
def data(self, node):
|
|
64
|
+
"""
|
|
65
|
+
Return node data
|
|
66
|
+
"""
|
|
67
|
+
raise NotImplementedError("data() must be implemented")
|
|
68
|
+
|
|
69
|
+
def rowCount(self, parent):
|
|
70
|
+
"""
|
|
71
|
+
Return number of rows
|
|
72
|
+
"""
|
|
73
|
+
raise NotImplementedError("rowCount() must be implemented")
|
|
74
|
+
|
|
75
|
+
def clicked(self, node):
|
|
76
|
+
"""
|
|
77
|
+
Called when a node is clicked
|
|
78
|
+
"""
|
|
79
|
+
pass
|
|
80
|
+
|
|
81
|
+
def dblclicked(self, node):
|
|
82
|
+
"""
|
|
83
|
+
Called when a node is double clicked
|
|
84
|
+
"""
|
|
85
|
+
pass
|
|
86
|
+
|
|
87
|
+
def expanded(self, node):
|
|
88
|
+
"""
|
|
89
|
+
Called when a node is expanded
|
|
90
|
+
"""
|
|
91
|
+
pass
|
|
92
|
+
|
|
93
|
+
def collapsed(self, node):
|
|
94
|
+
"""
|
|
95
|
+
Called when a node is collapsed
|
|
96
|
+
"""
|
|
97
|
+
pass
|