Christopher Barker schrieb:
>> For your purposes, take a look at the GUIMode.GUIMove class. You
>> essentially want to make a class just like that, but with "left"
>> changed to "right" everywhere.
>
> I've done that. It's enclosed, and also in SVN under "Tests".
Dear Chris,
I'm afraid i have to ask one more thing.
I didn't want the hand cursor to appear in MoveMode, so i tried to
overwrite
class GUIRightMove(GUIMove).__init__ to not set it.
class GUIRightMove(GUIMove):
def __init__(self, parent):
GUIBase.__init__(self, parent)
def __init__(self, canvas):
GUIBase.__init__(self, canvas)
self.StartMove = None
self.PrevMoveXY = None
However, i get the message
File
"C:\Python24\lib\site-packages\wx-2.8-msw-unicode\wx\lib\floatcanvas\GUIMode.py",
line 177, in OnLeftDown
self.Canvas.SetCursor(self.GrabCursor)
AttributeError: GUIRightMove instance has no attribute 'GrabCursor'
So it seems GUIMove.__init__ is still called.
Any chance i can override this?
Second, i found someone already setting
from wx.lib.floatcanvas.GUIMode import GUIMouse
self.canvas.SetMode(GUIMouse(self.canvas))
in the __init__ of our workspace class. So by setting it to GUIMove, i'm
essentially breaking that, also breaking the left mouse button events
from GUIMouse (that are still needed).
After importing GUIMouse before the GUIRightMove class is defined, i tried
OnLeftDown = GUIMouse.OnLeftDown
OnLeftUp = GUIMouse.OnLeftUp
OnLeftDouble = GUIMouse.OnLeftDouble
in the same fashion you get the corresponding right click methods from
GUIMove. This however leaves me with
File
"C:\Python24\lib\site-packages\wx-2.8-msw-unicode\wx\lib\floatcanvas\FloatCanvas.py",
line 2544, in LeftDownEvent
self.GUIMode.OnLeftDown(event)
TypeError: unbound method OnLeftDown() must be called with GUIMouse
instance as first argument (got MouseEvent instance instead)
Is it possible for me to fix this?
Thanks in advance,
--
Dipl.-Inf. Niels Menke
Universität Kassel
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas