mwxlib 0.99.6__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 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
@@ -581,8 +581,8 @@ class KnobCtrlPanel(scrolled.ScrolledPanel):
581
581
  x, y = evt.Position
582
582
  for child in self.Sizer.Children: # child <wx._core.SizerItem>
583
583
  if child.IsShown():
584
- obj = child.Sizer or child.Window
585
- if isinstance(obj, (wx.StaticBoxSizer, wx.StaticBox)):
584
+ obj = child.Sizer
585
+ if isinstance(obj, wx.StaticBoxSizer):
586
586
  cx, cy = obj.Position
587
587
  if cx < x < cx + obj.Size[0] and cy < y < cy+22:
588
588
  for cc in obj.Children: # child of child <wx._core.SizerItem>
@@ -737,7 +737,7 @@ class KnobCtrlPanel(scrolled.ScrolledPanel):
737
737
 
738
738
 
739
739
  class ControlPanel(CtrlInterface, KnobCtrlPanel):
740
- """Gnuplot control panel.
740
+ """Control panel with mouse/key event interface.
741
741
  """
742
742
  def __init__(self, *args, **kwargs):
743
743
  KnobCtrlPanel.__init__(self, *args, **kwargs)
@@ -823,8 +823,17 @@ class Clipboard:
823
823
  ## --------------------------------
824
824
  ## Wx custom controls and bitmaps
825
825
  ## --------------------------------
826
- if 1:
827
- _provided_arts = {
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
- _custom_images = {
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 bullet(colour, ec=None, size=(16,16), radius=4):
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
- def _getBitmap1(key, size=(16,16)):
914
- if isinstance(key, wx.Bitmap):
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
- return wx.NullBitmap # The standard wx controls accept this,
939
-
940
-
941
- def _getBitmap2(back, fore, size=(16,16), subsize=3/4):
942
- if isinstance(subsize, float):
943
- subsize = wx.Size(size) * subsize
944
- back = _getBitmap1(back, size)
945
- fore = _getBitmap1(fore, subsize)
946
- x = size[0] - subsize[0]
947
- y = size[1] - subsize[1]
948
- with wx.MemoryDC(back) as dc:
949
- ## dc = wx.GCDC(dc)
950
- ## dc.DrawBitmap(fore, x, y, useMask=True)
951
- gc = wx.GraphicsContext.Create(dc)
952
- gc.DrawBitmap(fore, x, y, *subsize)
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.ToolTip = _Tip(handler.__doc__)
992
- self.icon = icon
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 = dict(enable=None, disable=None)
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.ToolTip = _Tip(handler.__doc__)
1038
- self.icon = icon
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.ToolTip = _Tip(handler.__doc__)
1081
- self._btn.ToolTip = _Tip(updater.__doc__)
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.ToolTip = _Tip(handler.__doc__)
1158
- self._btn.ToolTip = _Tip(updater.__doc__)
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
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "0.99.6"
4
+ __version__ = "0.99.9"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from contextlib import contextmanager
@@ -1137,7 +1137,7 @@ class ShellFrame(MiniFrame):
1137
1137
  EventMonitor.__module__, # Don't enter event-hook
1138
1138
  FSM.__module__,
1139
1139
  'wx.core', 'wx.lib.eventwatcher',
1140
- 'fnmatch', 'warnings', 'bdb', 'pdb', #'contextlib',
1140
+ 'fnmatch', 'warnings', 'bdb', 'pdb', 'contextlib',
1141
1141
  ],
1142
1142
  )
1143
1143
  self.inspector = Inspector(self, name="Inspector")
@@ -1255,7 +1255,7 @@ class ShellFrame(MiniFrame):
1255
1255
  0 : {
1256
1256
  '* pressed' : (0, fork_debugger),
1257
1257
  '* released' : (0, fork_debugger),
1258
- 'C-g pressed' : (0, self.quit, fork_debugger),
1258
+ 'C-g pressed' : (0, self.Quit, fork_debugger),
1259
1259
  'f1 pressed' : (0, self.About),
1260
1260
  'C-f pressed' : (0, self.OnFindText),
1261
1261
  'f3 pressed' : (0, self.OnFindNext),
@@ -1358,7 +1358,7 @@ class ShellFrame(MiniFrame):
1358
1358
  Style=Stylus.py_log_mode)
1359
1359
 
1360
1360
  self.Help.set_attributes(ReadOnly=False,
1361
- Style=Stylus.py_text_mode)
1361
+ Style=Stylus.py_log_mode)
1362
1362
 
1363
1363
  self.set_hookable(self.Scratch)
1364
1364
  self.set_hookable(self.Log)
@@ -1433,7 +1433,7 @@ class ShellFrame(MiniFrame):
1433
1433
  evt.Veto()
1434
1434
  return
1435
1435
  #? RuntimeError('wrapped C/C++ object ... has been deleted')
1436
- self.quit()
1436
+ self.Quit()
1437
1437
 
1438
1438
  if self.debugger.tracing:
1439
1439
  wx.MessageBox("The debugger ends tracing.\n\n"
@@ -1602,12 +1602,8 @@ class ShellFrame(MiniFrame):
1602
1602
  ## Actions for handler
1603
1603
  ## --------------------------------
1604
1604
 
1605
- def quit(self, evt=None):
1605
+ def Quit(self, evt=None):
1606
1606
  """Stop debugger and monitor."""
1607
- ## self.inspector.unwatch()
1608
- self.monitor.unwatch()
1609
- self.ginfo.unwatch()
1610
- self.linfo.unwatch()
1611
1607
  self.debugger.unwatch()
1612
1608
  self.debugger.send_input('\n') # terminates the reader of threading pdb
1613
1609
  shell = self.debugger.interactive_shell # reset interp locals
mwx/graphman.py CHANGED
@@ -162,12 +162,13 @@ class Thread:
162
162
  """
163
163
  if not self.running:
164
164
  return None
165
+ if '\n\n' not in msg:
166
+ msg += '\n\n'
165
167
  try:
166
168
  self.event.clear() # suspend
167
- if wx.MessageBox(msg + "\n\n"
168
- "Press [OK] to continue.\n"
169
- "Press [CANCEL] to terminate the process.",
170
- style=wx.OK|wx.CANCEL|wx.ICON_WARNING) != wx.OK:
169
+ if wx.MessageBox(msg +
170
+ "Do you want to terminate the process?",
171
+ style=wx.OK|wx.CANCEL|wx.ICON_WARNING) == wx.OK:
171
172
  self.Stop()
172
173
  return False
173
174
  return True
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.ToolTip = self.modeline.Label
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/nutshell.py CHANGED
@@ -2107,16 +2107,13 @@ class Buffer(EditorInterface, EditWindow):
2107
2107
  return filter(None, _gen_text())
2108
2108
 
2109
2109
  def eval_line(self):
2110
- self.py_eval_line(self.globals, self.locals)
2111
-
2112
- def py_eval_line(self, globals=None, locals=None):
2113
2110
  if self.CallTipActive():
2114
2111
  self.CallTipCancel()
2115
2112
 
2116
2113
  status = "No words"
2117
2114
  for text in self.gen_text_at_caret():
2118
2115
  try:
2119
- obj = eval(text, globals, locals)
2116
+ obj = eval(text, self.globals, self.locals)
2120
2117
  except Exception as e:
2121
2118
  status = "- {} : {!r}".format(e, text)
2122
2119
  else:
@@ -2126,14 +2123,9 @@ class Buffer(EditorInterface, EditWindow):
2126
2123
  self.message(status)
2127
2124
 
2128
2125
  def exec_region(self):
2129
- self.py_exec_region(self.globals, self.locals)
2130
-
2131
- def py_exec_region(self, globals=None, locals=None, filename=None):
2132
- if not filename:
2133
- filename = self.filename
2134
2126
  try:
2135
- code = compile(self.Text, filename, "exec")
2136
- exec(code, globals, locals)
2127
+ code = compile(self.Text, self.filename, "exec")
2128
+ exec(code, self.globals, self.locals)
2137
2129
  dispatcher.send(signal='Interpreter.push',
2138
2130
  sender=self, command=None, more=False)
2139
2131
  except BdbQuit:
@@ -2142,7 +2134,7 @@ class Buffer(EditorInterface, EditWindow):
2142
2134
  except Exception as e:
2143
2135
  msg = traceback.format_exc()
2144
2136
  err = re.findall(py_error_re, msg, re.M)
2145
- lines = [int(ln) for fn, ln in err if fn == filename]
2137
+ lines = [int(ln) for fn, ln in err if fn == self.filename]
2146
2138
  if lines:
2147
2139
  lx = lines[-1] - 1
2148
2140
  self.red_arrow = lx
@@ -2158,7 +2150,7 @@ class Buffer(EditorInterface, EditWindow):
2158
2150
  del self.pointer # Reset pointer (debugger hook point).
2159
2151
  del self.red_arrow
2160
2152
  self.handler('buffer_region_executed', self)
2161
- self.message("Evaluated {!r} successfully.".format(filename))
2153
+ self.message("Evaluated {!r} successfully.".format(self.filename))
2162
2154
  self.AnnotationClearAll()
2163
2155
 
2164
2156
 
mwx/utilus.py CHANGED
@@ -43,6 +43,8 @@ def warn(message, category=None):
43
43
  stacklevel = 1
44
44
  while frame.f_code.co_filename in skip:
45
45
  frame = frame.f_back
46
+ if not frame:
47
+ break
46
48
  stacklevel += 1
47
49
  return warnings.warn(message, category, stacklevel+1)
48
50
 
mwx/wxmon.py CHANGED
@@ -7,7 +7,7 @@ import wx
7
7
  import wx.lib.eventwatcher as ew
8
8
  from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin
9
9
 
10
- from .utilus import where
10
+ from .utilus import where, ignore
11
11
  from .controls import Icon, Clipboard
12
12
  from .framework import CtrlInterface, Menu
13
13
 
@@ -99,8 +99,8 @@ class EventMonitor(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
99
99
 
100
100
  def watch(self, widget=None):
101
101
  """Begin watching the widget."""
102
- self.clear()
103
102
  self.unwatch()
103
+ self.clear()
104
104
  if widget is None:
105
105
  widget = self._target # Resume watching the previous target.
106
106
  if not widget:
@@ -174,7 +174,11 @@ class EventMonitor(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
174
174
  name = self.get_name(event)
175
175
  source = ew._makeSourceString(obj) + " id=0x{:X}".format(id(evt))
176
176
  stamp = 1
177
- attribs = ew._makeAttribString(evt)
177
+ try:
178
+ with ignore(DeprecationWarning):
179
+ attribs = ew._makeAttribString(evt)
180
+ except Exception:
181
+ attribs = '' # Failed to get event attributes; possibly <BdbQuit>.
178
182
  data = self.__items
179
183
  for i, item in enumerate(data):
180
184
  if item[0] == event:
mwx/wxwit.py CHANGED
@@ -49,13 +49,17 @@ class Inspector(it.InspectionTree, CtrlInterface):
49
49
  self.parent.handler(self.handler.current_event, evt)
50
50
  evt.Skip()
51
51
 
52
- @self.handler.bind('f4 pressed')
53
- def highlight(evt):
52
+ @self.handler.bind('f3 pressed')
53
+ def _watchit(evt):
54
54
  if self.target:
55
- self.highlighter.HighlightCurrentItem(self)
55
+ watchit(self.target)
56
+
57
+ @self.handler.bind('f4 pressed')
58
+ def _highlight(evt):
59
+ self.highlighter.HighlightCurrentItem(self)
56
60
 
57
61
  @self.handler.bind('f5 pressed')
58
- def refresh(evt):
62
+ def _refresh(evt):
59
63
  self.BuildTree(self.target)
60
64
 
61
65
  def OnDestroy(self, evt):
@@ -73,7 +77,10 @@ class Inspector(it.InspectionTree, CtrlInterface):
73
77
  ## --------------------------------
74
78
 
75
79
  def SetObj(self, obj):
76
- """Called from tree.toolFrame -> SetObj."""
80
+ """Called from tree.toolFrame -> SetObj.
81
+
82
+ (override) Set target object.
83
+ """
77
84
  if self.target is obj:
78
85
  return
79
86
  self.target = obj
@@ -86,7 +93,8 @@ class Inspector(it.InspectionTree, CtrlInterface):
86
93
 
87
94
  def GetTextForWidget(self, obj):
88
95
  """Returns the string to be used in the tree for a widget.
89
- (override) make better object name and Id
96
+
97
+ (override) Make better object name and Id.
90
98
  """
91
99
  clsname = obj.__class__.__name__
92
100
  if hasattr(obj, 'Name'):
@@ -103,7 +111,6 @@ class Inspector(it.InspectionTree, CtrlInterface):
103
111
  self.highlighter.HighlightSizer(obj.Sizer)
104
112
 
105
113
  def set_colour(self, obj, col):
106
- self.SetObj(obj)
107
114
  item = self.FindWidgetItem(obj)
108
115
  if item:
109
116
  self.SetItemTextColour(item, col)
@@ -158,11 +165,15 @@ class Inspector(it.InspectionTree, CtrlInterface):
158
165
  self.SetFocus()
159
166
  obj = self.target
160
167
  Menu.Popup(self, [
161
- (8, "&Filling View", miniIcon('ShowFilling'),
162
- lambda v: filling(obj),
168
+ (1, "&Dive into {!r}".format(typename(obj)), Icon('core'),
169
+ lambda v: dive(obj),
170
+ lambda v: v.Enable(obj is not None)),
171
+
172
+ (2, "&Watch event", Icon('tv'),
173
+ lambda v: watch(obj),
163
174
  lambda v: v.Enable(obj is not None)),
164
-
165
- (10, "&Inspection Tool", Icon('inspect'),
175
+ (),
176
+ (10, "&Inspection Tool\tf3", Icon('inspect'),
166
177
  lambda v: watchit(obj),
167
178
  lambda v: v.Enable(obj is not None)),
168
179
  (),
@@ -172,14 +183,6 @@ class Inspector(it.InspectionTree, CtrlInterface):
172
183
 
173
184
  (12, "Refresh\tf5", miniIcon('Refresh'),
174
185
  lambda v: self.BuildTree(obj)),
175
- (),
176
- (2, "&Watch event", Icon('tv'),
177
- lambda v: watch(obj),
178
- lambda v: v.Enable(obj is not None)),
179
-
180
- (1, "&Dive into {!r}".format(typename(obj)), Icon('core'),
181
- lambda v: dive(obj),
182
- lambda v: v.Enable(obj is not None)),
183
186
  ])
184
187
 
185
188
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.99.6
3
+ Version: 0.99.9
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,19 +1,19 @@
1
- mwx/__init__.py,sha256=U7n9X8JAWdzOavKvVqecHdE4ooiXcCB5DSPCKWxfTnY,653
1
+ mwx/__init__.py,sha256=psabnAMei5VzB2TsB2qBNLrIZMX0LiqjlXCpNGmDejk,668
2
2
  mwx/bookshelf.py,sha256=so-xSLq08sMlJBErTxOaDoKUAMa_g1CkIP2pNnff68c,5607
3
- mwx/controls.py,sha256=0UkLeyIsQU0uj--v1NYctx-GzqO36Z5rdeNpCsfIN10,47657
4
- mwx/framework.py,sha256=jsOZNCo0Sjea8XWBGSEghENyNTVGVAvZxkDQYi_6BUA,75632
5
- mwx/graphman.py,sha256=EZiRUKhPb6V-S1BcgFhsOQoaZvp4yw6F4SF45uUjla4,70266
3
+ mwx/controls.py,sha256=LZqee9K8uPxs-Iqcp1zMMNBjFpGPrHbcMaIBuBOL7oo,47647
4
+ mwx/framework.py,sha256=nJ22_22Hk2U8xSbHOszluJdSMDwYsw6XjI3lOiprcJc,75501
5
+ mwx/graphman.py,sha256=qX5aHEw4u9iGR8lNpZkXDnGPVMhyAH6NnBapiaUbKZw,70265
6
6
  mwx/images.py,sha256=_-Eh3xF7Khu42ivkYp97NXIzSNGbjcidqtWjZQFGtqE,47827
7
- mwx/matplot2.py,sha256=xCJ_ZzdDEWmzctpPaOrzTnwXyHINP4nfFHweoTZa6ug,32899
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
- mwx/nutshell.py,sha256=etvpwPctuf9KhvIB1WZwTAaljYQ2ciMRfUWzmXW6NUo,142090
12
- mwx/utilus.py,sha256=iizdVrbwL1lX7eTfsMmltFz4IfHqTXVM37wwlPQ3A3Y,37346
13
- mwx/wxmon.py,sha256=Pq8XXigM_isJd80yiqG18iRVdArJpsePpxfnZOkk-Uw,12573
11
+ mwx/nutshell.py,sha256=zJULq1K8WiOBUncMpXE8HbunqUULa9MUt0hBET5jmgs,141810
12
+ mwx/utilus.py,sha256=Yyw8L1f-ikhyd7wtFXYtsOswofWxmB4GAmLOZnhUXeU,37388
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
16
- mwx/wxwit.py,sha256=ifxMwdIz-QhDEr8vyAztToF8VVSxKNXlq4Ap1awBZvo,7362
16
+ mwx/wxwit.py,sha256=l7uq6NgGBhay-uAE1pQgWziSAGO9QZPJ4EpEBw1P9xU,7357
17
17
  mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
18
18
  mwx/plugins/ffmpeg_view.py,sha256=Mmen75o6LyA5QEHB8sCFSPCIPvEaALKzrgomym3fGAU,10721
19
19
  mwx/plugins/fft_view.py,sha256=xxTDD-_z4l18u4t2ybPB3xAMIslJmJ0gQlTxEqJUhNI,2782
@@ -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.6.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
- mwxlib-0.99.6.dist-info/METADATA,sha256=oJA02gAxSPxjaJwcQ9DEyrxQHoRuR-1kAD7ZSq1JLMs,7411
26
- mwxlib-0.99.6.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
27
- mwxlib-0.99.6.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-0.99.6.dist-info/RECORD,,
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,,