704 @type bytearray or QByteArray |
704 @type bytearray or QByteArray |
705 """ |
705 """ |
706 self.__undoStack.insertByteArray(pos, bytearray(byteArray)) |
706 self.__undoStack.insertByteArray(pos, bytearray(byteArray)) |
707 self.__refresh() |
707 self.__refresh() |
708 |
708 |
709 def replaceByteArray(self, pos, len, byteArray): |
709 def replaceByteArray(self, pos, length, byteArray): |
710 """ |
710 """ |
711 Public method to replace bytes. |
711 Public method to replace bytes. |
712 |
712 |
713 @param pos position to replace the bytes at |
713 @param pos position to replace the bytes at |
714 @type int |
714 @type int |
715 @param len amount of bytes to replace |
715 @param length amount of bytes to replace |
716 @type int |
716 @type int |
717 @param byteArray bytes to replace with |
717 @param byteArray bytes to replace with |
718 @type bytearray or QByteArray |
718 @type bytearray or QByteArray |
719 """ |
719 """ |
720 self.__undoStack.overwriteByteArray(pos, len, bytearray(byteArray)) |
720 self.__undoStack.overwriteByteArray(pos, length, bytearray(byteArray)) |
721 self.__refresh() |
721 self.__refresh() |
722 |
722 |
723 def cursorPositionFromPoint(self, point): |
723 def cursorPositionFromPoint(self, point): |
724 """ |
724 """ |
725 Public method to calculate a cursor position from a graphics position. |
725 Public method to calculate a cursor position from a graphics position. |
1424 pxPosY - self.__pxCharHeight + |
1424 pxPosY - self.__pxCharHeight + |
1425 self.__pxSelectionSub, |
1425 self.__pxSelectionSub, |
1426 3 * self.__pxCharWidth, |
1426 3 * self.__pxCharWidth, |
1427 self.__pxCharHeight) |
1427 self.__pxCharHeight) |
1428 painter.fillRect(r, c) |
1428 painter.fillRect(r, c) |
1429 hex = chr(self.__hexDataShown[(bPosLine + colIdx) * 2]) + \ |
1429 hexStr = \ |
|
1430 chr(self.__hexDataShown[(bPosLine + colIdx) * 2]) + \ |
1430 chr(self.__hexDataShown[(bPosLine + colIdx) * 2 + 1]) |
1431 chr(self.__hexDataShown[(bPosLine + colIdx) * 2 + 1]) |
1431 painter.drawText(pxPosX, pxPosY, hex) |
1432 painter.drawText(pxPosX, pxPosY, hexStr) |
1432 pxPosX += 3 * self.__pxCharWidth |
1433 pxPosX += 3 * self.__pxCharWidth |
1433 |
1434 |
1434 # render ascii value |
1435 # render ascii value |
1435 if self.__asciiArea: |
1436 if self.__asciiArea: |
1436 by = self.__dataShown[bPosLine + colIdx] |
1437 by = self.__dataShown[bPosLine + colIdx] |