def placeVertex(self, x, y, text, textcolor, rectcolor, start): theight = 0 self.texth = 0 self.textw = 0 f = open("ea.txt", "w+") for line in text: if text.index(line) == 0: #title (theight, twidth) = debugger.draw_text(self.handler, x, y + self.texth, line + ":", ImmDrawColors["Purple"]) if twidth > self.textw: self.textw = twidth self.texth = self.texth + theight else: line = line.replace("\x0a", "").replace("\x0d", "") #split asm from comment try: asmline = line.split("||")[0] commentline = line.split("||")[1] (theight, twidth) = debugger.draw_text( self.handler, x, y + self.texth, " " + asmline, ImmDrawColors[textcolor]) (theight, twidth2) = debugger.draw_text( self.handler, x + twidth, y + self.texth, " " + commentline, ImmDrawColors["Red"]) twidth += twidth2 except: (theight, twidth) = debugger.draw_text(self.handler, x, y + self.texth, " " + line, ImmDrawColors[textcolor]) if twidth > self.textw: self.textw = twidth self.texth = self.texth + theight #left debugger.draw_line(self.handler, x - 5, y - 3, x - 5, y + self.texth + 2, ImmDrawColors[rectcolor], start) #mark graph start #right debugger.draw_line(self.handler, x + self.textw + 5, y - 2, x + self.textw + 5, y + self.texth + 2, ImmDrawColors[rectcolor]) #top debugger.draw_line(self.handler, x - 6, y - 3, x + self.textw + 5, y - 2, ImmDrawColors[rectcolor]) #bottom debugger.draw_line(self.handler, x - 6, y + self.texth + 2, x + self.textw + 5, y + self.texth + 2, ImmDrawColors[rectcolor]) return None
def drawText(self,x,y,text,color): debugger.Error("e") theight=0 for line in text: #separate asm from comment asmline=line.split("||")[0] commentline=line.split("||")[1] debugger.Error("asm: %s\ncomment: %s" % (asmline,commentline)) (theight,twidth)=debugger.draw_text(self.handler,x,y+self.texth,asmline,ImmDrawColors[color]) (theight,twidth2)=debugger.draw_text(self.handler,x+twidth,y+self.texth,commentline,ImmDrawColors["Red"]) twidth+=twidth2 if twidth > self.textw: self.textw=twidth self.texth=self.texth+theight return None
def placeVertex(self,x,y,text,textcolor,rectcolor,start): theight=0 self.texth=0 self.textw=0 f=open("ea.txt","w+") for line in text: if text.index(line) == 0: #title (theight,twidth)=debugger.draw_text(self.handler,x,y+self.texth,line+":",ImmDrawColors["Purple"]) if twidth > self.textw: self.textw=twidth self.texth=self.texth+theight else: line = line.replace("\x0a","").replace("\x0d","") #split asm from comment try: asmline=line.split("||")[0] commentline=line.split("||")[1] (theight,twidth)=debugger.draw_text(self.handler,x,y+self.texth," " +asmline,ImmDrawColors[textcolor]) (theight,twidth2)=debugger.draw_text(self.handler,x+twidth,y+self.texth," " +commentline,ImmDrawColors["Red"]) twidth+=twidth2 except: (theight,twidth)=debugger.draw_text(self.handler,x,y+self.texth," " +line,ImmDrawColors[textcolor]) if twidth > self.textw: self.textw=twidth self.texth=self.texth+theight #left debugger.draw_line(self.handler,x-5,y-3,x-5,y+self.texth+2,ImmDrawColors[rectcolor],start) #mark graph start #right debugger.draw_line(self.handler,x+self.textw+5,y-2,x+self.textw+5,y+self.texth+2,ImmDrawColors[rectcolor]) #top debugger.draw_line(self.handler,x-6,y-3,x+self.textw+5,y-2,ImmDrawColors[rectcolor]) #bottom debugger.draw_line(self.handler,x-6,y+self.texth+2,x+self.textw+5,y+self.texth+2,ImmDrawColors[rectcolor]) return None