mwxlib 1.6.8__py3-none-any.whl → 1.7.0__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/bookshelf.py +26 -22
- mwx/controls.py +142 -143
- mwx/framework.py +109 -114
- mwx/graphman.py +90 -89
- mwx/matplot2.py +82 -81
- mwx/matplot2g.py +165 -165
- mwx/matplot2lg.py +57 -57
- mwx/mgplt.py +12 -12
- mwx/nutshell.py +306 -288
- mwx/plugins/ffmpeg_view.py +15 -15
- mwx/plugins/fft_view.py +4 -4
- mwx/plugins/frame_listview.py +26 -26
- mwx/plugins/line_profile.py +1 -1
- mwx/utilus.py +40 -40
- mwx/wxmon.py +20 -20
- mwx/wxpdb.py +46 -46
- mwx/wxwil.py +11 -11
- mwx/wxwit.py +15 -15
- {mwxlib-1.6.8.dist-info → mwxlib-1.7.0.dist-info}/METADATA +1 -1
- mwxlib-1.7.0.dist-info/RECORD +28 -0
- mwxlib-1.6.8.dist-info/RECORD +0 -28
- {mwxlib-1.6.8.dist-info → mwxlib-1.7.0.dist-info}/WHEEL +0 -0
- {mwxlib-1.6.8.dist-info → mwxlib-1.7.0.dist-info}/top_level.txt +0 -0
mwx/bookshelf.py
CHANGED
|
@@ -20,19 +20,20 @@ class MyDropTarget(wx.DropTarget):
|
|
|
20
20
|
self.do.Add(self.textdo)
|
|
21
21
|
self.do.Add(self.filedo)
|
|
22
22
|
self.SetDataObject(self.do)
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
def OnDragOver(self, x, y, result):
|
|
25
25
|
item, flags = self.tree.HitTest((x, y))
|
|
26
26
|
items = list(self.tree._gen_items(self.tree.RootItem)) # first level items
|
|
27
|
+
if self.datado.Format.Id != "TreeItem":
|
|
28
|
+
return wx.DragNone # Don't drag and drop
|
|
27
29
|
if not item:
|
|
28
30
|
item = items[0] # Select the first tree item.
|
|
29
|
-
## return wx.DragNone
|
|
30
31
|
elif item not in items:
|
|
31
32
|
item = self.tree.GetItemParent(item) # Select the tree item.
|
|
32
33
|
if item != self.tree.Selection:
|
|
33
34
|
self.tree.SelectItem(item)
|
|
34
35
|
return result
|
|
35
|
-
|
|
36
|
+
|
|
36
37
|
def OnData(self, x, y, result):
|
|
37
38
|
item = self.tree.Selection
|
|
38
39
|
name = self.tree.GetItemText(item)
|
|
@@ -118,17 +119,17 @@ class EditorTreeCtrl(wx.TreeCtrl, CtrlInterface):
|
|
|
118
119
|
self.build_tree()
|
|
119
120
|
wx.CallAfter(_attach)
|
|
120
121
|
wx.CallAfter(self.ExpandAll)
|
|
121
|
-
|
|
122
|
+
|
|
122
123
|
def OnDestroy(self, evt):
|
|
123
124
|
if self and self.parent:
|
|
124
125
|
for editor in self.parent.get_all_editors():
|
|
125
126
|
editor.handler.remove(self.context)
|
|
126
127
|
evt.Skip()
|
|
127
|
-
|
|
128
|
+
|
|
128
129
|
## --------------------------------
|
|
129
130
|
## TreeList/Ctrl wrapper interface
|
|
130
131
|
## --------------------------------
|
|
131
|
-
|
|
132
|
+
|
|
132
133
|
def build_tree(self, clear=True):
|
|
133
134
|
"""Build tree control.
|
|
134
135
|
All items will be cleared if specified.
|
|
@@ -139,7 +140,7 @@ class EditorTreeCtrl(wx.TreeCtrl, CtrlInterface):
|
|
|
139
140
|
for editor in self.parent.get_all_editors():
|
|
140
141
|
self._set_item(self.RootItem, editor.Name, editor.get_all_buffers())
|
|
141
142
|
self.Refresh()
|
|
142
|
-
|
|
143
|
+
|
|
143
144
|
def _gen_items(self, root, key=None):
|
|
144
145
|
"""Generates the [root/key] items."""
|
|
145
146
|
item, cookie = self.GetFirstChild(root)
|
|
@@ -152,11 +153,11 @@ class EditorTreeCtrl(wx.TreeCtrl, CtrlInterface):
|
|
|
152
153
|
if key == re.sub(r"^\W+\s+(.*)", r"\1", caption):
|
|
153
154
|
yield item
|
|
154
155
|
item, cookie = self.GetNextChild(root, cookie)
|
|
155
|
-
|
|
156
|
+
|
|
156
157
|
def _get_item(self, root, key):
|
|
157
158
|
"""Get the first [root/key] item found."""
|
|
158
159
|
return next(self._gen_items(root, key), None)
|
|
159
|
-
|
|
160
|
+
|
|
160
161
|
def _set_item(self, root, key, data):
|
|
161
162
|
"""Set the [root/key] item with data recursively."""
|
|
162
163
|
for item in self._gen_items(root, key):
|
|
@@ -173,27 +174,27 @@ class EditorTreeCtrl(wx.TreeCtrl, CtrlInterface):
|
|
|
173
174
|
self.SetItemData(item, data)
|
|
174
175
|
self.SetItemText(item, data.caption_prefix + data.name)
|
|
175
176
|
return item
|
|
176
|
-
|
|
177
|
+
|
|
177
178
|
## --------------------------------
|
|
178
179
|
## Actions for bookshelf interfaces
|
|
179
180
|
## --------------------------------
|
|
180
|
-
|
|
181
|
+
|
|
181
182
|
def on_buffer_new(self, buf):
|
|
182
183
|
self.build_tree(clear=0)
|
|
183
|
-
|
|
184
|
+
|
|
184
185
|
def on_buffer_deleted(self, buf):
|
|
185
186
|
self.Delete(buf.__itemId)
|
|
186
|
-
|
|
187
|
+
|
|
187
188
|
## Note: [buffer_activated][EVT_SET_FOCUS] > [buffer_new] の順で呼ばれる
|
|
188
189
|
## buf.__itemId がない場合がある (delete_buffer 直後など)
|
|
189
190
|
def on_buffer_selected(self, buf):
|
|
190
191
|
if self and buf:
|
|
191
192
|
wx.CallAfter(lambda: self.SelectItem(buf.__itemId))
|
|
192
|
-
|
|
193
|
+
|
|
193
194
|
def on_buffer_filename(self, buf):
|
|
194
195
|
if self and buf:
|
|
195
196
|
self.SetItemText(buf.__itemId, buf.caption_prefix + buf.name)
|
|
196
|
-
|
|
197
|
+
|
|
197
198
|
def on_delete_buffer(self, evt):
|
|
198
199
|
item = self.Selection
|
|
199
200
|
if item:
|
|
@@ -201,11 +202,10 @@ class EditorTreeCtrl(wx.TreeCtrl, CtrlInterface):
|
|
|
201
202
|
if data:
|
|
202
203
|
data.parent.kill_buffer(data) # the focus moves
|
|
203
204
|
wx.CallAfter(self.SetFocus)
|
|
204
|
-
|
|
205
|
+
|
|
205
206
|
def _find_editor(self, name):
|
|
206
|
-
## return self.Parent.FindWindow(name) # window.Name (not page.caption)
|
|
207
207
|
return next(editor for editor in self.parent.get_all_editors() if editor.Name == name)
|
|
208
|
-
|
|
208
|
+
|
|
209
209
|
def OnSelChanged(self, evt):
|
|
210
210
|
if self and self.HasFocus():
|
|
211
211
|
data = self.GetItemData(evt.Item)
|
|
@@ -219,14 +219,18 @@ class EditorTreeCtrl(wx.TreeCtrl, CtrlInterface):
|
|
|
219
219
|
nb.Selection = nb.FindPage(editor)
|
|
220
220
|
wx.CallAfter(self.SetFocus)
|
|
221
221
|
evt.Skip()
|
|
222
|
-
|
|
222
|
+
|
|
223
223
|
def OnBeginDrag(self, evt):
|
|
224
224
|
data = self.GetItemData(evt.Item)
|
|
225
225
|
if data:
|
|
226
226
|
self._buffer = data
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
if data.mtdelta is None:
|
|
228
|
+
dd = wx.CustomDataObject("DummyItem") # no file object
|
|
229
|
+
dd.SetData(b"")
|
|
230
|
+
else:
|
|
231
|
+
dd = wx.CustomDataObject("TreeItem")
|
|
232
|
+
dd.SetData(data.filename.encode())
|
|
229
233
|
dropSource = wx.DropSource()
|
|
230
234
|
dropSource.SetData(dd)
|
|
231
|
-
dropSource.DoDragDrop(wx.Drag_AllowMove)
|
|
235
|
+
dropSource.DoDragDrop(wx.Drag_AllowMove) # -> wx.DragResult
|
|
232
236
|
del self._buffer
|