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


C++ LLComboBox::getCurrentIndex方法代码示例

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


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

示例1: onCommitTimeDate

//static
void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
{
    LLPrefsAscentChat* self = (LLPrefsAscentChat*)userdata;

    LLComboBox* combo = (LLComboBox*)ctrl;
    if (ctrl->getName() == "time_format_combobox")
    {
        self->tempTimeFormat = combo->getCurrentIndex();
    }
    else if (ctrl->getName() == "date_format_combobox")
    {
        self->tempDateFormat = combo->getCurrentIndex();
    }

    std::string short_date, long_date, short_time, long_time, timestamp;

    if (self->tempTimeFormat == 0)
    {
        short_time = "%H:%M";
        long_time  = "%H:%M:%S";
        timestamp  = " %H:%M:%S";
    }
    else
    {
        short_time = "%I:%M %p";
        long_time  = "%I:%M:%S %p";
        timestamp  = " %I:%M %p";
    }

    if (self->tempDateFormat == 0)
    {
        short_date = "%Y-%m-%d";
        long_date  = "%A %d %B %Y";
        timestamp  = "%a %d %b %Y" + timestamp;
    }
    else if (self->tempDateFormat == 1)
    {
        short_date = "%d/%m/%Y";
        long_date  = "%A %d %B %Y";
        timestamp  = "%a %d %b %Y" + timestamp;
    }
    else
    {
        short_date = "%m/%d/%Y";
        long_date  = "%A, %B %d %Y";
        timestamp  = "%a %b %d %Y" + timestamp;
    }

    gSavedSettings.setString("ShortDateFormat", short_date);
    gSavedSettings.setString("LongDateFormat",  long_date);
    gSavedSettings.setString("ShortTimeFormat", short_time);
    gSavedSettings.setString("LongTimeFormat",  long_time);
    gSavedSettings.setString("TimestampFormat", timestamp);
}
开发者ID:samiam123,项目名称:SingularityViewer,代码行数:55,代码来源:ascentprefschat.cpp

示例2: onItemSelected

// static
void LLComboBox::onItemSelected(LLUICtrl* item, void *userdata)
{
	// Note: item is the LLScrollListCtrl
	LLComboBox *self = (LLComboBox *) userdata;

	const std::string name = self->mList->getSelectedItemLabel();

	S32 cur_id = self->getCurrentIndex();
	if (cur_id != -1)
	{
		self->setLabel(name);

		if (self->mAllowTextEntry)
		{
			gFocusMgr.setKeyboardFocus(self->mTextEntry);
			self->mTextEntry->selectAll();
		}
	}

	// hiding the list reasserts the old value stored in the text editor/dropdown button
	self->hideList();

	// commit does the reverse, asserting the value in the list
	self->onCommit();
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:26,代码来源:llcombobox.cpp

示例3: sendBump

void LLPanelFace::sendBump()
{	
	LLComboBox*	mComboBumpiness = getChild<LLComboBox>("combobox bumpiness");
	if(!mComboBumpiness)return;
	U8 bump = (U8) mComboBumpiness->getCurrentIndex() & TEM_BUMP_MASK;
	LLSelectMgr::getInstance()->selectionSetBumpmap( bump );
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:7,代码来源:llpanelface.cpp

示例4: sendTexGen

void LLPanelFace::sendTexGen()
{
	LLComboBox*	mComboTexGen = getChild<LLComboBox>("combobox texgen");
	if(!mComboTexGen)return;
	U8 tex_gen = (U8) mComboTexGen->getCurrentIndex() << TEM_TEX_GEN_SHIFT;
	LLSelectMgr::getInstance()->selectionSetTexGen( tex_gen );
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:7,代码来源:llpanelface.cpp

示例5: onClickDownload

void lggDicDownloadFloater::onClickDownload(void* data)
{
	lggDicDownloadFloater* self = (lggDicDownloadFloater*)data;
	if (self)
	{
		//std::string selection = self->childGetValue("Emerald_combo_dics").asString();
		LLComboBox* comboBox = self->getChild<LLComboBox>("Emerald_combo_dics");
		if (comboBox != NULL) 
		{
			if (!comboBox->getSelectedItemLabel().empty())
			{
				std::string newDict(self->sNames[comboBox->getCurrentIndex()]);
				LLHTTPClient::get(gSavedSettings.getString("SpellDownloadURL")+newDict+".aff", new EmeraldDicDownloader(self,newDict+".aff"));
				LLHTTPClient::get(gSavedSettings.getString("SpellDownloadURL")+newDict+".dic", new EmeraldDicDownloader(NULL,newDict+".dic"));
				
				LLButton* button = self->getChild<LLButton>("Emerald_dic_download");
				if (button)
				{
					// TODO: move this to xml
					button->setLabel(LLStringExplicit("Downloading... Please Wait"));
					button->setEnabled(FALSE);
				}
			}
		}
	} 
}
开发者ID:BillBarnhill,项目名称:SingularityViewer,代码行数:26,代码来源:lggdicdownload.cpp

示例6: onCommitClickAction

// static
void LLPanelPermissions::onCommitClickAction(LLUICtrl* ctrl, void*)
{
	LLComboBox* box = (LLComboBox*)ctrl;
	if (!box) return;

	U8 click_action = (U8)box->getCurrentIndex();
	if (click_action == CLICK_ACTION_BUY)
	{
		LLSaleInfo sale_info;
		LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info);
		if (!sale_info.isForSale())
		{
			LLNotifications::instance().add("CantSetBuyObject");

			// Set click action back to its old value
			U8 click_action = 0;
			LLSelectMgr::getInstance()->selectionGetClickAction(&click_action);
			box->setCurrentByIndex((S32)click_action);

			return;
		}
	}
	else if (click_action == CLICK_ACTION_PAY)
	{
		// Verify object has script with money() handler
		LLSelectionPayable payable;
		bool can_pay = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&payable);
		if (!can_pay)
		{
			// Warn, but do it anyway.
			LLNotifications::instance().add("ClickActionNotPayable");
		}
	}
	LLSelectMgr::getInstance()->selectionSetClickAction(click_action);
}
开发者ID:PhoenixDesmoulins,项目名称:imprudence,代码行数:36,代码来源:llpanelpermissions.cpp

示例7: onCommitClientTag

//static
void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl, void* userdata)
{
    std::string client_uuid;
    U32 client_index;

    LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata;
    LLComboBox* combo = (LLComboBox*)ctrl;

    if (combo)
    {
        client_index = combo->getCurrentIndex();
        if (client_index != self->mSelectedClient)
        {
            client_uuid = combo->getSelectedValue().asString();
            gSavedSettings.setString("AscentReportClientUUID",  client_uuid);
            gSavedSettings.setU32("AscentReportClientIndex",  client_index);

            LLVOAvatar* avatar = gAgent.getAvatarObject();

            if (avatar)
            {
				gAgent.resetClientTag();
				gAgent.sendAgentSetAppearance();
            }
        }
    }
}
开发者ID:catface,项目名称:catfacebase,代码行数:28,代码来源:ascentprefsvan.cpp

示例8: updateStartSLURL

// static
void LLPanelLogin::updateStartSLURL()
{
	if (!sInstance) return;
	
	LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
	S32 index = combo->getCurrentIndex();
	
	switch (index)
	{
		case 0:
		{
			LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST));
			break;
		}			
		case 1:
		{
			LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME));
			break;
		}
		default:
		{
			LLSLURL slurl = LLSLURL(combo->getValue().asString());
			if(slurl.getType() == LLSLURL::LOCATION)
			{
				// we've changed the grid, so update the grid selection
				LLStartUp::setStartSLURL(slurl);
			}
			break;
		}			
	}
}
开发者ID:Katharine,项目名称:kittyviewer,代码行数:32,代码来源:llpanellogin.cpp

示例9: sendShiny

void LLPanelFace::sendShiny()
{
	LLComboBox*	mComboShininess = getChild<LLComboBox>("combobox shininess");
	if(!mComboShininess)return;
	U8 shiny = (U8) mComboShininess->getCurrentIndex() & TEM_SHINY_MASK;
	LLSelectMgr::getInstance()->selectionSetShiny( shiny );
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:7,代码来源:llpanelface.cpp

示例10: startBuyPreConfirm

void LLFloaterBuyLandUI::startBuyPreConfirm()
{
	std::string action;
	std::string type_currency = LLGridManager::getInstance()->getCurrency();
	
	if (mSiteMembershipUpgrade)
	{
		action += mSiteMembershipAction;
		action += "\n";

		LLComboBox* levels = getChild<LLComboBox>( "account_level");
		if (levels)
		{
			action += " * ";
			action += mSiteMembershipPlanNames[levels->getCurrentIndex()];
			action += "\n";
		}
	}
	if (mSiteLandUseUpgrade)
	{
		action += mSiteLandUseAction;
		action += "\n";
	}
	if (mCurrency.getAmount() > 0)
	{
		LLStringUtil::format_map_t string_args;
		string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount());
		string_args["[LOCAL_AMOUNT]"] = mCurrency.getLocalEstimate();
		string_args["[CUR]"] = type_currency;
		action += getString("buy_for_US", string_args);
	}

	LLStringUtil::format_map_t string_args;
	string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
	string_args["[SELLER]"] = mParcelSellerName;
	string_args["[CUR]"] = type_currency;
	action += getString("pay_to_for_land", string_args);
		
	
	LLConfirmationManager::confirm(mSiteConfirm,
		action,
		*this,
		&LLFloaterBuyLandUI::startBuyPostConfirm);
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:44,代码来源:llfloaterbuyland.cpp

示例11: startBuyPreConfirm

void LLFloaterBuyLandUI::startBuyPreConfirm()
{
	std::string action;
	
	if (mSiteMembershipUpgrade)
	{
		action += mSiteMembershipAction;
		action += "\n";

		LLComboBox* levels = getChild<LLComboBox>( "account_level");
		if (levels)
		{
			action += " * ";
			action += mSiteMembershipPlanNames[levels->getCurrentIndex()];
			action += "\n";
		}
	}
	if (mSiteLandUseUpgrade)
	{
		action += mSiteLandUseAction;
		action += "\n";
	}
	if (mCurrency.getAmount() > 0)
	{
		LLStringUtil::format_map_t string_args;
		string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount());
		string_args["[AMOUNT2]"] = llformat("%#.2f", mCurrency.getEstimate() / 100.0);
		string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
		
		action += getString("buy_for_US", string_args);
	}

	LLStringUtil::format_map_t string_args;
	string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
	string_args["[SELLER]"] = mParcelSellerName;
	string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
	action += getString("pay_to_for_land", string_args);
		
	
	LLConfirmationManager::confirm(mSiteConfirm,
		action,
		*this,
		&LLFloaterBuyLandUI::startBuyPostConfirm);
}
开发者ID:Logear,项目名称:PartyHatViewer,代码行数:44,代码来源:llfloaterbuyland.cpp

示例12: onManualClientUpdate

//static
void LLPrefsAscentVan::onManualClientUpdate(void* data)
{
	LLPrefsAscentVan* self = (LLPrefsAscentVan*)data;
	std::string client_uuid;
	U32 client_index;
	//Colors ------------------------------------------------------------------------------
	LLComboBox* combo = self->getChild<LLComboBox>("tag_spoofing_combobox");
	if (combo)
	{
		client_index = combo->getCurrentIndex();
		//Don't rebake if it's not neccesary.
		if (client_index != gSavedSettings.getU32("AscentReportClientIndex"))
		{
			client_uuid = combo->getSelectedValue().asString();
			gSavedSettings.setString("AscentReportClientUUID",  client_uuid);
			gSavedSettings.setU32("AscentReportClientIndex",  client_index);
			LLVOAvatar* avatar = gAgent.getAvatarObject();
			if (!avatar) return;

			gAgent.sendAgentSetAppearance();
		}
	}

    LLChat chat;
    chat.mSourceType = CHAT_SOURCE_SYSTEM;
    chat.mText = llformat("Definitions already up-to-date.");
    if (LLVOAvatar::updateClientTags())
    {
        chat.mText = llformat("Client definitions updated.");
        LLVOAvatar::loadClientTags();
        for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
        iter != LLCharacter::sInstances.end(); ++iter)
        {
            LLVOAvatar* avatarp = (LLVOAvatar*) *iter;
            if(avatarp)
            {
                LLVector3 root_pos_last = avatarp->mRoot.getWorldPosition();
                avatarp->mClientTag = "";
            }
        }
    }
    LLFloaterChat::addChat(chat);
}
开发者ID:catface,项目名称:catfacebase,代码行数:44,代码来源:ascentprefsvan.cpp

示例13: onComboBoxCommit

void LLFloaterAO::onComboBoxCommit(LLUICtrl* ctrl, void* userdata)
{
	LLComboBox* box = (LLComboBox*)ctrl;
	if(box)
	{
		if (box->getName() == "stand")
		{
			stand_iterator = box->getCurrentIndex();
			if (mAOStandTimer) mAOStandTimer->reset();
			ChangeStand(TRUE);
		}
		else
		{
			std::string stranim = box->getValue().asString();

			for (std::vector<struct_combobox>::iterator iter = mComboBoxes.begin(); iter != mComboBoxes.end(); ++iter)
			{
				if (box->getName() == iter->name)
				{
					gSavedPerAccountSettings.setString("PhoenixAODefault"+iter->name,stranim);
					int boxstate = iter->state;

					for (std::vector<struct_default_anims>::iterator iter = mAODefaultAnims.begin(); iter != mAODefaultAnims.end(); ++iter)
					{
						if (boxstate == iter->state)
						{
							iter->ao_id = GetAnimIDByName(stranim);
							if (getAnimationState() == boxstate) // only play anim for the current state, change sits for example
							{
								startAOMotion(iter->ao_id,TRUE,TRUE);
							}
							return;
						}
					}
				}
			}
		}
	}
}
开发者ID:N3X15,项目名称:Luna-Viewer,代码行数:39,代码来源:floaterao.cpp

示例14: onCommitClientTag

void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl)
{
    std::string client_uuid;
    U32 client_index;

	LLComboBox* combo = static_cast<LLComboBox*>(ctrl);

	client_index = combo->getCurrentIndex();
	//Don't rebake if it's not neccesary.
	if (client_index != mSelectedClient)
	{
		client_uuid = combo->getSelectedValue().asString();
		gSavedSettings.setString("AscentReportClientUUID",  client_uuid);
		gSavedSettings.setU32("AscentReportClientIndex",  client_index);

		if (gAgentAvatarp)
		{
			// Slam pending upload count to "unstick" things
			bool slam_for_debug = true;
			gAgentAvatarp->forceBakeAllTextures(slam_for_debug);
		}
	}
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:23,代码来源:ascentprefsvan.cpp

示例15: getState


//.........这里部分代码省略.........
			childSetEnabled("label bumpiness",editable);
		}

		{
			F32 genf = 0.f;
			struct f11 : public LLSelectedTEGetFunctor<F32>
			{
				F32 get(LLViewerObject* object, S32 face)
				{
					return (F32)(object->getTE(face)->getTexGen());
				}
			} func;
			identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, genf );
			S32 selected_texgen = ((S32) genf) >> TEM_TEX_GEN_SHIFT;
			LLCtrlSelectionInterface* combobox_texgen =
			      childGetSelectionInterface("combobox texgen");
			if (combobox_texgen)
			{
				combobox_texgen->selectNthItem(selected_texgen);
			}
			else
			{
				llwarns << "failed childGetSelectionInterface for 'combobox texgen'" << llendl;
			}
			childSetEnabled("combobox texgen",editable);
			childSetTentative("combobox texgen",!identical);
			childSetEnabled("tex gen",editable);

			if (selected_texgen == 1)
			{
				childSetText("tex scale",getString("string repeats per meter"));
				childSetValue("TexScaleU", 2.0f * childGetValue("TexScaleU").asReal() );
				childSetValue("TexScaleV", 2.0f * childGetValue("TexScaleV").asReal() );
			}
			else
			{
				childSetText("tex scale",getString("string repeats per face"));
			}

		}

		{
			F32 fullbrightf = 0.f;
			struct f12 : public LLSelectedTEGetFunctor<F32>
			{
				F32 get(LLViewerObject* object, S32 face)
				{
					return (F32)(object->getTE(face)->getFullbright());
				}
			} func;
			identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, fullbrightf );

			childSetValue("checkbox fullbright",(S32)fullbrightf);
			childSetEnabled("checkbox fullbright",editable);
			childSetTentative("checkbox fullbright",!identical);
		}
		
		// Repeats per meter label
		{
			childSetEnabled("rpt",editable);
		}

		// Repeats per meter
		{
			F32 repeats = 1.f;
			struct f13 : public LLSelectedTEGetFunctor<F32>
			{
				F32 get(LLViewerObject* object, S32 face)
				{
					U32 s_axis = VX;
					U32 t_axis = VY;
					// BUG: Only repeats along S axis
					// BUG: Only works for boxes.
					LLPrimitive::getTESTAxes(face, &s_axis, &t_axis);
					return object->getTE(face)->mScaleS / object->getScale().mV[s_axis];
				}
			} func;			
			identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, repeats );
			
			childSetValue("rptctrl", editable ? repeats : 0);
			childSetTentative("rptctrl",!identical);
			LLComboBox*	mComboTexGen = getChild<LLComboBox>("combobox texgen");
			if (mComboTexGen)
			{
				BOOL enabled = editable && (!mComboTexGen || mComboTexGen->getCurrentIndex() != 1);
				childSetEnabled("rptctrl",enabled);
				childSetEnabled("button apply",enabled);
			}
		}
		childSetEnabled("texture_math_constants",true);

		// Set variable values for numeric expressions
		calcp->setVar(LLCalc::TEX_U_SCALE, childGetValue("TexScaleU").asReal());
		calcp->setVar(LLCalc::TEX_V_SCALE, childGetValue("TexScaleV").asReal());
		calcp->setVar(LLCalc::TEX_U_OFFSET, childGetValue("TexOffsetU").asReal());
		calcp->setVar(LLCalc::TEX_V_OFFSET, childGetValue("TexOffsetV").asReal());
		calcp->setVar(LLCalc::TEX_ROTATION, childGetValue("TexRot").asReal());
		calcp->setVar(LLCalc::TEX_TRANSPARENCY, childGetValue("ColorTrans").asReal());
		calcp->setVar(LLCalc::TEX_GLOW, childGetValue("glow").asReal());
	}
开发者ID:Drakeo,项目名称:Drakeo-inWorldz-Viewer,代码行数:101,代码来源:llpanelface.cpp


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