def draw(self, cr): NetEditCanvasConfig.draw(self, cr) if self.mouse_position: position = utils.snap_to_grid( self.get_position(self.mouse_position), self.grid_size) placement = citems.AbsPlacement(position) box = citems.ElementBox(None, "", placement, self.element.default_size, self.element.default_radius) box.draw(cr)
def __init__(self, net, id, position): NetItem.__init__(self, net, id) self.box = citems.ElementBox(self, "box", citems.AbsPlacement(position), self.default_size, self.default_radius) self.label_placement = self.box.get_relative_placement( utils.vector_add_t(position, self.default_size, 0.5)) self.label_trace = citems.TraceLabel(self, "tracebox", self.label_placement) self.label_trace.text_fn = self.get_trace_label_text self.label_simrun = citems.SimRunLabel(self, "simrunbox", self.label_placement) self.label_simrun.text_fn = self.get_simrun_label_text self.label_verif = citems.VerifLabel(self, "verifbox", self.label_placement) self.label_verif.text_fn = self.get_verif_label_text