Canceling events from COM Objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Nelson

    Canceling events from COM Objects

    I have MapPoint working in Python, and I'm trying to cancel events on
    the map, but I can't seem to make that happen. I'm responding to the
    events successfully in my panel object. My code is like this:

    global MapPointMod
    MapPointMod =
    win32com.client .gencache.Ensur eModule("{51C0A 9CA-F7B7-4F5A-96F4-43927C6FA50F}",
    0, 1, 0)

    class MyPanel(wx.Pane l):
    def __init__(self, *args, **kwds):
    # begin wxGlade: MyPanel.__init_ _
    kwds["style"] = wx.TAB_TRAVERSA L
    wx.Panel.__init __(self, *args, **kwds)
    self.frame = args[0]

    MyMap = MakeActiveXClas s(MapPointMod.M appointControl,
    eventObj=self)
    self.window_1 = MyMap(self, -1)
    self.window_1.O penMap("C:\\TEM P\\GPS_ON.ptt")
    ....
    ....
    def OnBeforeClick(s elf, Button, Shift, X, Y, Cancel):
    print "tada"


    My event fires just fine, but I can't seem to figure out how to cancel
    the event so that mappoint doesn't do its stuff with it...I've tried
    setting Cancel based on the mappoint specs, but it doesn't seem to get
    sent back anywhere...

    Any ideas please?

    Thanx,

    OLIVER
Working...