예제 #1
0
 def repositionCaret(self):
     self.updateCache()
     found = False
     for i in range(0, len(self.lines)):
         if (((self.cursorAddr >= self.lines[i].address) and
              (self.cursorAddr <
               (self.lines[i].address + self.lines[i].length)))
                 or (((i + 1) == len(self.lines)) and
                     (self.cursorAddr
                      == (self.lines[i].address + self.lines[i].length)))):
             if i < self.topLine:
                 self.topLine = i
             elif i > (self.topLine + self.visibleRows - 1):
                 self.topLine = i - (self.visibleRows - 1)
             self.updatingScrollBar = True
             addr = self.lines[self.topLine].address
             self.verticalScrollBar().setValue(
                 self.getContiguousOffsetForAddress(addr) //
                 self.scrollBarMultiplier)
             self.updatingScrollBar = False
             self.updateCache()
             self.viewport().update()
             found = True
             break
     if not found:
         self.setTopToAddress(self.cursorAddr)
         self.refreshLines()
         self.showContextAroundTop()
     # Force caret to be visible and repaint
     self.caretBlink = True
     self.cursorTimer.stop()
     self.cursorTimer.start()
     self.updateCaret()
     UIContext.updateStatus()
예제 #2
0
 def selectNone(self):
     for i in self.lines:
         if (self.cursorAddr >=
                 i.address) and (self.cursorAddr <
                                 (i.address + i.length)) and i.separator:
             self.cursorAddr = i.address + i.length
             break
     self.selectionStartAddr = self.cursorAddr
     if self.selectionVisible:
         self.viewport().update()
     self.repositionCaret()
     UIContext.updateStatus()
예제 #3
0
 def refreshLines(self):
     addr = self.topAddr
     self.lines = []
     self.topLine = 0
     self.bottomAddr = self.topAddr
     self.updateRanges()
     if self.allocatedLength > 0x7fffffff:
         self.scrollBarMultiplier = (self.allocatedLength // 0x7fffffff) + 1
     else:
         self.scrollBarMultiplier = 1
     self.updatingScrollBar = True
     self.verticalScrollBar().setRange(0, (self.allocatedLength - 1) //
                                       self.scrollBarMultiplier)
     self.verticalScrollBar().setValue(
         self.getContiguousOffsetForAddress(addr) //
         self.scrollBarMultiplier)
     self.updatingScrollBar = False
     self.updateCache()
     self.viewport().update()
     UIContext.updateStatus()
예제 #4
0
 def setCurrentOffset(self, offset):
     #log.log_debug('setCurrentOffset(0x%X)' % offset)
     self.rootSelectionStart = offset
     UIContext.updateStatus(True)
예제 #5
0
 def setCurrentOffset(self, offset):
     self.currentOffset = offset
     UIContext.updateStatus(True)
예제 #6
0
 def selectAll(self):
     self.selectionStartAddr = self.getStart()
     self.cursorAddr = self.getEnd()
     self.viewport().update()
     UIContext.updateStatus()