Esempio n. 1
0
void Gear_ListBox::onUpdateSettings()
{
  _VALUE_OUT->type()->resize(_settings.get(Gear_ListBox::SETTING_NELEMS)->valueInt());

  //set the value, to force clamping if needed
  setValue(getValue());

  //then we need to redraw the gearGui
  getGearGui()->reDraw();

  // XXX temporary hack to save labels, to be removed ultimately
  char str[1000];
  strcpy(str, _settings.get(Gear_ListBox::SETTING_LABELS)->valueStr().c_str());
  char *tok = strtok(str, ",");
  _labels.resize(0);
  while (tok != NULL) // parse comma-separated array
  {
    _labels.push_back(tok);
    tok = strtok (NULL, ",");
  }
  
  std::cout << "labels : " << _settings.get(Gear_ListBox::SETTING_LABELS)->valueStr() << std::endl;
  std::cout << "value out type: " << _VALUE_OUT->type()->size() <<std::endl;
  std::cout << "label: " << _labels.size() <<std::endl;

  ASSERT_ERROR(_labels.size() == _VALUE_OUT->type()->size());

  _acceptHint = false;
}
Esempio n. 2
0
void Gear_Slider::onUpdateSettings()
{
  //validation
  float low = _settings.get(Gear_Slider::SETTING_LOWERBOUND)->valueFloat();
  float hi = _settings.get(Gear_Slider::SETTING_HIGHERBOUND)->valueFloat();    
  if (low>hi)
  {
    _settings.get(Gear_Slider::SETTING_LOWERBOUND)->valueFloat(hi);
    _settings.get(Gear_Slider::SETTING_HIGHERBOUND)->valueFloat(low);    
  }

  //range have changed
  //set the value, to force clamping if needed
  setValue(getValue());

  //then we need to redraw the gearGui
  getGearGui()->reDraw();

  //tell the control slider to update his range and value
  //getControl()->onUpdate();

  _acceptHint = false;
}
Esempio n. 3
0
void Gear_PushButton::onUpdateSettings()
{
  //then we need to redraw the gearGui
  getGearGui()->rebuildLayout();
}
Esempio n. 4
0
void Gear_AudioPushButton::onUpdateSettings()
{
  //then we need to redraw the gearGui
  getGearGui()->reDraw();
}