mwxlib 0.99.8__py3-none-any.whl → 0.99.9__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 mwxlib might be problematic. Click here for more details.
- mwx/__init__.py +1 -1
- mwx/controls.py +97 -119
- mwx/framework.py +1 -1
- mwx/matplot2.py +1 -1
- mwx/utilus.py +2 -0
- {mwxlib-0.99.8.dist-info → mwxlib-0.99.9.dist-info}/METADATA +1 -1
- {mwxlib-0.99.8.dist-info → mwxlib-0.99.9.dist-info}/RECORD +10 -10
- {mwxlib-0.99.8.dist-info → mwxlib-0.99.9.dist-info}/LICENSE +0 -0
- {mwxlib-0.99.8.dist-info → mwxlib-0.99.9.dist-info}/WHEEL +0 -0
- {mwxlib-0.99.8.dist-info → mwxlib-0.99.9.dist-info}/top_level.txt +0 -0
mwx/__init__.py
CHANGED
|
@@ -8,7 +8,7 @@ from .framework import Frame, MiniFrame, ShellFrame, deb
|
|
|
8
8
|
|
|
9
9
|
## Controls
|
|
10
10
|
from .controls import Param, LParam, Knob, ControlPanel, Clipboard, Icon
|
|
11
|
-
from .controls import Button, ToggleButton, TextCtrl, Choice, Gauge, Indicator
|
|
11
|
+
from .controls import Button, ToggleButton, ClassicButton, TextCtrl, Choice, Gauge, Indicator
|
|
12
12
|
|
|
13
13
|
## Plugman
|
|
14
14
|
## from .graphman import Frame as GraphmanFrame, Layer, Thread, Graph
|
mwx/controls.py
CHANGED
|
@@ -823,8 +823,17 @@ class Clipboard:
|
|
|
823
823
|
## --------------------------------
|
|
824
824
|
## Wx custom controls and bitmaps
|
|
825
825
|
## --------------------------------
|
|
826
|
-
|
|
827
|
-
|
|
826
|
+
|
|
827
|
+
class Icon(wx.Bitmap):
|
|
828
|
+
"""Returns an iconic bitmap with the specified size (w, h).
|
|
829
|
+
|
|
830
|
+
The key is either Icon.provided_arts or Icon.custom_images key.
|
|
831
|
+
If the key is empty it returns a transparent bitmap, otherwise NullBitmap.
|
|
832
|
+
|
|
833
|
+
Note:
|
|
834
|
+
A null (0-shaped) bitmap fails with AssertionError from 4.1.1
|
|
835
|
+
"""
|
|
836
|
+
provided_arts = {
|
|
828
837
|
'cut' : wx.ART_CUT,
|
|
829
838
|
'copy' : wx.ART_COPY,
|
|
830
839
|
'paste' : wx.ART_PASTE,
|
|
@@ -858,32 +867,69 @@ if 1:
|
|
|
858
867
|
'|<-' : wx.ART_GOTO_FIRST,
|
|
859
868
|
'->|' : wx.ART_GOTO_LAST,
|
|
860
869
|
}
|
|
861
|
-
|
|
870
|
+
custom_images = {
|
|
862
871
|
k:v for k, v in vars(images).items()
|
|
863
872
|
if isinstance(v, wx.lib.embeddedimage.PyEmbeddedImage)
|
|
864
873
|
}
|
|
865
|
-
|
|
866
|
-
class Icon(wx.Bitmap):
|
|
867
|
-
"""Returns an iconic bitmap with the specified size (w, h).
|
|
868
|
-
|
|
869
|
-
The key is either Icon.provided_arts or Icon.custom_images key.
|
|
870
|
-
If the key is empty it returns a transparent bitmap, otherwise NullBitmap.
|
|
871
|
-
|
|
872
|
-
Note:
|
|
873
|
-
A null (0-shaped) bitmap fails with AssertionError from 4.1.1
|
|
874
|
-
"""
|
|
875
|
-
provided_arts = _provided_arts
|
|
876
|
-
custom_images = _custom_images
|
|
877
874
|
|
|
878
875
|
def __init__(self, *args, **kwargs):
|
|
879
876
|
try:
|
|
880
|
-
bmp = _getBitmap1(*args, **kwargs)
|
|
877
|
+
bmp = Icon._getBitmap1(*args, **kwargs)
|
|
881
878
|
except TypeError:
|
|
882
|
-
bmp = _getBitmap2(*args, **kwargs)
|
|
879
|
+
bmp = Icon._getBitmap2(*args, **kwargs)
|
|
883
880
|
wx.Bitmap.__init__(self, bmp)
|
|
884
881
|
|
|
885
882
|
@staticmethod
|
|
886
|
-
def
|
|
883
|
+
def _getBitmap1(key, size=None):
|
|
884
|
+
if isinstance(key, wx.Bitmap):
|
|
885
|
+
if size and key.Size != size:
|
|
886
|
+
key = (key.ConvertToImage()
|
|
887
|
+
.Scale(*size, wx.IMAGE_QUALITY_NEAREST)
|
|
888
|
+
.ConvertToBitmap())
|
|
889
|
+
return key #<wx.Bitmap>
|
|
890
|
+
if not size:
|
|
891
|
+
size = (16, 16)
|
|
892
|
+
if key:
|
|
893
|
+
try:
|
|
894
|
+
art = Icon.custom_images.get(key)
|
|
895
|
+
bmp = art.GetBitmap()
|
|
896
|
+
except Exception:
|
|
897
|
+
art = Icon.provided_arts.get(key)
|
|
898
|
+
bmp = wx.ArtProvider.GetBitmap(art or key, wx.ART_OTHER, size)
|
|
899
|
+
return bmp
|
|
900
|
+
|
|
901
|
+
## Note: null (0-shaped) bitmap fails with AssertionError from 4.1.1
|
|
902
|
+
elif key == '':
|
|
903
|
+
bmp = wx.Bitmap(size)
|
|
904
|
+
with wx.MemoryDC(bmp) as dc:
|
|
905
|
+
dc.SetBackground(wx.Brush('black'))
|
|
906
|
+
dc.Clear()
|
|
907
|
+
bmp.SetMaskColour('black') # return dummy-sized blank bitmap
|
|
908
|
+
return bmp
|
|
909
|
+
|
|
910
|
+
return wx.NullBitmap # The standard wx controls accept this,
|
|
911
|
+
|
|
912
|
+
@staticmethod
|
|
913
|
+
def _getBitmap2(back, fore, size=None, subsize=3/4):
|
|
914
|
+
if not size:
|
|
915
|
+
size = (16, 16)
|
|
916
|
+
if isinstance(subsize, float):
|
|
917
|
+
subsize = wx.Size(size) * subsize
|
|
918
|
+
back = Icon._getBitmap1(back, size)
|
|
919
|
+
fore = Icon._getBitmap1(fore, subsize)
|
|
920
|
+
x = size[0] - subsize[0]
|
|
921
|
+
y = size[1] - subsize[1]
|
|
922
|
+
with wx.MemoryDC(back) as dc:
|
|
923
|
+
## dc = wx.GCDC(dc)
|
|
924
|
+
## dc.DrawBitmap(fore, x, y, useMask=True)
|
|
925
|
+
gc = wx.GraphicsContext.Create(dc)
|
|
926
|
+
gc.DrawBitmap(fore, x, y, *subsize)
|
|
927
|
+
return back
|
|
928
|
+
|
|
929
|
+
@staticmethod
|
|
930
|
+
def bullet(colour, ec=None, size=None, radius=4):
|
|
931
|
+
if not size:
|
|
932
|
+
size = (16, 16)
|
|
887
933
|
bmp = wx.Bitmap(size)
|
|
888
934
|
with wx.MemoryDC(bmp) as dc:
|
|
889
935
|
dc.SetBackground(wx.Brush('black'))
|
|
@@ -910,55 +956,24 @@ class Icon(wx.Bitmap):
|
|
|
910
956
|
return bmp
|
|
911
957
|
|
|
912
958
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
if key.Size != size:
|
|
916
|
-
key = (key.ConvertToImage()
|
|
917
|
-
.Scale(*size, wx.IMAGE_QUALITY_NEAREST)
|
|
918
|
-
.ConvertToBitmap())
|
|
919
|
-
return key
|
|
920
|
-
if key:
|
|
921
|
-
try:
|
|
922
|
-
art = _custom_images.get(key)
|
|
923
|
-
bmp = art.GetBitmap()
|
|
924
|
-
except Exception:
|
|
925
|
-
art = _provided_arts.get(key)
|
|
926
|
-
bmp = wx.ArtProvider.GetBitmap(art or key, wx.ART_OTHER, size)
|
|
927
|
-
return bmp
|
|
928
|
-
|
|
929
|
-
## Note: null (0-shaped) bitmap fails with AssertionError from 4.1.1
|
|
930
|
-
elif key == '':
|
|
931
|
-
bmp = wx.Bitmap(size)
|
|
932
|
-
with wx.MemoryDC(bmp) as dc:
|
|
933
|
-
dc.SetBackground(wx.Brush('black'))
|
|
934
|
-
dc.Clear()
|
|
935
|
-
bmp.SetMaskColour('black') # return dummy-sized blank bitmap
|
|
936
|
-
return bmp
|
|
959
|
+
class ClassicButton(wx.Button):
|
|
960
|
+
"""Flat button
|
|
937
961
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
return back
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
def _Icon(v):
|
|
957
|
-
if isinstance(v, (str, bytes)):
|
|
958
|
-
return Icon(v)
|
|
959
|
-
if isinstance(v, wx.lib.embeddedimage.PyEmbeddedImage):
|
|
960
|
-
return v.GetBitmap()
|
|
961
|
-
return v
|
|
962
|
+
Args:
|
|
963
|
+
label : button label
|
|
964
|
+
handler : event handler when the button is pressed
|
|
965
|
+
icon : key:str or bitmap for button icon
|
|
966
|
+
**kwargs: keywords for wx.lib.platebtn.PlateButton
|
|
967
|
+
"""
|
|
968
|
+
def __init__(self, parent, label='', handler=None, icon=None, **kwargs):
|
|
969
|
+
wx.Button.__init__(self, parent, -1, label, **kwargs)
|
|
970
|
+
|
|
971
|
+
if handler:
|
|
972
|
+
self.Bind(wx.EVT_BUTTON, _F(handler))
|
|
973
|
+
|
|
974
|
+
self.SetToolTip(_Tip(handler.__doc__))
|
|
975
|
+
if icon:
|
|
976
|
+
self.SetBitmap(Icon(icon))
|
|
962
977
|
|
|
963
978
|
|
|
964
979
|
class Button(pb.PlateButton):
|
|
@@ -970,17 +985,6 @@ class Button(pb.PlateButton):
|
|
|
970
985
|
icon : key:str or bitmap for button icon
|
|
971
986
|
**kwargs: keywords for wx.lib.platebtn.PlateButton
|
|
972
987
|
"""
|
|
973
|
-
@property
|
|
974
|
-
def icon(self):
|
|
975
|
-
"""Icon key:str or bitmap."""
|
|
976
|
-
return self.__icon
|
|
977
|
-
|
|
978
|
-
@icon.setter
|
|
979
|
-
def icon(self, v):
|
|
980
|
-
self.__icon = v
|
|
981
|
-
self.SetBitmap(_Icon(v))
|
|
982
|
-
self.Refresh()
|
|
983
|
-
|
|
984
988
|
def __init__(self, parent, label='', handler=None, icon=None, **kwargs):
|
|
985
989
|
kwargs.setdefault('style', pb.PB_STYLE_DEFAULT | pb.PB_STYLE_SQUARE)
|
|
986
990
|
pb.PlateButton.__init__(self, parent, -1, label, **kwargs)
|
|
@@ -988,8 +992,9 @@ class Button(pb.PlateButton):
|
|
|
988
992
|
if handler:
|
|
989
993
|
self.Bind(wx.EVT_BUTTON, _F(handler))
|
|
990
994
|
|
|
991
|
-
self.
|
|
992
|
-
|
|
995
|
+
self.SetToolTip(_Tip(handler.__doc__))
|
|
996
|
+
if icon:
|
|
997
|
+
self.SetBitmap(Icon(icon))
|
|
993
998
|
|
|
994
999
|
def SetBitmap(self, bmp):
|
|
995
1000
|
"""Set the bitmap displayed in the button.
|
|
@@ -998,7 +1003,8 @@ class Button(pb.PlateButton):
|
|
|
998
1003
|
try:
|
|
999
1004
|
pb.PlateButton.SetBitmap(self, bmp)
|
|
1000
1005
|
except Exception:
|
|
1001
|
-
self._bmp =
|
|
1006
|
+
self._bmp['enable'] = None
|
|
1007
|
+
self._bmp['disable'] = None
|
|
1002
1008
|
|
|
1003
1009
|
|
|
1004
1010
|
class ToggleButton(wx.ToggleButton):
|
|
@@ -1013,29 +1019,19 @@ class ToggleButton(wx.ToggleButton):
|
|
|
1013
1019
|
Note:
|
|
1014
1020
|
To get the status, check Value or event.GetInt or event.IsChecked.
|
|
1015
1021
|
"""
|
|
1016
|
-
@property
|
|
1017
|
-
def icon(self):
|
|
1018
|
-
"""Icon key:str or bitmap."""
|
|
1019
|
-
return self.__icon
|
|
1020
|
-
|
|
1021
|
-
@icon.setter
|
|
1022
|
-
def icon(self, v):
|
|
1023
|
-
self.__icon = v
|
|
1024
|
-
if isinstance(v, tuple):
|
|
1025
|
-
self.SetBitmap(_Icon(v[0]))
|
|
1026
|
-
self.SetBitmapPressed(_Icon(v[1]))
|
|
1027
|
-
elif v:
|
|
1028
|
-
self.SetBitmap(_Icon(v))
|
|
1029
|
-
self.Refresh()
|
|
1030
|
-
|
|
1031
1022
|
def __init__(self, parent, label='', handler=None, icon=None, **kwargs):
|
|
1032
1023
|
wx.ToggleButton.__init__(self, parent, -1, label, **kwargs)
|
|
1033
1024
|
|
|
1034
1025
|
if handler:
|
|
1035
1026
|
self.Bind(wx.EVT_TOGGLEBUTTON, _F(handler))
|
|
1036
1027
|
|
|
1037
|
-
self.
|
|
1038
|
-
|
|
1028
|
+
self.SetToolTip(_Tip(handler.__doc__))
|
|
1029
|
+
if icon:
|
|
1030
|
+
try:
|
|
1031
|
+
self.SetBitmap(Icon(icon[0]))
|
|
1032
|
+
self.SetBitmapPressed(Icon(icon[1]))
|
|
1033
|
+
except Exception:
|
|
1034
|
+
self.SetBitmap(Icon(icon))
|
|
1039
1035
|
|
|
1040
1036
|
|
|
1041
1037
|
class TextCtrl(wx.Control):
|
|
@@ -1057,15 +1053,6 @@ class TextCtrl(wx.Control):
|
|
|
1057
1053
|
|
|
1058
1054
|
value = Value #: internal use only
|
|
1059
1055
|
|
|
1060
|
-
@property
|
|
1061
|
-
def icon(self):
|
|
1062
|
-
"""Icon key:str or bitmap."""
|
|
1063
|
-
return self._btn.icon
|
|
1064
|
-
|
|
1065
|
-
@icon.setter
|
|
1066
|
-
def icon(self, v):
|
|
1067
|
-
self._btn.icon = v
|
|
1068
|
-
|
|
1069
1056
|
def __init__(self, parent, label='', handler=None, updater=None,
|
|
1070
1057
|
icon=None, readonly=False, size=(-1,-1), **kwargs):
|
|
1071
1058
|
wx.Control.__init__(self, parent, size=size, style=wx.BORDER_NONE)
|
|
@@ -1077,8 +1064,8 @@ class TextCtrl(wx.Control):
|
|
|
1077
1064
|
self._ctrl = wx.TextCtrl(self, **kwargs)
|
|
1078
1065
|
self._btn = Button(self, label, None, icon,
|
|
1079
1066
|
size=(-1,-1) if label or icon else (0,0))
|
|
1080
|
-
self._ctrl.
|
|
1081
|
-
self._btn.
|
|
1067
|
+
self._ctrl.SetToolTip(_Tip(handler.__doc__))
|
|
1068
|
+
self._btn.SetToolTip(_Tip(updater.__doc__))
|
|
1082
1069
|
|
|
1083
1070
|
self.SetSizer(
|
|
1084
1071
|
pack(self, (
|
|
@@ -1134,15 +1121,6 @@ class Choice(wx.Control):
|
|
|
1134
1121
|
lambda self,v: self._ctrl.SetItems(v),
|
|
1135
1122
|
doc="combobox items:list")
|
|
1136
1123
|
|
|
1137
|
-
@property
|
|
1138
|
-
def icon(self):
|
|
1139
|
-
"""Icon key:str or bitmap."""
|
|
1140
|
-
return self._btn.icon
|
|
1141
|
-
|
|
1142
|
-
@icon.setter
|
|
1143
|
-
def icon(self, v):
|
|
1144
|
-
self._btn.icon = v
|
|
1145
|
-
|
|
1146
1124
|
def __init__(self, parent, label='', handler=None, updater=None,
|
|
1147
1125
|
icon=None, readonly=False, size=(-1,-1), **kwargs):
|
|
1148
1126
|
wx.Control.__init__(self, parent, size=size, style=wx.BORDER_NONE)
|
|
@@ -1154,8 +1132,8 @@ class Choice(wx.Control):
|
|
|
1154
1132
|
self._ctrl = wx.ComboBox(self, **kwargs)
|
|
1155
1133
|
self._btn = Button(self, label, None, icon,
|
|
1156
1134
|
size=(-1,-1) if label or icon else (0,0))
|
|
1157
|
-
self._ctrl.
|
|
1158
|
-
self._btn.
|
|
1135
|
+
self._ctrl.SetToolTip(_Tip(handler.__doc__))
|
|
1136
|
+
self._btn.SetToolTip(_Tip(updater.__doc__))
|
|
1159
1137
|
|
|
1160
1138
|
self.SetSizer(
|
|
1161
1139
|
pack(self, (
|
mwx/framework.py
CHANGED
mwx/matplot2.py
CHANGED
|
@@ -387,7 +387,7 @@ class MatplotPanel(wx.Panel):
|
|
|
387
387
|
def on_modeline_tip(self, evt): #<wx._core.MouseEvent>
|
|
388
388
|
flag = self.modeline.HitTest(evt.Position)
|
|
389
389
|
if flag == wx.HT_WINDOW_INSIDE:
|
|
390
|
-
self.modeline.
|
|
390
|
+
self.modeline.SetToolTip(self.modeline.Label)
|
|
391
391
|
evt.Skip()
|
|
392
392
|
|
|
393
393
|
def on_focus_set(self, evt): #<wx._core.FocusEvent>
|
mwx/utilus.py
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
mwx/__init__.py,sha256=
|
|
1
|
+
mwx/__init__.py,sha256=psabnAMei5VzB2TsB2qBNLrIZMX0LiqjlXCpNGmDejk,668
|
|
2
2
|
mwx/bookshelf.py,sha256=so-xSLq08sMlJBErTxOaDoKUAMa_g1CkIP2pNnff68c,5607
|
|
3
|
-
mwx/controls.py,sha256=
|
|
4
|
-
mwx/framework.py,sha256=
|
|
3
|
+
mwx/controls.py,sha256=LZqee9K8uPxs-Iqcp1zMMNBjFpGPrHbcMaIBuBOL7oo,47647
|
|
4
|
+
mwx/framework.py,sha256=nJ22_22Hk2U8xSbHOszluJdSMDwYsw6XjI3lOiprcJc,75501
|
|
5
5
|
mwx/graphman.py,sha256=qX5aHEw4u9iGR8lNpZkXDnGPVMhyAH6NnBapiaUbKZw,70265
|
|
6
6
|
mwx/images.py,sha256=_-Eh3xF7Khu42ivkYp97NXIzSNGbjcidqtWjZQFGtqE,47827
|
|
7
|
-
mwx/matplot2.py,sha256=
|
|
7
|
+
mwx/matplot2.py,sha256=zA56jIdRUdzu-wrmPai1PSOjzqV2Erqw2yFKW-jwdA8,32901
|
|
8
8
|
mwx/matplot2g.py,sha256=gCXa8X1MEMP7n_mG73h3SkWKuNZOfjVKUTWNRXXK11c,64310
|
|
9
9
|
mwx/matplot2lg.py,sha256=JRWjWnLJUytbSq6wxs4P0gbVUr3xoLSF6Wwqd5V_pJI,27404
|
|
10
10
|
mwx/mgplt.py,sha256=M5rt-H7Uq1OHnlFvMA4a3945UBvppbR9L_mw8NL_YZ0,5602
|
|
11
11
|
mwx/nutshell.py,sha256=zJULq1K8WiOBUncMpXE8HbunqUULa9MUt0hBET5jmgs,141810
|
|
12
|
-
mwx/utilus.py,sha256=
|
|
12
|
+
mwx/utilus.py,sha256=Yyw8L1f-ikhyd7wtFXYtsOswofWxmB4GAmLOZnhUXeU,37388
|
|
13
13
|
mwx/wxmon.py,sha256=yzWqrbY6LzpfRwQeytYUeqFhFuLVm_XEvrVAL_k0HBQ,12756
|
|
14
14
|
mwx/wxpdb.py,sha256=lLowkkAgMhPFHAfklD7wZHq0qbSMjRxnBFtSajmVgME,19133
|
|
15
15
|
mwx/wxwil.py,sha256=hhyB1lPrF9ixeObxCOKQv0Theu-B-kpJg_yVU3EGSNg,5406
|
|
@@ -21,8 +21,8 @@ mwx/plugins/frame_listview.py,sha256=yEYPCdLHLSMTJwTv6iYAh3Lo4lJvYfp5BxTLP3FhW9Y
|
|
|
21
21
|
mwx/plugins/line_profile.py,sha256=--9NIc3x5EfRB3L59JvD7rzENQHyiYfu7wWJo6AuMkA,820
|
|
22
22
|
mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
|
|
23
23
|
mwx/py/filling.py,sha256=fumUG1F5M9TL-Dfqni4G85uk7TmvnUunTbdcPDV0vfo,16857
|
|
24
|
-
mwxlib-0.99.
|
|
25
|
-
mwxlib-0.99.
|
|
26
|
-
mwxlib-0.99.
|
|
27
|
-
mwxlib-0.99.
|
|
28
|
-
mwxlib-0.99.
|
|
24
|
+
mwxlib-0.99.9.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
25
|
+
mwxlib-0.99.9.dist-info/METADATA,sha256=1-yAjrG-AehfMfbbEyPN3eMtrGErVkNft7OHtTkwSU0,7411
|
|
26
|
+
mwxlib-0.99.9.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
27
|
+
mwxlib-0.99.9.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
28
|
+
mwxlib-0.99.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|