def popup_show_image(self, region): '''handle popup menu showImage''' if region is None: return self.show_region(region.ridx, True) if region.latlon != (None,None): self.slipmap.add_object(mp_slipmap.SlipCenter(region.latlon))
def mouse_event(self, event): '''called on mouse events on the mosaic''' import wx if event.X < 0 or event.Y < 0: # sometimes get events when the mouse cursor is not on the mosaic return #print 'cuav_mosaic mouse_event',event.__dict__ # work out which region they want, taking into account wrap region = self.pos_to_region(wx.Point(event.X, event.Y)) if region is None: return if event.m_leftDown: # TODO is this dangerous self.show_region(region.ridx, event.m_middleDown) if region.latlon != (None,None): self.slipmap.add_object(mp_slipmap.SlipCenter(region.latlon)) else: # highlight on mouseover old_region = self.mouse_region self.mouse_region = region self.display_mosaic_region(region.ridx) if old_region != None: self.display_mosaic_region(old_region.ridx) if not self.started(): # if the search is started, it'll be redisplayed anyway self.redisplay_mosaic()
def mouse_event(self, event): '''called on mouse events on the mosaic''' # work out which region they want, taking into account wrap region = self.pos_to_region(wx.Point(event.X, event.Y)) if region is None: return self.show_region(region.ridx, event.m_middleDown) if region.latlon != (None, None): self.slipmap.add_object(mp_slipmap.SlipCenter(region.latlon))