Example #1
0
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);
}
Example #2
0
UIDisasm::UIDisasm( QWidget* p )
	: QAbstractScrollArea( p )
{
   disassembleFunction = DisasmInstructionNull;
   address = 0;
   pc = 0xFFFFFFFF;
   instructionSize = 1;

   setSelectionColor(QColor(0x6d, 0x9e, 0xff, 0xff));

   adjustSettings();
}
Example #3
0
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();
}
Example #4
0
void UIDisasm::setMinimumInstructionSize(int instructionSize)
{
   this->instructionSize = instructionSize;
   adjustSettings();
}
Example #5
0
void UIDisasm::setEndAddress(u32 address)
{
   endAddress = address;
   adjustSettings();
}
Example #6
0
void UIHexEditorWnd::setFont(const QFont &font)
{
   QWidget::setFont(font);
   adjustSettings();
   setCursorPos(cursorAddr);
}
Example #7
0
void UIHexEditorWnd::setEndAddress(u32 address)
{
   endAddress = address;
   adjustSettings();
}
Example #8
0
void UIHexEditorWnd::setStartAddress(u32 address)
{
   startAddress = address;
   adjustSettings();
}