Commit d1f48422 authored by pugmire's avatar pugmire
Browse files

add var flag.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11804 18c085ea-50e0-402c-830e-de6fd14e8384
parent 94dc3a3c
......@@ -79,7 +79,8 @@
//
// ****************************************************************************
QvisPointControl::QvisPointControl(QWidget *parent) :
QvisPointControl::QvisPointControl(QWidget *parent,
bool enableScaleByVar) :
QWidget(parent)
{
// Set some default values.
......@@ -122,12 +123,20 @@ QvisPointControl::QvisPointControl(QWidget *parent) :
this, SLOT(sizeVarToggled(bool)));
topLayout->addWidget(sizeVarToggle, 1, 0, 1, 2);
sizeVarButton = new QvisVariableButton(true, true, true,
QvisVariableButton::Scalars, this);
QvisVariableButton::Scalars, this);
sizeVarButton->setEnabled(false);
connect(sizeVarButton, SIGNAL(activated(const QString &)),
this, SLOT(sizeVarChanged(const QString &)));
topLayout->addWidget(sizeVarButton, 1, 2);
if (!enableScaleByVar)
{
sizeVarToggle->hide();
sizeVarButton->hide();
sizeVarToggle->setEnabled(false);
sizeVarButton->setEnabled(false);
}
SetPointSize(lastGoodSize);
SetPointSizeVar(lastGoodVar);
}
......@@ -404,9 +413,12 @@ QvisPointControl::typeComboBoxChanged(int type)
void
QvisPointControl::sizeVarToggled(bool val)
{
sizeVarButton->setEnabled(val);
if (!signalsBlocked())
emit pointSizeVarToggled(val);
if (sizeVarButton && sizeVarToggle)
{
sizeVarButton->setEnabled(val);
if (!signalsBlocked())
emit pointSizeVarToggled(val);
}
}
......@@ -506,10 +518,13 @@ QvisPointControl::UpdateSizeText()
void QvisPointControl::SetPointSizeVarChecked(bool checked)
{
sizeVarToggle->blockSignals(true);
sizeVarToggle->setChecked(checked);
sizeVarToggle->blockSignals(false);
sizeVarButton->setEnabled(checked);
if (sizeVarToggle && sizeVarButton)
{
sizeVarToggle->blockSignals(true);
sizeVarToggle->setChecked(checked);
sizeVarToggle->blockSignals(false);
sizeVarButton->setEnabled(checked);
}
}
......@@ -529,7 +544,7 @@ void QvisPointControl::SetPointSizeVarChecked(bool checked)
bool
QvisPointControl::GetPointSizeVarChecked() const
{
return sizeVarToggle->isChecked();
return sizeVarToggle && sizeVarToggle->isChecked();
}
......@@ -644,8 +659,11 @@ QvisPointControl::UpdatePointType()
else
sizeLabel->setText(tr("Point size (pixels)"));
sizeVarToggle->setEnabled(e);
sizeVarButton->setEnabled(e && sizeVarToggle->isChecked());
if (sizeVarToggle && sizeVarButton)
{
sizeVarToggle->setEnabled(e);
sizeVarButton->setEnabled(e && sizeVarToggle->isChecked());
}
}
// ****************************************************************************
......
......@@ -80,7 +80,8 @@ class GUI_API QvisPointControl : public QWidget
Q_OBJECT
public:
QvisPointControl(QWidget * parent=0);
QvisPointControl(QWidget * parent=0,
bool enableScaleByVar=true);
~QvisPointControl();
void SetPointSize(double);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment