mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 12:00:13 +01:00
Add wxDropSource and wxDropTarget
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,14 +1,46 @@
|
||||
import imp_unittest, unittest
|
||||
import wtc
|
||||
import wx
|
||||
import os
|
||||
|
||||
icoFile = os.path.join(os.path.dirname(__file__), 'mondrian.ico')
|
||||
curFile = os.path.join(os.path.dirname(__file__), 'horse.cur')
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class dnd_Tests(wtc.WidgetTestCase):
|
||||
|
||||
# TODO: Remove this test and add real ones.
|
||||
def test_dnd1(self):
|
||||
self.fail("Unit tests for dnd not implemented yet.")
|
||||
wx.Drag_CopyOnly
|
||||
wx.Drag_AllowMove
|
||||
wx.Drag_DefaultMove
|
||||
|
||||
wx.DragError
|
||||
wx.DragNone
|
||||
wx.DragCopy
|
||||
wx.DragMove
|
||||
wx.DragLink
|
||||
wx.DragCancel
|
||||
|
||||
|
||||
def test_dndDropTarget(self):
|
||||
class MyTarget(wx.DropTarget):
|
||||
def OnData(self, x, y, defResult):
|
||||
self.GetData()
|
||||
return defResult
|
||||
|
||||
dt = MyTarget()
|
||||
dt.DefaultAction
|
||||
self.frame.SetDropTarget(dt)
|
||||
|
||||
|
||||
def test_dndDropSource(self):
|
||||
ds = wx.DropSource(self.frame)
|
||||
if 'wxGTK' in wx.PlatformInfo:
|
||||
ds.SetIcon(wx.DragCopy, wx.Icon(icoFile))
|
||||
else:
|
||||
ds.SetCursor(wx.DragCopy, wx.Cursor(curFile))
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user