Changed video scanline entry fields to use QSpinBox instead of QLineEdit. The spin box has better range limiting controls.
This commit is contained in:
parent
9c6f895e2a
commit
d46ef48d55
|
@ -43,10 +43,8 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
||||||
QStyle *style;
|
QStyle *style;
|
||||||
QGroupBox *gbox;
|
QGroupBox *gbox;
|
||||||
QGridLayout *grid;
|
QGridLayout *grid;
|
||||||
fceuDecIntValidtor *validator;
|
|
||||||
QFont font;
|
QFont font;
|
||||||
int opt, fontCharWidth;
|
int opt, fontCharWidth;
|
||||||
char stmp[128];
|
|
||||||
|
|
||||||
font.setFamily("Courier New");
|
font.setFamily("Courier New");
|
||||||
font.setStyle( QFont::StyleNormal );
|
font.setStyle( QFont::StyleNormal );
|
||||||
|
@ -204,7 +202,6 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
||||||
vbox1->addWidget( new_PPU_ena );
|
vbox1->addWidget( new_PPU_ena );
|
||||||
vbox1->addWidget( frmskipcbx );
|
vbox1->addWidget( frmskipcbx );
|
||||||
vbox1->addWidget( sprtLimCbx );
|
vbox1->addWidget( sprtLimCbx );
|
||||||
//vbox1->addWidget( clipSidesCbx);
|
|
||||||
vbox1->addWidget( drawInputAidsCbx );
|
vbox1->addWidget( drawInputAidsCbx );
|
||||||
vbox1->addWidget( showFPS_cbx );
|
vbox1->addWidget( showFPS_cbx );
|
||||||
vbox1->addWidget( autoScaleCbx);
|
vbox1->addWidget( autoScaleCbx);
|
||||||
|
@ -306,63 +303,52 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
||||||
vbox2->addWidget( gbox, 1 );
|
vbox2->addWidget( gbox, 1 );
|
||||||
gbox->setLayout(grid);
|
gbox->setLayout(grid);
|
||||||
|
|
||||||
ntsc_start = new QLineEdit();
|
ntsc_start = new QSpinBox();
|
||||||
ntsc_end = new QLineEdit();
|
ntsc_end = new QSpinBox();
|
||||||
pal_start = new QLineEdit();
|
pal_start = new QSpinBox();
|
||||||
pal_end = new QLineEdit();
|
pal_end = new QSpinBox();
|
||||||
|
|
||||||
|
ntsc_start->setRange( 0, 239 );
|
||||||
|
ntsc_end->setRange( 0, 239 );
|
||||||
|
pal_start->setRange( 0, 239 );
|
||||||
|
pal_end->setRange( 0, 239 );
|
||||||
|
|
||||||
validator = new fceuDecIntValidtor( 0, 239, this );
|
|
||||||
ntsc_start->setFont( font );
|
ntsc_start->setFont( font );
|
||||||
ntsc_start->setMaxLength( 3 );
|
ntsc_end->setFont( font );
|
||||||
ntsc_start->setValidator( validator );
|
pal_start->setFont( font );
|
||||||
ntsc_start->setAlignment(Qt::AlignCenter);
|
pal_end->setFont( font );
|
||||||
ntsc_start->setMaximumWidth( 8 * fontCharWidth );
|
|
||||||
ntsc_start->setCursorPosition(0);
|
|
||||||
|
|
||||||
validator = new fceuDecIntValidtor( 0, 239, this );
|
ntsc_start->setMinimumWidth( fontCharWidth * 8 );
|
||||||
ntsc_end->setFont( font );
|
ntsc_end->setMinimumWidth( fontCharWidth * 8 );
|
||||||
ntsc_end->setMaxLength( 3 );
|
pal_start->setMinimumWidth( fontCharWidth * 8 );
|
||||||
ntsc_end->setValidator( validator );
|
pal_end->setMinimumWidth( fontCharWidth * 8 );
|
||||||
ntsc_end->setAlignment(Qt::AlignCenter);
|
|
||||||
ntsc_end->setMaximumWidth( 8 * fontCharWidth );
|
|
||||||
ntsc_end->setCursorPosition(0);
|
|
||||||
|
|
||||||
validator = new fceuDecIntValidtor( 0, 239, this );
|
ntsc_start->setMaximumWidth( fontCharWidth * 8 );
|
||||||
pal_start->setFont( font );
|
ntsc_end->setMaximumWidth( fontCharWidth * 8 );
|
||||||
pal_start->setMaxLength( 3 );
|
pal_start->setMaximumWidth( fontCharWidth * 8 );
|
||||||
pal_start->setValidator( validator );
|
pal_end->setMaximumWidth( fontCharWidth * 8 );
|
||||||
pal_start->setAlignment(Qt::AlignCenter);
|
|
||||||
pal_start->setMaximumWidth( 8 * fontCharWidth );
|
|
||||||
pal_start->setCursorPosition(0);
|
|
||||||
|
|
||||||
validator = new fceuDecIntValidtor( 0, 239, this );
|
|
||||||
pal_end->setFont( font );
|
|
||||||
pal_end->setMaxLength( 3 );
|
|
||||||
pal_end->setValidator( validator );
|
|
||||||
pal_end->setAlignment(Qt::AlignCenter);
|
|
||||||
pal_end->setMaximumWidth( 8 * fontCharWidth );
|
|
||||||
pal_end->setCursorPosition(0);
|
|
||||||
|
|
||||||
g_config->getOption("SDL.ScanLineStartNTSC", &opt);
|
g_config->getOption("SDL.ScanLineStartNTSC", &opt);
|
||||||
sprintf( stmp, "%i", opt );
|
ntsc_start->setValue( opt );
|
||||||
ntsc_start->setText( tr(stmp) );
|
|
||||||
|
|
||||||
g_config->getOption("SDL.ScanLineEndNTSC", &opt);
|
g_config->getOption("SDL.ScanLineEndNTSC", &opt);
|
||||||
sprintf( stmp, "%i", opt );
|
ntsc_end->setValue( opt );
|
||||||
ntsc_end->setText( tr(stmp) );
|
|
||||||
|
|
||||||
g_config->getOption("SDL.ScanLineStartPAL", &opt);
|
g_config->getOption("SDL.ScanLineStartPAL", &opt);
|
||||||
sprintf( stmp, "%i", opt );
|
pal_start->setValue( opt );
|
||||||
pal_start->setText( tr(stmp) );
|
|
||||||
|
|
||||||
g_config->getOption("SDL.ScanLineEndPAL", &opt);
|
g_config->getOption("SDL.ScanLineEndPAL", &opt);
|
||||||
sprintf( stmp, "%i", opt );
|
pal_end->setValue( opt );
|
||||||
pal_end->setText( tr(stmp) );
|
|
||||||
|
|
||||||
connect( ntsc_start, SIGNAL(textEdited(const QString &)), this, SLOT(ntscStartScanLineChanged(const QString &)));
|
ntsc_start->setRange( 0, ntsc_end->value() );
|
||||||
connect( ntsc_end , SIGNAL(textEdited(const QString &)), this, SLOT(ntscEndScanLineChanged(const QString &)));
|
ntsc_end->setRange( ntsc_start->value(), 239 );
|
||||||
connect( pal_start , SIGNAL(textEdited(const QString &)), this, SLOT(palStartScanLineChanged(const QString &)));
|
pal_start->setRange( 0, pal_end->value() );
|
||||||
connect( pal_end , SIGNAL(textEdited(const QString &)), this, SLOT(palEndScanLineChanged(const QString &)));
|
pal_end->setRange( pal_start->value(), 239 );
|
||||||
|
|
||||||
|
connect( ntsc_start, SIGNAL(valueChanged(int)), this, SLOT(ntscStartScanLineChanged(int)));
|
||||||
|
connect( ntsc_end , SIGNAL(valueChanged(int)), this, SLOT(ntscEndScanLineChanged(int)));
|
||||||
|
connect( pal_start , SIGNAL(valueChanged(int)), this, SLOT(palStartScanLineChanged(int)));
|
||||||
|
connect( pal_end , SIGNAL(valueChanged(int)), this, SLOT(palEndScanLineChanged(int)));
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("NTSC") ) , 0, 1, Qt::AlignLeft);
|
grid->addWidget( new QLabel( tr("NTSC") ) , 0, 1, Qt::AlignLeft);
|
||||||
grid->addWidget( new QLabel( tr("PAL/Dendy") ) , 0, 2, Qt::AlignLeft);
|
grid->addWidget( new QLabel( tr("PAL/Dendy") ) , 0, 2, Qt::AlignLeft);
|
||||||
|
@ -511,88 +497,76 @@ void ConsoleVideoConfDialog_t::updateReadouts(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ConsoleVideoConfDialog_t::ntscStartScanLineChanged(const QString &txt)
|
void ConsoleVideoConfDialog_t::ntscStartScanLineChanged(int value)
|
||||||
{
|
{
|
||||||
int opt, opt2;
|
int opt, opt2;
|
||||||
std::string s;
|
|
||||||
|
|
||||||
s = txt.toStdString();
|
opt = value;
|
||||||
|
|
||||||
if ( s.size() > 0 )
|
g_config->getOption("SDL.ScanLineEndNTSC", &opt2);
|
||||||
|
|
||||||
|
if ( opt > opt2 )
|
||||||
{
|
{
|
||||||
opt = strtoul( s.c_str(), NULL, 10 );
|
opt = opt2;
|
||||||
|
|
||||||
g_config->getOption("SDL.ScanLineEndNTSC", &opt2);
|
|
||||||
|
|
||||||
if ( opt > opt2 )
|
|
||||||
{
|
|
||||||
opt = opt2;
|
|
||||||
}
|
|
||||||
g_config->setOption("SDL.ScanLineStartNTSC", opt);
|
|
||||||
}
|
}
|
||||||
|
g_config->setOption("SDL.ScanLineStartNTSC", opt);
|
||||||
|
|
||||||
|
ntsc_start->setRange( 0, opt2 );
|
||||||
|
ntsc_end->setRange( opt, 239 );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ConsoleVideoConfDialog_t::ntscEndScanLineChanged(const QString &txt)
|
void ConsoleVideoConfDialog_t::ntscEndScanLineChanged(int value)
|
||||||
{
|
{
|
||||||
int opt, opt2;
|
int opt, opt2;
|
||||||
std::string s;
|
|
||||||
|
|
||||||
s = txt.toStdString();
|
opt = value;
|
||||||
|
|
||||||
if ( s.size() > 0 )
|
g_config->getOption("SDL.ScanLineStartNTSC", &opt2);
|
||||||
|
|
||||||
|
if ( opt < opt2 )
|
||||||
{
|
{
|
||||||
opt = strtoul( s.c_str(), NULL, 10 );
|
opt = opt2;
|
||||||
|
|
||||||
g_config->getOption("SDL.ScanLineStartNTSC", &opt2);
|
|
||||||
|
|
||||||
if ( opt < opt2 )
|
|
||||||
{
|
|
||||||
opt = opt2;
|
|
||||||
}
|
|
||||||
g_config->setOption("SDL.ScanLineEndNTSC", opt);
|
|
||||||
}
|
}
|
||||||
|
g_config->setOption("SDL.ScanLineEndNTSC", opt);
|
||||||
|
|
||||||
|
ntsc_start->setRange( 0, opt );
|
||||||
|
ntsc_end->setRange( opt2, 239 );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ConsoleVideoConfDialog_t::palStartScanLineChanged(const QString &txt)
|
void ConsoleVideoConfDialog_t::palStartScanLineChanged(int value)
|
||||||
{
|
{
|
||||||
int opt, opt2;
|
int opt, opt2;
|
||||||
std::string s;
|
|
||||||
|
|
||||||
s = txt.toStdString();
|
opt = value;
|
||||||
|
|
||||||
if ( s.size() > 0 )
|
g_config->getOption("SDL.ScanLineEndPAL", &opt2);
|
||||||
|
|
||||||
|
if ( opt > opt2 )
|
||||||
{
|
{
|
||||||
opt = strtoul( s.c_str(), NULL, 10 );
|
opt = opt2;
|
||||||
|
|
||||||
g_config->getOption("SDL.ScanLineEndPAL", &opt2);
|
|
||||||
|
|
||||||
if ( opt > opt2 )
|
|
||||||
{
|
|
||||||
opt = opt2;
|
|
||||||
}
|
|
||||||
g_config->setOption("SDL.ScanLineStartPAL", opt);
|
|
||||||
}
|
}
|
||||||
|
g_config->setOption("SDL.ScanLineStartPAL", opt);
|
||||||
|
|
||||||
|
pal_start->setRange( 0, opt2 );
|
||||||
|
pal_end->setRange( opt, 239 );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ConsoleVideoConfDialog_t::palEndScanLineChanged(const QString &txt)
|
void ConsoleVideoConfDialog_t::palEndScanLineChanged(int value)
|
||||||
{
|
{
|
||||||
int opt, opt2;
|
int opt, opt2;
|
||||||
std::string s;
|
|
||||||
|
|
||||||
s = txt.toStdString();
|
opt = value;
|
||||||
|
|
||||||
if ( s.size() > 0 )
|
g_config->getOption("SDL.ScanLineStartPAL", &opt2);
|
||||||
|
|
||||||
|
if ( opt < opt2 )
|
||||||
{
|
{
|
||||||
opt = strtoul( s.c_str(), NULL, 10 );
|
opt = opt2;
|
||||||
|
|
||||||
g_config->getOption("SDL.ScanLineStartPAL", &opt2);
|
|
||||||
|
|
||||||
if ( opt < opt2 )
|
|
||||||
{
|
|
||||||
opt = opt2;
|
|
||||||
}
|
|
||||||
g_config->setOption("SDL.ScanLineEndPAL", opt);
|
|
||||||
}
|
}
|
||||||
|
g_config->setOption("SDL.ScanLineEndPAL", opt);
|
||||||
|
|
||||||
|
pal_start->setRange( 0, opt );
|
||||||
|
pal_end->setRange( opt2, 239 );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ConsoleVideoConfDialog_t::setCheckBoxFromProperty( QCheckBox *cbx, const char *property )
|
void ConsoleVideoConfDialog_t::setCheckBoxFromProperty( QCheckBox *cbx, const char *property )
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QSpinBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QSlider>
|
#include <QSlider>
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
|
@ -51,10 +52,10 @@ class ConsoleVideoConfDialog_t : public QDialog
|
||||||
QLabel *aspectSelectLabel;
|
QLabel *aspectSelectLabel;
|
||||||
QLabel *xScaleLabel;
|
QLabel *xScaleLabel;
|
||||||
QLabel *yScaleLabel;
|
QLabel *yScaleLabel;
|
||||||
QLineEdit *ntsc_start;
|
QSpinBox *ntsc_start;
|
||||||
QLineEdit *ntsc_end;
|
QSpinBox *ntsc_end;
|
||||||
QLineEdit *pal_start;
|
QSpinBox *pal_start;
|
||||||
QLineEdit *pal_end;
|
QSpinBox *pal_end;
|
||||||
QLineEdit *winSizeReadout;
|
QLineEdit *winSizeReadout;
|
||||||
QLineEdit *vpSizeReadout;
|
QLineEdit *vpSizeReadout;
|
||||||
|
|
||||||
|
@ -88,10 +89,10 @@ class ConsoleVideoConfDialog_t : public QDialog
|
||||||
void cursorVisChanged(int value);
|
void cursorVisChanged(int value);
|
||||||
void drawInputAidsChanged(int value);
|
void drawInputAidsChanged(int value);
|
||||||
void applyChanges( void );
|
void applyChanges( void );
|
||||||
void ntscStartScanLineChanged(const QString &);
|
void ntscStartScanLineChanged(int value);
|
||||||
void ntscEndScanLineChanged(const QString &);
|
void ntscEndScanLineChanged(int value);
|
||||||
void palStartScanLineChanged(const QString &);
|
void palStartScanLineChanged(int value);
|
||||||
void palEndScanLineChanged(const QString &);
|
void palEndScanLineChanged(int value);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue