Пример #1
0
 def draw(self,x_pos,y_pos,x_to,y_to,color):
     self.x_pos=x_pos
     self.y_pos=y_pos
     self.x_to=x_to
     self.y_to=y_to
     self.color=color
     return debugger.draw_line(self.handler,self.x_pos,self.y_pos,self.x_to,self.y_to,ImmDrawColors[self.color])
Пример #2
0
    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
Пример #3
0
 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
Пример #4
0
 def addEndPoint(x,y,color):
     debugger.draw_line(self.handler,x,y,x,y+3,ImmDrawColors[color])
     debugger.draw_line(self.handler,x,y,x,y-3,ImmDrawColors[color])
     debugger.draw_line(self.handler,x,y,x+3,y+3,ImmDrawColors[color])
     debugger.draw_line(self.handler,x,y,x-3,y+3,ImmDrawColors[color])
     debugger.draw_line(self.handler,x,y,x+3,y-3,ImmDrawColors[color])
     debugger.draw_line(self.handler,x,y,x-3,y-3,ImmDrawColors[color])
     return