def draw_new_bmap(self, dc, location, selected): bmap = bric_data.get_new_bmap(selected) if (self.zoom != 1.0): image = bmap.ConvertToImage() w = image.GetWidth() * self.zoom h = image.GetHeight() * self.zoom image.Rescale(w, h) bmap = image.ConvertToBitmap() dc.DrawBitmap(bmap, location[0]*self.zoom, location[1]*self.zoom, True)
def draw_new_bmap(self, dc, location, selected): bmap = bric_data.get_new_bmap(selected) if (self.zoom != 1.0): image = bmap.ConvertToImage() w = image.GetWidth() * self.zoom h = image.GetHeight() * self.zoom image.Rescale(w, h) bmap = image.ConvertToBitmap() dc.DrawBitmap(bmap, location[0] * self.zoom, location[1] * self.zoom, True)
def compute_bmap(self, name, x, bric_id): if (name == "new_event"): bmap = bric_data.get_new_bmap(False) elif (name == 'If'): if_var = win_data.program().get_bric_if_variant(bric_id) if (win_data.selection_check('pwork', None, bric_id)): bmap = bric_data.get_if_bmap(if_var, True) else: bmap = bric_data.get_if_bmap(if_var, False) else: if (win_data.selection_check('pwork', None, bric_id)): bmap = bric_data.get_bric_bmap(name, bric_data.BRIC_SELECTED) else: bmap = bric_data.get_bric_bmap(name, bric_data.BRIC_NORMAL) x += bmap.GetWidth() return x
def draw_bmap(self, dc, name, x, cl, bric_id): # **BED** scale bitmap if needed #print "Drawing:", name, "x:",x, "cl:", cl, "bric_id:", bric_id if (name == "new_event"): bmap = bric_data.get_new_bmap(False) elif (name == 'If'): if_var = win_data.program().get_bric_if_variant(bric_id) if (win_data.selection_check('pwork', None, bric_id)): bmap = bric_data.get_if_bmap(if_var, True) else: bmap = bric_data.get_if_bmap(if_var, False) else: if (win_data.selection_check('pwork', None, bric_id)): bmap = bric_data.get_bric_bmap(name, bric_data.BRIC_SELECTED) else: bmap = bric_data.get_bric_bmap(name, bric_data.BRIC_NORMAL) y = cl - bmap.GetHeight() / 2 dc.DrawBitmap(bmap, x, y, True) x += bmap.GetWidth() return (x, bmap.GetSize())
def draw_bmap(self, dc, name, x, cl, bric_id): # **BED** scale bitmap if needed #print "Drawing:", name, "x:",x, "cl:", cl, "bric_id:", bric_id if (name == "new_event"): bmap = bric_data.get_new_bmap(False) elif (name == 'If'): if_var = win_data.program().get_bric_if_variant(bric_id) if (win_data.selection_check('pwork', None, bric_id)): bmap = bric_data.get_if_bmap(if_var, True) else: bmap = bric_data.get_if_bmap(if_var, False) else: if (win_data.selection_check('pwork', None, bric_id)): bmap = bric_data.get_bric_bmap(name, bric_data.BRIC_SELECTED) else: bmap = bric_data.get_bric_bmap(name, bric_data.BRIC_NORMAL) y = cl - bmap.GetHeight()/2 dc.DrawBitmap(bmap, x, y, True) x += bmap.GetWidth() return (x, bmap.GetSize())