mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-09-05 17:30:26 +02:00
* Changed imports to use either absolute or explicit relative imports. Implicit relative imports are no longer allowed. * Changes to accomodate standard library classes or modues moving to other locations, or being removed entirely. * Changes related to print becoming a function, execfile being removed, u'' no longer allowed, and other syntax related issues. * Working around C APIs that have changed or simply vanished. (PyInt, PyString, PyBytes, etc.) * Dealing with text file objects using strings vs binary file objects using bytes, auto-encoding, and etc. * Replacing the use of PyCObject with PyCapsule and dealing with an apparent bug where PyCapsule objects can't be imported from submodules within a package. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
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):
|
|
|
|
def test_dnd1(self):
|
|
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, wx.BITMAP_TYPE_CUR))
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|