Changed nametable scanline entry box to be a spin box instead of line edit widget.
This commit is contained in:
parent
5fcad9507e
commit
2169dd07fb
|
@ -143,9 +143,8 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
|||
QActionGroup *group;
|
||||
QLabel *lbl;
|
||||
QFont font;
|
||||
char stmp[64];
|
||||
//char stmp[64];
|
||||
int useNativeMenuBar;
|
||||
fceuDecIntValidtor *validator;
|
||||
|
||||
font.setFamily("Courier New");
|
||||
font.setStyle( QFont::StyleNormal );
|
||||
|
@ -502,19 +501,15 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
|||
|
||||
hbox = new QHBoxLayout();
|
||||
|
||||
scanLineEdit = new QLineEdit();
|
||||
scanLineEdit = new QSpinBox();
|
||||
scanLineEdit->setRange( 0, 255 );
|
||||
scanLineEdit->setValue( NTViewScanline );
|
||||
hbox->addWidget( new QLabel( tr("Display on Scanline:") ), 1, Qt::AlignRight );
|
||||
hbox->addWidget( scanLineEdit, 1, Qt::AlignLeft );
|
||||
|
||||
hbox1->addLayout( hbox, 1 );
|
||||
|
||||
validator = new fceuDecIntValidtor( 0, 255, this );
|
||||
scanLineEdit->setMaxLength( 3 );
|
||||
scanLineEdit->setValidator( validator );
|
||||
sprintf( stmp, "%i", NTViewScanline );
|
||||
scanLineEdit->setText( tr(stmp) );
|
||||
|
||||
connect( scanLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(scanLineChanged(const QString &)));
|
||||
connect( scanLineEdit, SIGNAL(valueChanged(int)), this, SLOT(scanLineChanged(int)));
|
||||
|
||||
FCEUD_UpdateNTView( -1, true);
|
||||
|
||||
|
@ -762,21 +757,10 @@ void ppuNameTableViewerDialog_t::updateMirrorText(void)
|
|||
mirrorLbl->setText( tr(txt) );
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ppuNameTableViewerDialog_t::scanLineChanged( const QString &txt )
|
||||
void ppuNameTableViewerDialog_t::scanLineChanged(int val)
|
||||
{
|
||||
std::string s;
|
||||
|
||||
s = txt.toStdString();
|
||||
|
||||
if ( s.size() > 0 )
|
||||
{
|
||||
NTViewScanline = strtoul( s.c_str(), NULL, 10 );
|
||||
}
|
||||
else
|
||||
{
|
||||
NTViewScanline = 0;
|
||||
}
|
||||
//printf("ScanLine: '%s' %i\n", s.c_str(), NTViewScanline );
|
||||
NTViewScanline = val;
|
||||
//printf("ScanLine: %i\n", NTViewScanline );
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ppuNameTableViewerDialog_t::menuScrollLinesChanged(bool checked)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <QFrame>
|
||||
#include <QTimer>
|
||||
#include <QSlider>
|
||||
#include <QSpinBox>
|
||||
#include <QLineEdit>
|
||||
#include <QGroupBox>
|
||||
#include <QScrollArea>
|
||||
|
@ -198,7 +199,7 @@ class ppuNameTableViewerDialog_t : public QDialog
|
|||
QCheckBox *showAttrGridCbox;
|
||||
QCheckBox *showAttrbCbox;
|
||||
QCheckBox *ignorePaletteCbox;
|
||||
QLineEdit *scanLineEdit;
|
||||
QSpinBox *scanLineEdit;
|
||||
QTimer *updateTimer;
|
||||
QLineEdit *ppuAddrLbl;
|
||||
QLineEdit *nameTableLbl;
|
||||
|
@ -231,7 +232,7 @@ class ppuNameTableViewerDialog_t : public QDialog
|
|||
void showTileGridChanged(int state);
|
||||
void showAttrGridChanged(int state);
|
||||
void showScrollLinesChanged(int state);
|
||||
void scanLineChanged( const QString &txt );
|
||||
void scanLineChanged(int value);
|
||||
void menuScrollLinesChanged( bool checked );
|
||||
void menuTileGridLinesChanged( bool checked );
|
||||
void menuAttrGridLinesChanged( bool checked );
|
||||
|
|
|
@ -245,7 +245,7 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent)
|
|||
patternView[1]->setTileLabel( tileLabel[1] );
|
||||
paletteView->setTileLabel( paletteFrame );
|
||||
|
||||
scanLineEdit->setRange( 0, 256 );
|
||||
scanLineEdit->setRange( 0, 255 );
|
||||
scanLineEdit->setValue( PPUViewScanline );
|
||||
|
||||
connect( scanLineEdit, SIGNAL(valueChanged(int)), this, SLOT(scanLineChanged(int)));
|
||||
|
@ -2705,7 +2705,7 @@ spriteViewerDialog_t::spriteViewerDialog_t(QWidget *parent)
|
|||
cpuPagIdx = new QSpinBox(this);
|
||||
|
||||
scanLineEdit = new QSpinBox(this);
|
||||
scanLineEdit->setRange( 0, 256 );
|
||||
scanLineEdit->setRange( 0, 255 );
|
||||
scanLineEdit->setValue( PPUViewScanline );
|
||||
|
||||
connect( scanLineEdit, SIGNAL(valueChanged(int)), this, SLOT(scanLineChanged(int)));
|
||||
|
|
Loading…
Reference in New Issue