当前位置: 首页>>代码示例>>C++>>正文


C++ LLMultiSliderCtrl类代码示例

本文整理汇总了C++中LLMultiSliderCtrl的典型用法代码示例。如果您正苦于以下问题:C++ LLMultiSliderCtrl类的具体用法?C++ LLMultiSliderCtrl怎么用?C++ LLMultiSliderCtrl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LLMultiSliderCtrl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onSliderCommit

// static
void LLMultiSliderCtrl::onSliderCommit(LLUICtrl* ctrl, const LLSD& userdata)
{
	LLMultiSliderCtrl* self = dynamic_cast<LLMultiSliderCtrl*>(ctrl->getParent());
	if (!self)
		return;
	
	BOOL success = FALSE;
	F32 saved_val = self->mCurValue;
	F32 new_val = self->mMultiSlider->getCurSliderValue();

	self->mCurValue = new_val;  // set the value temporarily so that the callback can retrieve it.
	if( !self->mValidateSignal || (*(self->mValidateSignal))( self, new_val ) )
	{
		success = TRUE;
	}

	if( success )
	{
		self->onCommit();
	}
	else
	{
		if( self->mCurValue != saved_val )
		{
			self->setCurSliderValue( saved_val );
		}
		self->reportInvalidData();		
	}
	self->updateText();
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:31,代码来源:llmultisliderctrl.cpp

示例2: LLFloater

LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater(std::string("Day Cycle Floater"))
{
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml");
	
	// add the combo boxes
	LLComboBox* keyCombo = getChild<LLComboBox>("WLKeyPresets");

	if(keyCombo != NULL) 
	{
		std::map<std::string, LLWLParamSet>::iterator mIt = 
			LLWLParamManager::instance()->mParamList.begin();
		for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) 
		{
			if(mIt->second.mInventoryID.isNull())
				keyCombo->add(std::string(mIt->first));
		}

		// set defaults on combo boxes
		keyCombo->selectFirstItem();
	}

	// add the time slider
	LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLTimeSlider");

	sldr->addSlider();

	// load it up
	initCallbacks();
}
开发者ID:9skunks,项目名称:imprudence,代码行数:29,代码来源:llfloaterdaycycle.cpp

示例3: llassert_always

void LLFloaterDayCycle::syncTrack()
{
	// if no keys, do nothing
	if(sSliderToKey.size() == 0) 
	{
		return;
	}
	
	LLMultiSliderCtrl* sldr;
	sldr = sDayCycle->getChild<LLMultiSliderCtrl>( 
		"WLDayCycleKeys");
	llassert_always(sSliderToKey.size() == sldr->getValue().size());
	
	LLMultiSliderCtrl* tSldr;
	tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( 
		"WLTimeSlider");

	// create a new animation track
	LLWLParamManager::getInstance()->mDay.clearKeys();
	
	// add the keys one by one
	std::map<std::string, LLWLSkyKey>::iterator mIt = sSliderToKey.begin();
	for(; mIt != sSliderToKey.end(); mIt++) 
	{
		LLWLParamManager::getInstance()->mDay.addKey(mIt->second.time / sHoursPerDay,
			mIt->second.presetName);
	}
	
	// set the param manager's track to the new one
	LLWLParamManager::getInstance()->resetAnimator(
		tSldr->getCurSliderValue() / sHoursPerDay, false);

	LLWLParamManager::getInstance()->mAnimator.update(
		LLWLParamManager::getInstance()->mCurParams);
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:35,代码来源:llfloaterdaycycle.cpp

示例4: onKeyPresetChanged

void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl, void* userData)
{
	// get the time
	LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>( 
		"WLKeyPresets");
	LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( 
		"WLDayCycleKeys");

	// do nothing if no sliders
	if(sldr->getValue().size() == 0) {
		return;
	}

	// change the map
	std::string newPreset(comboBox->getSelectedValue().asString());
	const std::string& curSldr = sldr->getCurSlider();

	// if null, don't use
	if(curSldr == "") {
		return;
	}

	sSliderToKey[curSldr].presetName = newPreset;

	syncTrack();
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:26,代码来源:llfloaterdaycycle.cpp

示例5: LLFloater

LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater(std::string("Day Cycle Floater"))
{
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml");
	
	// add the combo boxes
	LLComboBox* keyCombo = getChild<LLComboBox>("WLKeyPresets");

	if(keyCombo != NULL) 
	{
		LLWLParamManager::preset_name_list_t local_presets;
		LLWLParamManager::instance()->getLocalPresetNames(local_presets);

		for (LLWLParamManager::preset_name_list_t::const_iterator it = local_presets.begin(); it != local_presets.end(); ++it)
		{
			keyCombo->add(*it);
		}

		// set defaults on combo boxes
		keyCombo->selectFirstItem();
	}

	// add the time slider
	LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLTimeSlider");

	sldr->addSlider();

	// load it up
	initCallbacks();
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:29,代码来源:llfloaterdaycycle.cpp

示例6: onEditorGainFocus

// static
void LLMultiSliderCtrl::onEditorGainFocus( LLFocusableElement* caller, void *userdata )
{
	LLMultiSliderCtrl* self = (LLMultiSliderCtrl*) userdata;
	llassert( caller == self->mEditor );

	self->onFocusReceived();
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:8,代码来源:llmultisliderctrl.cpp

示例7: onKeyTimeChanged

void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl, void* userData)
{
	// if no keys, skipped
	if(sSliderToKey.size() == 0) {
		return;
	}

	LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( 
		"WLDayCycleKeys");
	LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>( 
		"WLCurKeyHour");
	LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>( 
		"WLCurKeyMin");

	F32 hour = hourSpin->get();
	F32 min = minSpin->get();
	F32 val = hour + min / 60.0f;

	const std::string& curSldr = sldr->getCurSlider();
	sldr->setCurSliderValue(val, TRUE);
	F32 time = sldr->getCurSliderValue() / sHoursPerDay;

	// now set the key's time in the sliderToKey map
	std::string presetName = sSliderToKey[curSldr].presetName;
	sSliderToKey[curSldr].time = time;

	syncTrack();
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:28,代码来源:llfloaterdaycycle.cpp

示例8: onSliderMouseUp

// static
void LLMultiSliderCtrl::onSliderMouseUp(LLUICtrl* caller, void* userdata)
{
	LLMultiSliderCtrl* self = (LLMultiSliderCtrl*) userdata;
	if( self->mSliderMouseUpCallback )
	{
		self->mSliderMouseUpCallback( self, self->mCallbackUserData );
	}
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:9,代码来源:llmultisliderctrl.cpp

示例9: LLFloater

LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater(std::string("Day Cycle Floater"))
{
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml");
	
	// add the combo boxes
	LLComboBox* keyCombo = getChild<LLComboBox>("WLKeyPresets");

	if(keyCombo != NULL) 
	{
		LLWLParamManager::preset_name_list_t local_presets;
		LLWLParamManager::getInstance()->getLocalPresetNames(local_presets);

		for (LLWLParamManager::preset_name_list_t::const_iterator it = local_presets.begin(); it != local_presets.end(); ++it)
		{
			keyCombo->add(*it);
		}

		// set defaults on combo boxes
		keyCombo->selectFirstItem();
	}

	// add the time slider
	LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLTimeSlider");

	sldr->addSlider();

	// add the combo boxes
	LLComboBox* comboBox = getChild<LLComboBox>("DayCyclePresetsCombo");

	if(comboBox != NULL) {

		LLDayCycleManager::preset_name_list_t day_presets;
		LLDayCycleManager::getInstance()->getPresetNames(day_presets);
		LLDayCycleManager::preset_name_list_t::const_iterator it;
		for(it = day_presets.begin(); it != day_presets.end(); ++it)
		{
			comboBox->add(*it);
		}

		// entry for when we're in estate time
		comboBox->add(LLStringUtil::null);

		// set defaults on combo boxes
		//comboBox->selectByValue(LLSD("Default"));
	}

	// load it up
	initCallbacks();
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:49,代码来源:llfloaterdaycycle.cpp

示例10: syncSliderTrack

void LLFloaterDayCycle::syncSliderTrack()
{
	// clear the slider
	LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys");

	kSldr->clear();
	sSliderToKey.clear();

	// add sliders
	std::map<F32, LLWLParamKey>::iterator mIt = 
		LLWLParamManager::getInstance()->mDay.mTimeMap.begin();
	for(; mIt != LLWLParamManager::getInstance()->mDay.mTimeMap.end(); mIt++)
	{
		addSliderKey(mIt->first * sHoursPerDay, mIt->second.name);
	}
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:16,代码来源:llfloaterdaycycle.cpp

示例11: onTimeSliderMoved

void LLFloaterDayCycle::onTimeSliderMoved(LLUICtrl* ctrl, void* userData)
{
	LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( 
		"WLTimeSlider");

	/// get the slider value
	F32 val = sldr->getCurSliderValue() / sHoursPerDay;
	
	// set the value, turn off animation
	LLWLParamManager::getInstance()->mAnimator.setDayTime((F64)val);
	LLWLParamManager::getInstance()->mAnimator.deactivate();

	// then call update once
	LLWLParamManager::getInstance()->mAnimator.update(
		LLWLParamManager::getInstance()->mCurParams);
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:16,代码来源:llfloaterdaycycle.cpp

示例12: deletePreset

void LLFloaterDayCycle::deletePreset(std::string& presetName)
{
	LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys");

	/// delete any reference
	std::map<std::string, LLWLSkyKey>::iterator curr_preset, next_preset;
	for(curr_preset = sSliderToKey.begin(); curr_preset != sSliderToKey.end(); curr_preset = next_preset)
	{
		next_preset = curr_preset;
		++next_preset;
		if (curr_preset->second.presetName == presetName)
		{
			sldr->deleteSlider(curr_preset->first);
			sSliderToKey.erase(curr_preset);
		}
	}
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:17,代码来源:llfloaterdaycycle.cpp

示例13: onAddKey

void LLFloaterDayCycle::onAddKey(void* userData)
{
	LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>( 
		"WLKeyPresets");
	LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>( 
		"WLDayCycleKeys");
	LLMultiSliderCtrl* tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( 
		"WLTimeSlider");
	
	llassert_always(sSliderToKey.size() == kSldr->getValue().size());

	// get the values
	std::string newPreset(comboBox->getSelectedValue().asString());

	// add the slider key
	addSliderKey(tSldr->getCurSliderValue(), newPreset);

	syncTrack();
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:19,代码来源:llfloaterdaycycle.cpp

示例14: syncSliderTrack

void LLFloaterDayCycle::onLoadDayCycle(void* userData)
{
	LLWLParamManager::instance()->mDay.loadDayCycleFromFile("Default.xml");
	
	// sync it all up
	syncSliderTrack();
	syncMenu();

	// set the param manager's track to the new one
	LLMultiSliderCtrl* tSldr;
	tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( 
		"WLTimeSlider");
	LLWLParamManager::instance()->resetAnimator(
		tSldr->getCurSliderValue() / sHoursPerDay, false);

	// and draw it
	LLWLParamManager::instance()->mAnimator.update(
		LLWLParamManager::instance()->mCurParams);
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:19,代码来源:llfloaterdaycycle.cpp

示例15: onKeyTimeMoved

void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl, void* userData)
{
	LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>("WLKeyPresets");
	LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys");
	LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyHour");
	LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyMin");

	if(sldr->getValue().size() == 0) {
		return;
	}

	// make sure we have a slider
	const std::string& curSldr = sldr->getCurSlider();
	if(curSldr == "") {
		return;
	}

	F32 time = sldr->getCurSliderValue();

	// check to see if a key exists
	std::string presetName = sSliderToKey[curSldr].presetName;
	sSliderToKey[curSldr].time = time;

	// if it exists, turn on check box
	comboBox->selectByValue(presetName);

	// now set the spinners
	F32 hour = (F32)((S32)time);
	F32 min = (time - hour) * 60;

	// handle imprecision
	if(min >= 59) {
		min = 0;
		hour += 1;
	}

	hourSpin->set(hour);
	minSpin->set(min);

	syncTrack();

}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:42,代码来源:llfloaterdaycycle.cpp


注:本文中的LLMultiSliderCtrl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。