X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fdebug%2Fmemorybrowser.cpp;h=45bae7f7883f87d2a1b2259db8754bd7a69fb627;hb=48dd9ba5b6742935eef61cec80964afe093139ad;hp=b67ff3271b0c6b5cbf9c039598377ed28662b31e;hpb=8fa19895c8308c0a1aee537f971c740eea4bab9e;p=virtualjaguar diff --git a/src/gui/debug/memorybrowser.cpp b/src/gui/debug/memorybrowser.cpp index b67ff32..45bae7f 100644 --- a/src/gui/debug/memorybrowser.cpp +++ b/src/gui/debug/memorybrowser.cpp @@ -7,7 +7,7 @@ // JLH = James Hammons // // Who When What -// --- ---------- ------------------------------------------------------------- +// --- ---------- ----------------------------------------------------------- // JLH 08/14/2012 Created this file // @@ -22,22 +22,34 @@ MemoryBrowserWindow::MemoryBrowserWindow(QWidget * parent/*= 0*/): QWidget(paren // layout(new QVBoxLayout), text(new QTextBrowser), layout(new QVBoxLayout), text(new QLabel), refresh(new QPushButton(tr("Refresh"))), + address(new QLineEdit), + go(new QPushButton(tr("Go"))), memBase(0) { setWindowTitle(tr("Memory Browser")); + address->setInputMask("hhhhhh"); + QHBoxLayout * hbox1 = new QHBoxLayout; + hbox1->addWidget(refresh); + hbox1->addWidget(address); + hbox1->addWidget(go); + // Need to set the size as well... // resize(560, 480); - QFont fixedFont("Lucida Console", 10, QFont::Normal); + QFont fixedFont("Lucida Console", 8, QFont::Normal); +// QFont fixedFont("", 8, QFont::Normal); + fixedFont.setStyleHint(QFont::TypeWriter); text->setFont(fixedFont); //// layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); layout->addWidget(text); - layout->addWidget(refresh); +// layout->addWidget(refresh); + layout->addLayout(hbox1); connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); + connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); } @@ -83,7 +95,7 @@ void MemoryBrowserWindow::RefreshContents(void) void MemoryBrowserWindow::keyPressEvent(QKeyEvent * e) { - if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) + if (e->key() == Qt::Key_Escape) hide(); else if (e->key() == Qt::Key_PageUp) { @@ -122,3 +134,13 @@ void MemoryBrowserWindow::keyPressEvent(QKeyEvent * e) RefreshContents(); } } + + +void MemoryBrowserWindow::GoToAddress(void) +{ + bool ok; + QString newAddress = address->text(); + memBase = newAddress.toUInt(&ok, 16); + RefreshContents(); +} +