void NavigatorEditor::MessageReceived(BMessage *message)
{
	TRACE();
	switch(message->what) 
	{
		case P_C_VALUE_CHANGED:
		{
			ValueChanged();
			break;
		}
		case N_A_INVOKATION:
		{
			BListView	*source	= NULL;
			if (message->FindPointer("ListView",(void **) &source) == B_OK)
				InsertNewList(source);
			break;
		}
		case P_C_EDITOR_SWITCHED_ACTIV:
		{
			ValueChanged();
		}
		default:
			BView::MessageReceived(message);
			break;
	}
}
Esempio n. 2
0
// KeyDown
void
OptionValueView::KeyDown(const char* bytes, int32 numBytes)
{
	bool handled = fEnabled;
	if (fEnabled && numBytes > 0) {
		switch (bytes[0]) {
			case B_LEFT_ARROW:
			case B_UP_ARROW:
				fProperty->SetOptionAtOffset(-1);
				ValueChanged();
				break;

			case B_RIGHT_ARROW:
			case B_DOWN_ARROW:
				fProperty->SetOptionAtOffset(1);
				ValueChanged();
				break;
			default:
				handled = false;
				break;
		}
	}
	if (!handled)
		PropertyEditorView::KeyDown(bytes, numBytes);
}
Esempio n. 3
0
void QtMainWindow::SetupDocks()
{
    connect(ui->actionRefreshSceneGraph, SIGNAL(triggered()), QtMainWindowHandler::Instance(), SLOT(RefreshSceneGraph()));
	connect(ui->dockParticleEditor->widget(), SIGNAL(ChangeVisible(bool)), this, SLOT(ChangeParticleDockVisible(bool)));
	connect(ui->dockParticleEditorTimeLine->widget(), SIGNAL(ChangeVisible(bool)), this, SLOT(ChangeParticleDockTimeLineVisible(bool)));
	connect(ui->dockParticleEditorTimeLine->widget(), SIGNAL(ValueChanged()), ui->dockParticleEditor->widget(), SLOT(OnUpdate()));
	connect(ui->dockParticleEditor->widget(), SIGNAL(ValueChanged()), ui->dockParticleEditorTimeLine->widget(), SLOT(OnUpdate()));
	
	connect(ui->cbShowDAEFiles, SIGNAL(stateChanged(int)), this, SLOT(LibraryFileTypesChanged()));
	connect(ui->cbShowSC2Files, SIGNAL(stateChanged(int)), this, SLOT(LibraryFileTypesChanged()));
	
	connect(this, SIGNAL(LibraryFileTypesChanged(bool, bool)), ui->libraryView, SLOT(LibraryFileTypesChanged(bool, bool)));
}
void MWToolsOrientation::shortAction()
{
    ++m_currentstate;

    switch (m_currentstate)
    {
    case 1:
        m_value = "top";
        m_timestamp = Q_INT64_C(-1);
        setIcon(1);
        break;
    case 2:
        m_value = "left";
        m_timestamp = Q_INT64_C(-1);
        setIcon(2);
        break;
    case 3:
        m_value = "auto";
        m_timestamp = 0;
        m_currentstate=0;
        setIcon(0);
        break;
    }

    emit ValueChanged(QVariantList() << m_value, m_timestamp);
}
Esempio n. 5
0
void RangeBase::OnValueChanged(double oldValue, double newValue)
{
    if (ValueChanged)
    {
        ValueChanged(this, oldValue, newValue);
    }
}
Esempio n. 6
0
/* -------------------------------------------------------- */
void WDoubleLineEdit::slotCalcValue(double f)
{
    int    p;

    //cerr << "WDoubleLineEdit::slotCalcValue" << endl;
    if (f < m_fMinValue)
        f=m_fMinValue;
    else if (f > m_fMaxValue)
        f=m_fMaxValue;
    if (f != m_fValue || m_bFirst)
    {
        m_bFirst=false;
        m_fValue=f;
        //cerr << "WDoubleLineEdit::slotCalcValue m_fValue = " << m_fValue << endl;
        emit (ValueChanged(f));
        p=(int)(100.0*(f - m_fMinValue)/(m_fMaxValue - m_fMinValue));
        if (p != m_iPercent)
        {
//      cerr << "m_iPercent = " << m_iPercent << endl;
            emit (valuePercentChanged(p));
            m_iPercent=p;
        }
        update();
    }
//    validateAndSet(QString("%1").arg(m_fValue),0,0,0);
    this->setText(QString("%1").arg(m_fValue));
    this->setCursorPosition(0);
    this->setSelection(0, 0);
}
Esempio n. 7
0
void
BDecimalSpinner::SetValue(double value)
{
	// clip to range
	if (value < fMinValue)
		value = fMinValue;
	else if (value > fMaxValue)
		value = fMaxValue;

	// update the text view
	char* format;
	asprintf(&format, "%%.%" B_PRId32 "f", fPrecision);
	char* valueString;
	asprintf(&valueString, format, value);
	TextView()->SetText(valueString);
	free(format);
	free(valueString);

	// update the up and down arrows
	SetIncrementEnabled(IsEnabled() && value < fMaxValue);
	SetDecrementEnabled(IsEnabled() && value > fMinValue);

	if (value == fValue)
		return;

	fValue = value;
	ValueChanged();

	Invoke();
	Invalidate();
}
Esempio n. 8
0
void Slider::SetScrollBackbarPressed(RenderRectangle *icon)
{
	MultiTextureIcon* lpMulti = dynamic_cast<MultiTextureIcon*>(icon);
	Icon* lpIcon = dynamic_cast<Icon*>(icon);

	if(m_pScrollBackbarPressed)
	{
		// If we already own an icon, remove it from out component list and also delete it, since we will be replacing it
		Remove(m_pScrollBackbarPressed);

		delete m_pScrollBackbarPressed;
		m_pScrollBackbarPressed = NULL;
	}

	// Check what type of render rectangle we have been given, and then assign our new data
	if(lpMulti)
	{
		MultiTextureIcon* lpNewMulti = new MultiTextureIcon((*lpMulti));
		m_pScrollBackbarPressed = lpNewMulti;
	}
	else if(lpIcon)
	{
		Icon* lpNewIcon = new Icon((*lpIcon));
		m_pScrollBackbarPressed = lpNewIcon;
	}

	// Re-add this icon to the component list
	Add(m_pScrollBackbarPressed);

	ValueChanged(true);
}
Esempio n. 9
0
int TextWidget::BtnUp(int x, int y, int ctrl, int shift)
{ 
	if (track)
	{
		track = 0;
		if (enable && area.Inside(x, y))
		{
			char buf[80];
			if (buddy1)
			{
				//snprintf(buf, 80, "%f", buddy1->GetValue());
				bsString::FlpToStr(buddy1->GetValue(), buf, sizeof(buf));
			}
			else
				strncpy(buf, text, sizeof(buf));
			if (prjFrame->QueryValue("Enter value", buf, sizeof(buf)))
			{
				if (buddy1)
				{
					buddy1->SetText(buf);
					form->Redraw(buddy1);
					buddy1->ValueChanged(buddy1);
				}
				else
				{
					SetText(buf);
					form->Redraw(this);
					ValueChanged(this);
				}
			}
		}
	}
	return 1;
}
Esempio n. 10
0
//-----------------------------------------------------------------------------------
//	Initialize
//-----------------------------------------------------------------------------------
//	The control is set up.  Do the last minute stuff that needs to be done like
//	installing EventLoopTimers.
//
OSStatus TValuePictControl::Initialize(
									   TCarbonEvent&		inEvent )
{
#pragma unused( inEvent )
	ValueChanged();
    return noErr;
}
Esempio n. 11
0
void nuiMatrixView::Renamed(const nuiEvent& rEvent)
{
  NGL_ASSERT(rEvent.mpUser);
  nuiLabelRenamer* renamer = (nuiLabelRenamer*)rEvent.mpUser;
  nglString contents = renamer->GetText();
  contents.Trim();
  if (contents.IsEmpty())
  { 
    rEvent.Cancel();
    return;
  }
    
  double value = contents.GetCDouble();
  
  // report the new value to all selected items
  if (mSelectedItems.size() != 0)
  {
    std::map<nuiMatrixViewItem*, bool>::iterator it;
    for (it = mSelectedItems.begin(); it != mSelectedItems.end(); ++it)
    {
      nuiMatrixViewItem* item = it->first;
      item->SetValue(value);
    }
  }
  
  // report the new value to the single targeted item
  else
    mClickedItem->SetValue(value);
    
  ValueChanged();
        
  rEvent.Cancel();
}
Esempio n. 12
0
void LayerForceWidget::InitWidget(QWidget* widget)
{
    mainBox->addWidget(widget);
    connect(widget,
            SIGNAL(ValueChanged()),
            this,
            SLOT(OnValueChanged()));
}
void MixerInsertEffect::SetValue(float value)
{
    if (this->_value != value)
    {
        this->_value = value;
        emit ValueChanged(value);
    }
}
Esempio n. 14
0
void Slider::SetSliderParams(int barHeight, int sliderWidth, ESliderDirection lDirection)
{
	m_barHeight = barHeight;
	m_sliderWidth = sliderWidth;
	m_eSliderDirection = lDirection;

	ValueChanged();
}
Esempio n. 15
0
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void tCruisePage::CreateInputSpinner()
{
    // model is deleted by spinner!
    if( m_pCruiseSetPointSpinner != 0 )
    {
        RemoveInteractiveItem( m_pCruiseSetPointSpinner );
        delete m_pCruiseSetPointSpinner;
        m_pCruiseSetPointSpinner = 0;
    }

    quint16 min;
    quint16 max;
    QString unitStr;
    quint16 cruiseStepSize;
    tMercuryCommand* pCommand = tMercuryDataManager::Instance()->MercuryCommand();

    if( pCommand == 0 )
        return;

    quint16 setpoint = pCommand->CruiseSetpointConverted();
    pCommand->CruiseLimitsConverted( min, max );
    if( pCommand->IsCruiseInSpeedMode() )
    {
        m_CruiseType = eCruiseTypeSpeed;
        unitStr = pCommand->CruiseSpeedUnit();
        cruiseStepSize = 1;
    }
    else
    {
        m_CruiseType = eCruiseTypeRPM;
        unitStr = pCommand->CruiseRpmUnit();
        cruiseStepSize = 10;
    }
    // setpoint and units already converted to user units

    m_pCruiseSetPointModel = new tInputSpinnerNumericalModel< quint16 >(    setpoint,
                                                                            min,
                                                                            max,
                                                                            cruiseStepSize, 
                                                                            unitStr.toLower() );    

    QSize inputWidgetSize( AvailableRect().size().width(), AvailableRect().size().height() / 2 );   
    m_pCruiseSetPointSpinner = new tInputSpinner( MercuryPalette::GetTextStyle(MercuryPalette::eF47),
                                                  MercuryPalette::GetTextStyle(MercuryPalette::eF47, true),
                                                  MercuryPalette::GetTextStyle(MercuryPalette::eF48),
                                                  MercuryPalette::GetTextStyle(MercuryPalette::eF48, true),
                                                  m_pCruiseSetPointModel,
                                                  inputWidgetSize,
                                                  this );
    m_pCruiseSetPointSpinner->setPos( AvailableRect().topLeft() );    
    
    AddInteractiveItem( m_pCruiseSetPointSpinner );

    PollCruiseData();

    Connect( m_pCruiseSetPointModel, SIGNAL( ValueChanged() ), this, SLOT( OnSetPointChanged() ) );
}
Esempio n. 16
0
LayoutStream& LayoutStream::AddSpinBox(BitField<bitfield_position, bitfield_size>& bitfield)
{
	LinkedSpinBox* widget = new LinkedSpinBox(BitFieldWrapper(bitfield));

	connect(widget, SIGNAL(ValueChanged(u32)), this, SLOT(OnFifoDataChanged()));

	cur_hlayout->addWidget(widget);
	return *this;
}
Esempio n. 17
0
void WidgetForm::Command(int id, int cmd)
{
	SynthWidget *wdg = mainGroup->FindID(id);
	if (wdg)
	{
		if (wdg->CommandMsg(cmd))
			ValueChanged(wdg);
	}
}
Esempio n. 18
0
void CSpinBox::SetValue(qint64 val) {
    auto old_value = value;
    value = std::max(std::min(val, max_value), min_value);

    if (old_value != value) {
        UpdateText();
        emit ValueChanged(value);
    }
}
Esempio n. 19
0
void wxTreeListModel::SetItemImage(Node* item, int closed, int opened)
{
    wxCHECK_RET( item, "Invalid item" );

    item->m_imageClosed = closed;
    item->m_imageOpened = opened;

    ValueChanged(ToDVI(item), 0);
}
Esempio n. 20
0
void nuiRange::SetValue(double Value)
{
#ifdef DEBUG
  if (IsValid())
  {
    NGL_ASSERT(finite(Value));
  }
#endif
  
  double OldValue = mValue;

  mValue = Value;

  if (mDiscreetStepSize)
  {
    double diff = mValue - OldValue;
    if (fabsf(diff) >= mIncrement / 2.f)
    {
      if (mIncrement > 0)
      {
        mValue = (double)((double)OldValue + (ToNearest((double)diff / (double)mIncrement) * (double)mIncrement));
      }
    }
    else
    {
      mValue = OldValue;
    }
  }

  if (mMinimum <= mMaximum)
  {
    if (mValue < mMinimum)
      mValue = mMinimum;
    else if (mValue + mPageSize > mMaximum)
      mValue = mMaximum - mPageSize;
    if (mValue < mMinimum)
      mValue = mMinimum;
  }
  else
  {
    if (mValue > mMinimum)
      mValue = mMinimum;
    else if (mValue - mPageSize < mMaximum)
      mValue = mMaximum + mPageSize;
    if (mValue > mMinimum)
      mValue = mMinimum;
  }

  if (OldValue == mValue)
    return;

  if (mEvents)
  {
    ValueChanged();
    Changed();
  }
}
const char*
StringValueSetting::Handle(const char* const* argv)
{
	if (!*++argv)
		return fValueExpectedErrorString;

	ValueChanged(*argv);
	return 0;
}
Esempio n. 22
0
    void MultiEditPropertyManager::SetValue(QtProperty *property, const QString &value)
    {
        if(!values_.contains(property)) 
            return;
        if(values_[property].value == value)
            return;

        values_[property].value = value;
        emit ValueChanged(value);
    }
Esempio n. 23
0
BOOL CTextBox::PreTranslateMessage(MSG* pMsg) 
{
  if((pMsg->message==WM_KEYDOWN) && ((int)pMsg->wParam==VK_RETURN))
  {
    ValueChanged();
    //SetSel(0,-1);
    return TRUE;
  }
	
	return CEdit::PreTranslateMessage(pMsg);
}
Esempio n. 24
0
void Slider::MinusPressed()
{
	m_currentValue -= m_incrementAmount;

	if(m_currentValue < m_minValue)
	{
		m_currentValue = m_minValue;
	}

	ValueChanged();
}
Esempio n. 25
0
void Slider::PlusPressed()
{
	m_currentValue += m_incrementAmount;

	if(m_currentValue > m_maxValue)
	{
		m_currentValue = m_maxValue;
	}

	ValueChanged();
}
Esempio n. 26
0
void wxTreeListModel::SetItemText(Node* item, unsigned col, const wxString& text)
{
    wxCHECK_RET( item, "Invalid item" );

    if ( col == 0 )
        item->m_text = text;
    else
        item->SetColumnText(text, col, m_numColumns);

    ValueChanged(ToDVI(item), col);
}
Esempio n. 27
0
void nuiSlider::DoInvalidate(const nuiEvent& rEvent)
{
  //ValueChanged();
  InteractiveValueChanged();
  if (!mInteractiveValueChanged)
    ValueChanged();
  
  // mInteractiveValueChanged = true;
  
  UpdateLayout();
}
Esempio n. 28
0
void
CTool::SetValue(
	int32 value)
{
	D_OPERATION(("CTool::SetValue(%ld)\n", value));

	if (value != m_value)
	{
		if (Mode() == TRIGGER_MODE)
		{
			// trigger tools don't change their value
			return;
		}

		if ((Mode() == RADIO_MODE) && (Flags() & FORCE_SELECTION)
		 && (Value() == B_CONTROL_ON))
		{
			// radio mode with the force-selection flag set does not
			// allow 'turning off' the tool directly
			return;
		}

		m_value = value;

		if ((Mode() == RADIO_MODE) && (Value() == B_CONTROL_ON))
		{
			// turn off other tools in radio group
			CTool *tool;
			tool = PreviousTool();
			while (tool)
			{
				if (tool->m_value == B_CONTROL_ON)
				{
					tool->m_value = B_CONTROL_OFF;
					tool->ValueChanged();
				}
				tool = tool->PreviousTool();
			}
			tool = NextTool();
			while (tool)
			{
				if (tool->m_value == B_CONTROL_ON)
				{
					tool->m_value = B_CONTROL_OFF;
					tool->ValueChanged();
				}
				tool = tool->NextTool();
			}
		}
		ValueChanged();
	}	
}
Esempio n. 29
0
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void tSmartTowSaveCreatePage::CreateInputSpinner()
{
    // model deleted by spinner
    if( m_pSetPointSpinner != 0 )
    {
        delete m_pSetPointSpinner;
    }
       
    tMercuryCommand* pCommand = tMercuryDataManager::Instance()->MercuryCommand();
    if( pCommand == 0 )
        return;

    quint16 min;
    quint16 max;
    quint16 cruiseStepSize;
    QString unit;

    quint16 setpoint = pCommand->CruiseSetpointConverted();
    pCommand->CruiseLimitsConverted( min, max );

    if( pCommand->IsCruiseInSpeedMode() )
    {
        cruiseStepSize = 1;
        unit = pCommand->CruiseSpeedUnit();
    }
    else
    {
        cruiseStepSize = 10;
        unit = pCommand->CruiseRpmUnit();
    }
    // setpoint and limits already converted
    if( setpoint < min )
        setpoint = min;
    if( setpoint > max )
        setpoint = max;

    m_pSetPointModel = new tInputSpinnerNumericalModel< quint16 >(  setpoint,
                                                                    min,
                                                                    max,
                                                                    cruiseStepSize, 
                                                                    unit.toLower() );

    QSize inputWidgetSize( AvailableRect().width(), m_SpinnerHeight );   
    m_pSetPointSpinner = new tInputSpinnerLabeled( tr("SET POINT"),
                                                  m_pSetPointModel,
                                                  inputWidgetSize,
                                                  this );
    m_pSetPointSpinner->setPos( AvailableRect().topLeft() );    
    Connect( m_pSetPointModel, SIGNAL( ValueChanged() ), this, SLOT( SetPointChanged() ) );
    
    AddInteractiveItem( m_pSetPointSpinner, true );
}
Esempio n. 30
0
// _ToggleValue
void
BoolValueView::_ToggleValue()
{
	if (!fEnabled)
		return;

	if (fProperty) {
		fProperty->SetValue(!fProperty->Value());
		BRect b(fCheckBoxRect);
		b.InsetBy(1.0, 1.0);
		Invalidate(b);
		ValueChanged();
	}
}