Use a global wx.DataFormat

This commit is contained in:
Robin Dunn
2021-01-07 14:52:34 -08:00
parent 224630cf64
commit 4ab028d7c3
2 changed files with 9 additions and 6 deletions

View File

@@ -1056,6 +1056,7 @@ class FNBDragInfo(object):
# Simply Used To Handle The OnDrop() Method When Dragging And Dropping Between
# Different FlatNotebooks.
# ---------------------------------------------------------------------------- #
FNB_DataFormat = wx.DataFormat('FlatNotebook')
class FNBDropTarget(wx.DropTarget):
"""
@@ -1074,7 +1075,7 @@ class FNBDropTarget(wx.DropTarget):
wx.DropTarget.__init__(self)
self._parent = parent
self._dataobject = wx.CustomDataObject(wx.DataFormat(six.u('FlatNotebook')))
self._dataobject = wx.CustomDataObject(FNB_DataFormat)
self.SetDataObject(self._dataobject)
@@ -5836,7 +5837,7 @@ class PageContainer(wx.Panel):
self._isdragging = True
draginfo = FNBDragInfo(self, tabIdx)
drginfo = pickle.dumps(draginfo)
dataobject = wx.CustomDataObject(wx.DataFormat(six.u('FlatNotebook')))
dataobject = wx.CustomDataObject(FNB_DataFormat)
dataobject.SetData(drginfo)
dragSource = FNBDropSource(self)
dragSource.SetData(dataobject)