def __init__(self, mem, syms=None, parent=None):
e_memcanvas.MemoryCanvas.__init__(self, mem, syms=syms)
QtWidgets.QPlainTextEdit.__init__(self, parent=parent)
self.setReadOnly(True)
self.cursorPositionChanged.connect(self._cursorChanged)
self._highlighter = VivCanvasColors()
self.setCurrentCharFormat(self._highlighter.getFormat(ContentTagsEnum.DEFAULT))
self._cur_line_bg_color = self._highlighter.getColors(ContentTagsEnum.CURRENT_LINE)[1]
self._canv_cache = None
self._canv_curva = None
self._canv_rend_middle = False
self._do_heavy_highlight = False
# keep track of highlighted blocks
self._high_blocks = dict()
self._high_bg_color = self._highlighter.getColors(ContentTagsEnum.HIGHLIGHT)[1]
self._high_bg = QtGui.QBrush(self._high_bg_color)
# Allow our parent to handle these...
self.setAcceptDrops(False)
# in case we want this canvas to display only a fixed amount of data at any time
# useful for the function graph where one canvas renders one basic block of code etc.
self._fixed_location = False
# also in such cases we would like to know when the rendering of the given fixed region is done
# because this rendering is done asynchronously in another thread
self._render_counter = 0
self._render_counter_lock = threading.Lock()
self._max_text_width = 0
self._cur_line_width = 0
self._lines_height = 0
评论列表
文章目录