UIHexEditorWnd::UIHexEditorWnd( QWidget* p ) : QAbstractScrollArea( p ) { gapSizeAddrHex = 10; gapSizeHexText = 16; bytesPerLine = 16; bytesPerGroup = 2; nibblesPerGroup = bytesPerGroup * 2; hexCharsInLine = bytesPerLine * 2 + (bytesPerLine / bytesPerGroup) - 1; textEdit = false; setStartAddress(0); setEndAddress(0xFFFFFFFF); setAddrAreaColor(this->palette().color(QPalette::AlternateBase)); adjustSettings(); resetSelection(0); goToAddress(0); connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(sliderUpdate(int))); connect(&cursorTimer, SIGNAL(timeout()), this, SLOT(updateCursor())); cursorTimer.setInterval(500); cursorTimer.start(); connect(&autoScrollTimer, SIGNAL(timeout()), this, SLOT(autoScroll())); autoScrollTimer.setInterval(5); setMouseTracking(true); }
UIDisasm::UIDisasm( QWidget* p ) : QAbstractScrollArea( p ) { disassembleFunction = DisasmInstructionNull; address = 0; pc = 0xFFFFFFFF; instructionSize = 1; setSelectionColor(QColor(0x6d, 0x9e, 0xff, 0xff)); adjustSettings(); }
void UIHexEditorWnd::goToAddress(u32 address, bool setCursor) { int height = viewport()->height(); verticalScrollBar()->setValue(address/bytesPerLine); adjustSettings(); if (setCursor) { setCursorPos(address * 2); resetSelection(address * 2); } viewport()->update(); }
void UIDisasm::setMinimumInstructionSize(int instructionSize) { this->instructionSize = instructionSize; adjustSettings(); }
void UIDisasm::setEndAddress(u32 address) { endAddress = address; adjustSettings(); }
void UIHexEditorWnd::setFont(const QFont &font) { QWidget::setFont(font); adjustSettings(); setCursorPos(cursorAddr); }
void UIHexEditorWnd::setEndAddress(u32 address) { endAddress = address; adjustSettings(); }
void UIHexEditorWnd::setStartAddress(u32 address) { startAddress = address; adjustSettings(); }