mwxlib 0.95.5__py3-none-any.whl → 0.95.7__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/controls.py CHANGED
@@ -897,16 +897,14 @@ class Icon(wx.Bitmap):
897
897
  wx.Bitmap.__init__(self, bmp)
898
898
 
899
899
  @staticmethod
900
- def bullet(colour, ec=None, size=None, radius=4):
901
- if not size:
902
- size = (16,16)
900
+ def bullet(colour, ec=None, size=(16,16), radius=4):
903
901
  bmp = wx.Bitmap(size)
904
902
  with wx.MemoryDC(bmp) as dc:
905
903
  dc.SetBackground(wx.Brush('black'))
906
904
  dc.Clear()
907
905
  dc.SetPen(wx.Pen(ec, style=wx.PENSTYLE_SOLID))
908
906
  dc.SetBrush(wx.Brush(colour, style=wx.BRUSHSTYLE_SOLID))
909
- dc.DrawCircle(size[0]//2, size[0]//2, radius)
907
+ dc.DrawCircle(size[0]//2, size[1]//2, radius)
910
908
  bmp.SetMaskColour('black')
911
909
  return bmp
912
910
 
@@ -928,24 +926,25 @@ class Icon(wx.Bitmap):
928
926
  Icon2 = Icon # for backward compatibility
929
927
 
930
928
 
931
- def _getBitmap1(key, size=None):
929
+ def _getBitmap1(key, size=(16,16)):
930
+ if isinstance(key, wx.Bitmap):
931
+ if key.Size != size:
932
+ key = (key.ConvertToImage()
933
+ .Scale(*size, wx.IMAGE_QUALITY_NEAREST)
934
+ .ConvertToBitmap())
935
+ return key
932
936
  if key:
933
937
  try:
934
- art = _custom_images.get(key) # None => AttributeError
935
- if not size:
936
- bmp = art.GetBitmap()
937
- else:
938
- bmp = (art.GetImage()
939
- .Scale(*size, wx.IMAGE_QUALITY_NEAREST)
940
- .ConvertToBitmap())
938
+ art = _custom_images.get(key)
939
+ bmp = art.GetBitmap()
941
940
  except Exception:
942
- art = _provided_arts.get(key) or key
943
- bmp = wx.ArtProvider.GetBitmap(art, wx.ART_OTHER, size or (16,16))
941
+ art = _provided_arts.get(key)
942
+ bmp = wx.ArtProvider.GetBitmap(art or key, wx.ART_OTHER, size)
944
943
  return bmp
945
944
 
946
945
  ## Note: null (0-shaped) bitmap fails with AssertionError from 4.1.1
947
946
  elif key == '':
948
- bmp = wx.Bitmap(size or (16,16))
947
+ bmp = wx.Bitmap(size)
949
948
  with wx.MemoryDC(bmp) as dc:
950
949
  dc.SetBackground(wx.Brush('black'))
951
950
  dc.Clear()
@@ -955,9 +954,7 @@ def _getBitmap1(key, size=None):
955
954
  return wx.NullBitmap # The standard wx controls accept this,
956
955
 
957
956
 
958
- def _getBitmap2(back, fore, size=None, subsize=3/4):
959
- if not size:
960
- size = (16,16)
957
+ def _getBitmap2(back, fore, size=(16,16), subsize=3/4):
961
958
  if isinstance(subsize, float):
962
959
  subsize = wx.Size(size) * subsize
963
960
  back = _getBitmap1(back, size)
@@ -965,7 +962,10 @@ def _getBitmap2(back, fore, size=None, subsize=3/4):
965
962
  x = size[0] - subsize[0]
966
963
  y = size[1] - subsize[1]
967
964
  with wx.MemoryDC(back) as dc:
968
- dc.DrawBitmap(fore, x, y, useMask=True)
965
+ ## dc = wx.GCDC(dc)
966
+ ## dc.DrawBitmap(fore, x, y, useMask=True)
967
+ gc = wx.GraphicsContext.Create(dc)
968
+ gc.DrawBitmap(fore, x, y, *subsize)
969
969
  return back
970
970
 
971
971
 
mwx/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "0.95.5"
4
+ __version__ = "0.95.7"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from functools import wraps, partial
mwx/matplot2.py CHANGED
@@ -152,8 +152,8 @@ class MatplotPanel(wx.Panel):
152
152
  'canvas_draw' : [ None, self.OnDraw ], # before canvas.draw
153
153
  #'canvas_drawn' : [ None, ], # after canvas.draw
154
154
  #'canvas_resized' : [ None, ],
155
- 'focus_set' : [ None, self.on_focus_set, self.escape ],
156
- 'focus_kill' : [ None, self.on_focus_kill, self.escape ],
155
+ 'focus_set' : [ None, self.on_focus_set ],
156
+ 'focus_kill' : [ None, self.on_focus_kill ],
157
157
  'figure_enter' : [ None, self.on_figure_enter ],
158
158
  'figure_leave' : [ None, self.on_figure_leave ],
159
159
  'axes_enter' : [ None, ],
mwx/matplot2g.py CHANGED
@@ -888,6 +888,7 @@ class GraphPlot(MatplotPanel):
888
888
  MatplotPanel.on_focus_set(self, evt)
889
889
  if self.frame:
890
890
  self.handler('frame_selected', self.frame)
891
+ self.on_picker_unlock(evt)
891
892
  self.trace_point(*self.Selector)
892
893
 
893
894
  def on_focus_kill(self, evt):
@@ -895,6 +896,7 @@ class GraphPlot(MatplotPanel):
895
896
  MatplotPanel.on_focus_kill(self, evt)
896
897
  if self.frame:
897
898
  self.handler('frame_deselected', self.frame)
899
+ self.on_picker_lock(evt)
898
900
 
899
901
  def get_cmap(self):
900
902
  if self.frame:
mwx/nutshell.py CHANGED
@@ -539,6 +539,7 @@ class EditorInterface(CtrlInterface):
539
539
  lsty = self.get_style(p-1)
540
540
  rsty = self.get_style(p)
541
541
  if lsty == rsty == 'moji': # inside string
542
+ ## styles = {'moji'}
542
543
  return ''
543
544
  elif lsty == 'suji' or rsty == 'suji':
544
545
  styles = {'suji'}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.95.5
3
+ Version: 0.95.7
4
4
  Summary: A wrapper of matplotlib and wxPython (phoenix)
5
5
  Home-page: https://github.com/komoto48g/mwxlib
6
6
  Author: Kazuya O'moto
@@ -1,14 +1,14 @@
1
1
  mwx/__init__.py,sha256=SNSLQc0IGuE6LDT5mzaAxXRgcH_k6cRVS3gXzFQqdZM,814
2
2
  mwx/bookshelf.py,sha256=DAhMQk3_J4rdE50adBMFu5wNz3WdMh_zzJ37O9ncceo,5103
3
- mwx/controls.py,sha256=mNSDNuIB6BPZxgd2lZXHBFQz7QaIBLy6bZSrD4dp0LI,48161
4
- mwx/framework.py,sha256=ygT0sB2hCEDB4ObmJCBYka7pWJrGpINmJ3zqopyleWk,75669
3
+ mwx/controls.py,sha256=ejttyU7pC50tr71cOWQj9ImN_AMeTKtQWozPD8pLwhE,48183
4
+ mwx/framework.py,sha256=EUEdJLA7YyYxGKEu5mMioiJj4iUnsZ4i5dC2WnIvvac,75669
5
5
  mwx/graphman.py,sha256=OMO2HQGfeCCGON8MwabmhLYsA-YHKueKaepsJkTDP0c,70489
6
6
  mwx/images.py,sha256=gyvqW4TLWdJMKmsaWiPiV_PuHJM1GbHgeELERLwGzg8,45291
7
- mwx/matplot2.py,sha256=nA7RLW1tf5kQfrenFnrAF900DbrpOUldc3SGaJgJKi0,32794
8
- mwx/matplot2g.py,sha256=faKpuBdp4H_g-HKfRdxV17AwHtXcfRi2F0myE3cjM04,65393
7
+ mwx/matplot2.py,sha256=YB7Ug3PaHDFbNQRX8G_rW9-50bn7c1UQe4P1ZzAxlhU,32768
8
+ mwx/matplot2g.py,sha256=KIuownEsF7t2RgHn3kOxjBXbKOdfS99X_CtQweG_FrM,65471
9
9
  mwx/matplot2lg.py,sha256=gI_L_GofQrg5TIgZFMgYu8-7IRoe6VCRG3Ub35ChSpQ,27177
10
10
  mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
11
- mwx/nutshell.py,sha256=ENxoeqSfVaogh2dz43fk3MQaCePKyoz1YzucwiCojxI,137070
11
+ mwx/nutshell.py,sha256=xI5o9os0wxgkY5LFz1wztM36l-4nl2j1iAdzJ11BMv0,137104
12
12
  mwx/utilus.py,sha256=Uwj6vbNUUztwOswPG75xtsT2y_PZqh3QiJraxmA9iT0,37401
13
13
  mwx/wxmon.py,sha256=6es-jVz9Ht7vZnG7VBJcaNYLHY0PnZtij60SXcZRTeY,12727
14
14
  mwx/wxpdb.py,sha256=lLowkkAgMhPFHAfklD7wZHq0qbSMjRxnBFtSajmVgME,19133
@@ -21,8 +21,8 @@ mwx/plugins/frame_listview.py,sha256=RaYOj-YKrpLqhT8TkBRDX1TQnSPv90V185j8OjrWJTs
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=KaHooM32hrGGgqw75Cbt8lAvACwC6RXadob9LGgNnEc,16806
24
- mwxlib-0.95.5.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
- mwxlib-0.95.5.dist-info/METADATA,sha256=VSx9T74u5-4ID0njjolKRXbZSsbYe_UP8HQ9AzCfTQA,1925
26
- mwxlib-0.95.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
- mwxlib-0.95.5.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-0.95.5.dist-info/RECORD,,
24
+ mwxlib-0.95.7.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
+ mwxlib-0.95.7.dist-info/METADATA,sha256=P_R_5M65Dcw6LuaTKAn1eA7TIDcM07NQPV0QXKaG3zM,1925
26
+ mwxlib-0.95.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
+ mwxlib-0.95.7.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-0.95.7.dist-info/RECORD,,