def on_left_down(self, event): # do main processing self.parent_on_left_down(event) # Can't drag modules in basic (but want to be able to select for the help window) if (not win_data.get_adv_mode()): self.drag_name = None self.drag_bmap = None
def on_left_down(self, event): # Make sure that we have the focus #self.SetFocus() pt = self.CalcUnscrolledPosition(event.GetPosition()) # BED zooming support if (self.zoom != 1.0): pt.Set(pt.x/self.zoom, pt.y/self.zoom) self.drag_loc, self.drag_name = self.hit_test(pt) if (self.drag_loc >= 0): self.drag_start_pos = pt # also set the selection and update the help window win_data.selection_take('cwork', self.drag_name, self.drag_loc) # Don't allow movements in basic mode if (not win_data.get_adv_mode()): self.drag_loc = -1 self.drag_name = None self.drag_start_pos = None
def on_left_down(self, event): # Make sure that we have the focus #self.SetFocus() pt = self.CalcUnscrolledPosition(event.GetPosition()) # BED zooming support if (self.zoom != 1.0): pt.Set(pt.x / self.zoom, pt.y / self.zoom) self.drag_loc, self.drag_name = self.hit_test(pt) if (self.drag_loc >= 0): self.drag_start_pos = pt # also set the selection and update the help window win_data.selection_take('cwork', self.drag_name, self.drag_loc) # Don't allow movements in basic mode if (not win_data.get_adv_mode()): self.drag_loc = -1 self.drag_name = None self.drag_start_pos = None
def enable_check(enable_list): for etype, args in enable_list: #print etype,args if (etype == 'D'): found_one = False for d in args: if (win_data.config_device_used(d)): found_one = True break if (not found_one): return False elif (etype == 'A'): if (not win_data.get_adv_mode()): return False elif (etype == 'P'): if (not win_data.config_motor_pairs()): return False elif (etype == 'V'): if (not win_data.vars_defined()): return False elif (etype == 'U'): if (not win_data.vars_defined('0-255')): return False elif (etype == 'S'): if (not win_data.vars_defined('+/- 32767')): return False elif (etype == 'E'): #print '*** checking E ****' (unused_events_set, unused_events) = win_data.get_unused_events() #print unused_events_set, unused_events if (unused_events_set and len(unused_events) == 0): return False else: raise SyntaxError, 'Unknown enable type: ' + etype return True