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;
|
QActionGroup *group;
|
||||||
QLabel *lbl;
|
QLabel *lbl;
|
||||||
QFont font;
|
QFont font;
|
||||||
char stmp[64];
|
//char stmp[64];
|
||||||
int useNativeMenuBar;
|
int useNativeMenuBar;
|
||||||
fceuDecIntValidtor *validator;
|
|
||||||
|
|
||||||
font.setFamily("Courier New");
|
font.setFamily("Courier New");
|
||||||
font.setStyle( QFont::StyleNormal );
|
font.setStyle( QFont::StyleNormal );
|
||||||
|
@ -502,19 +501,15 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
||||||
|
|
||||||
hbox = new QHBoxLayout();
|
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( new QLabel( tr("Display on Scanline:") ), 1, Qt::AlignRight );
|
||||||
hbox->addWidget( scanLineEdit, 1, Qt::AlignLeft );
|
hbox->addWidget( scanLineEdit, 1, Qt::AlignLeft );
|
||||||
|
|
||||||
hbox1->addLayout( hbox, 1 );
|
hbox1->addLayout( hbox, 1 );
|
||||||
|
|
||||||
validator = new fceuDecIntValidtor( 0, 255, this );
|
connect( scanLineEdit, SIGNAL(valueChanged(int)), this, SLOT(scanLineChanged(int)));
|
||||||
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 &)));
|
|
||||||
|
|
||||||
FCEUD_UpdateNTView( -1, true);
|
FCEUD_UpdateNTView( -1, true);
|
||||||
|
|
||||||
|
@ -762,21 +757,10 @@ void ppuNameTableViewerDialog_t::updateMirrorText(void)
|
||||||
mirrorLbl->setText( tr(txt) );
|
mirrorLbl->setText( tr(txt) );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ppuNameTableViewerDialog_t::scanLineChanged( const QString &txt )
|
void ppuNameTableViewerDialog_t::scanLineChanged(int val)
|
||||||
{
|
{
|
||||||
std::string s;
|
NTViewScanline = val;
|
||||||
|
//printf("ScanLine: %i\n", NTViewScanline );
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ppuNameTableViewerDialog_t::menuScrollLinesChanged(bool checked)
|
void ppuNameTableViewerDialog_t::menuScrollLinesChanged(bool checked)
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QSlider>
|
#include <QSlider>
|
||||||
|
#include <QSpinBox>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
|
@ -198,7 +199,7 @@ class ppuNameTableViewerDialog_t : public QDialog
|
||||||
QCheckBox *showAttrGridCbox;
|
QCheckBox *showAttrGridCbox;
|
||||||
QCheckBox *showAttrbCbox;
|
QCheckBox *showAttrbCbox;
|
||||||
QCheckBox *ignorePaletteCbox;
|
QCheckBox *ignorePaletteCbox;
|
||||||
QLineEdit *scanLineEdit;
|
QSpinBox *scanLineEdit;
|
||||||
QTimer *updateTimer;
|
QTimer *updateTimer;
|
||||||
QLineEdit *ppuAddrLbl;
|
QLineEdit *ppuAddrLbl;
|
||||||
QLineEdit *nameTableLbl;
|
QLineEdit *nameTableLbl;
|
||||||
|
@ -231,7 +232,7 @@ class ppuNameTableViewerDialog_t : public QDialog
|
||||||
void showTileGridChanged(int state);
|
void showTileGridChanged(int state);
|
||||||
void showAttrGridChanged(int state);
|
void showAttrGridChanged(int state);
|
||||||
void showScrollLinesChanged(int state);
|
void showScrollLinesChanged(int state);
|
||||||
void scanLineChanged( const QString &txt );
|
void scanLineChanged(int value);
|
||||||
void menuScrollLinesChanged( bool checked );
|
void menuScrollLinesChanged( bool checked );
|
||||||
void menuTileGridLinesChanged( bool checked );
|
void menuTileGridLinesChanged( bool checked );
|
||||||
void menuAttrGridLinesChanged( bool checked );
|
void menuAttrGridLinesChanged( bool checked );
|
||||||
|
|
|
@ -245,7 +245,7 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent)
|
||||||
patternView[1]->setTileLabel( tileLabel[1] );
|
patternView[1]->setTileLabel( tileLabel[1] );
|
||||||
paletteView->setTileLabel( paletteFrame );
|
paletteView->setTileLabel( paletteFrame );
|
||||||
|
|
||||||
scanLineEdit->setRange( 0, 256 );
|
scanLineEdit->setRange( 0, 255 );
|
||||||
scanLineEdit->setValue( PPUViewScanline );
|
scanLineEdit->setValue( PPUViewScanline );
|
||||||
|
|
||||||
connect( scanLineEdit, SIGNAL(valueChanged(int)), this, SLOT(scanLineChanged(int)));
|
connect( scanLineEdit, SIGNAL(valueChanged(int)), this, SLOT(scanLineChanged(int)));
|
||||||
|
@ -2705,7 +2705,7 @@ spriteViewerDialog_t::spriteViewerDialog_t(QWidget *parent)
|
||||||
cpuPagIdx = new QSpinBox(this);
|
cpuPagIdx = new QSpinBox(this);
|
||||||
|
|
||||||
scanLineEdit = new QSpinBox(this);
|
scanLineEdit = new QSpinBox(this);
|
||||||
scanLineEdit->setRange( 0, 256 );
|
scanLineEdit->setRange( 0, 255 );
|
||||||
scanLineEdit->setValue( PPUViewScanline );
|
scanLineEdit->setValue( PPUViewScanline );
|
||||||
|
|
||||||
connect( scanLineEdit, SIGNAL(valueChanged(int)), this, SLOT(scanLineChanged(int)));
|
connect( scanLineEdit, SIGNAL(valueChanged(int)), this, SLOT(scanLineChanged(int)));
|
||||||
|
|
Loading…
Reference in New Issue