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


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

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


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

示例1: setData

void lggDicDownloadFloater::setData(std::vector<std::string> shortNames, std::vector<std::string> longNames, void* data)
{
	sNames = shortNames;
	lNames = longNames;
	empanel = (LLPrefsAscentChat*)data;

	LLComboBox* comboBox = getChild<LLComboBox>("Emerald_combo_dics");
	if (comboBox != NULL) 
	{
		comboBox->removeall();
		for (int i = 0; i < (int)lNames.size(); i++)
		{
			comboBox->add(lNames[i], ADD_BOTTOM);
		}
		comboBox->setCurrentByIndex(0);
		comboBox->add("", ADD_BOTTOM);
	}
}
开发者ID:Nekrofage,项目名称:SingularityViewer,代码行数:18,代码来源:lggdicdownload.cpp

示例2: refresh

// Update controls based on current settings
void LLPrefsAscentVan::refresh()
{
    //Main -----------------------------------------------------------------------------------

    //Tags\Colors ----------------------------------------------------------------------------
    LLComboBox* combo = getChild<LLComboBox>("tag_spoofing_combobox");
    combo->setCurrentByIndex(mSelectedClient);

    childSetEnabled("friends_color_textbox",     mUseStatusColors);
    childSetEnabled("friend_color_swatch",       mUseStatusColors || mColorFriendChat);
    childSetEnabled("estate_owner_color_swatch", mUseStatusColors || mColorEOChat);
    childSetEnabled("linden_color_swatch",       mUseStatusColors || mColorLindenChat);
    childSetEnabled("muted_color_swatch",        mUseStatusColors || mColorMutedChat);

    childSetEnabled("custom_tag_label_text",   mCustomTagOn);
    childSetEnabled("custom_tag_label_box",    mCustomTagOn);
    childSetValue("custom_tag_label_box", gSavedSettings.getString("AscentCustomTagLabel"));
    childSetEnabled("custom_tag_color_text",   mCustomTagOn);
    childSetEnabled("custom_tag_color_swatch", mCustomTagOn);
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:21,代码来源:ascentprefsvan.cpp

示例3: postBuild

// virtual
BOOL LLPreviewTexture::postBuild()
{
	if (mCopyToInv) 
	{
		getChild<LLButton>("Keep")->setLabel(getString("Copy"));
		childSetAction("Keep",LLPreview::onBtnCopyToInv,this);
		getChildView("Discard")->setVisible( false);
	}
	else if (mShowKeepDiscard)
	{
		childSetAction("Keep",onKeepBtn,this);
		childSetAction("Discard",onDiscardBtn,this);
	}
	else
	{
		getChildView("Keep")->setVisible( false);
		getChildView("Discard")->setVisible( false);
	}
	
	childSetAction("save_tex_btn", LLPreviewTexture::onSaveAsBtn, this);
	getChildView("save_tex_btn")->setVisible( true);
	getChildView("save_tex_btn")->setEnabled(canSaveAs());
	
	if (!mCopyToInv) 
	{
		const LLInventoryItem* item = getItem();
		
		if (item)
		{
			childSetCommitCallback("desc", LLPreview::onText, this);
			getChild<LLUICtrl>("desc")->setValue(item->getDescription());
			getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
		}
	}
	
	childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this);
	LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio");
	combo->setCurrentByIndex(0);
	
	return LLPreview::postBuild();
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:42,代码来源:llpreviewtexture.cpp

示例4: refresh

// called from setFocus()
// called internally too
void HippoPanelGridsImpl::refresh()
{
	const std::string &defaultGrid = gHippoGridManager->getDefaultGridName();

	LLComboBox *grids = getChild<LLComboBox>("grid_selector");
	S32 selectIndex = -1, i = 0;
	grids->removeall();
	if (defaultGrid != "") {
		grids->add(defaultGrid);
		selectIndex = i++;
	}
	HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
	for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
		const std::string &grid = it->second->getGridName();
		if (grid != defaultGrid) {
			grids->add(grid);
			if (grid == mCurGrid) selectIndex = i;
			i++;
		}
	}
	if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
		grids->add("<new>");
		selectIndex = i++;
	}
	if (selectIndex >= 0) {
		grids->setCurrentByIndex(selectIndex);
	} else {
		grids->setLabel(LLStringExplicit(""));  // LLComboBox::removeall() does not clear the label
	}

	childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " ");

	childSetEnabled("btn_delete", (selectIndex >= 0) && mIsEditable );
	childSetEnabled("btn_copy", (mState == NORMAL) && (selectIndex >= 0));
	childSetEnabled("btn_default", (mState == NORMAL) && (selectIndex > 0));
	childSetEnabled("gridname", (mState == ADD_NEW) || (mState == ADD_COPY));	
}
开发者ID:pcerioli,项目名称:SingularityViewer,代码行数:39,代码来源:hippopanelgrids.cpp

示例5: updateGridCombo

void LLPanelLogin::updateGridCombo()
{
	const std::string &defaultGrid = gHippoGridManager->getDefaultGridName();

	LLComboBox *grids = getChild<LLComboBox>("grids_combo");
	std::string top_entry;

	grids->removeall();

	const HippoGridInfo *curGrid = gHippoGridManager->getCurrentGrid();
	const HippoGridInfo *defGrid = gHippoGridManager->getGrid(defaultGrid);

	S32 idx(-1);
	HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
	for (it = gHippoGridManager->beginGrid(); it != end; ++it)
	{
		std::string grid = it->second->getGridName();
		if (grid.empty() || it->second == defGrid)
			continue;
		if (it->second == curGrid) idx = grids->getItemCount();
		grids->add(grid);
	}
	if (curGrid || defGrid)
	{
		if (defGrid)
		{
			grids->add(defGrid->getGridName(),ADD_TOP);
			++idx;
		}
		grids->setCurrentByIndex(idx);
	}
	else
	{
		grids->setLabel(LLStringExplicit(""));  // LLComboBox::removeall() does not clear the label
	}
}
开发者ID:sines,项目名称:SingularityViewer,代码行数:36,代码来源:llpanellogin.cpp

示例6: if


//.........这里部分代码省略.........
		regioncombo->addSimpleElement((*iter_history).asString());
	}

	if ( LLURLHistory::appendToURLCollection("regionuri",current_regionuri)) 
	{
		// since we are in login, another read of urlhistory file is going to happen 
		// so we need to persist the new value we just added (or maybe we should do it in startup.cpp?)

		// since URL history only populated on create of sInstance, add to combo list directly
		regioncombo->addSimpleElement(current_regionuri);
	}
	
	// select which is displayed if we have a current URL.
	regioncombo->setSelectedByValue(LLSD(current_regionuri),TRUE);

	//llinfos << " url history: " << LLSDOStreamer<LLSDXMLFormatter>(LLURLHistory::getURLHistory("regionuri")) << llendl;

	LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
	combo->setAllowTextEntry(TRUE, 128, FALSE);

	// The XML file loads the combo with the following labels:
	// 0 - "My Home"
	// 1 - "My Last Location"
	// 2 - "<Type region name>"

	BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
	std::string sim_string = LLURLSimString::sInstance.mSimString;
	if (!sim_string.empty())
	{
		// Replace "<Type region name>" with this region name
		combo->remove(2);
		combo->add( sim_string );
		combo->setTextEntry(sim_string);
		combo->setCurrentByIndex( 2 );
	}
	else if (login_last)
	{
		combo->setCurrentByIndex( 1 );
	}
	else
	{
		combo->setCurrentByIndex( 0 );
	}

	combo->setCommitCallback( &set_start_location );

	childSetAction("connect_btn", onClickConnect, this);

	setDefaultBtn("connect_btn");

	// childSetAction("quit_btn", onClickQuit, this);
	childSetAction("grids_btn", onClickGrids, this);
	childSetCommitCallback("grids_combo", onSelectGrid, this);

	std::string channel = LL_CHANNEL;

	std::string version = llformat("%d.%d.%d (%d)",
		LL_VERSION_MAJOR,
		LL_VERSION_MINOR,
		LL_VERSION_PATCH,
		LL_VIEWER_BUILD );
	LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
	channel_text->setTextArg("[CHANNEL]", channel); // though not displayed
	channel_text->setTextArg("[VERSION]", version);
	channel_text->setClickedCallback(onClickVersion);
	channel_text->setCallbackUserData(this);
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:67,代码来源:llpanellogin.cpp

示例7: refresh


//.........这里部分代码省略.........
		}
		else if(next_owner_mask_off & PERM_MODIFY)
		{
			childSetValue("checkbox next owner can modify",FALSE);
			childSetTentative("checkbox next owner can modify",false);
		}
		else
		{
			childSetValue("checkbox next owner can modify",TRUE);
			childSetTentative("checkbox next owner can modify",true);
		}

		// Copy == next owner cannot copy
		if(next_owner_mask_on & PERM_COPY)
		{			
			childSetValue("checkbox next owner can copy",TRUE);
			childSetTentative("checkbox next owner can copy",!can_copy);
		}
		else if(next_owner_mask_off & PERM_COPY)
		{
			childSetValue("checkbox next owner can copy",FALSE);
			childSetTentative("checkbox next owner can copy",FALSE);
		}
		else
		{
			childSetValue("checkbox next owner can copy",TRUE);
			childSetTentative("checkbox next owner can copy",TRUE);
		}

		// Transfer == next owner cannot transfer
		if(next_owner_mask_on & PERM_TRANSFER)
		{
			childSetValue("checkbox next owner can transfer",TRUE);
			childSetTentative("checkbox next owner can transfer",!can_transfer);
		}
		else if(next_owner_mask_off & PERM_TRANSFER)
		{
			childSetValue("checkbox next owner can transfer",FALSE);
			childSetTentative("checkbox next owner can transfer",FALSE);
		}
		else
		{
			childSetValue("checkbox next owner can transfer",TRUE);
			childSetTentative("checkbox next owner can transfer",TRUE);
		}
	}

	// reflect sale information
	LLSaleInfo sale_info;
	BOOL valid_sale_info = LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info);
	LLSaleInfo::EForSale sale_type = sale_info.getSaleType();

	LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("sale type");
	if(RadioSaleType)
	{
		if (valid_sale_info)
		{
			RadioSaleType->setSelectedIndex((S32)sale_type - 1);
			RadioSaleType->setTentative(FALSE); // unfortunately this doesn't do anything at the moment.
		}
		else
		{
			// default option is sell copy, determined to be safest
			RadioSaleType->setSelectedIndex((S32)LLSaleInfo::FS_COPY - 1);
			RadioSaleType->setTentative(TRUE); // unfortunately this doesn't do anything at the moment.
		}
	}

	childSetValue("checkbox for sale", num_for_sale != 0);

	// HACK: There are some old objects in world that are set for sale,
	// but are no-transfer.  We need to let users turn for-sale off, but only
	// if for-sale is set.
	bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY);
	if (num_for_sale && has_change_sale_ability && cannot_actually_sell)
	{
		childSetEnabled("checkbox for sale", true);
	}
		
	// Check search status of objects
	BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME );
	bool include_in_search;
	bool all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search);
	childSetEnabled("search_check", has_change_sale_ability && all_volume);
	childSetValue("search_check", include_in_search);
	childSetTentative("search_check", ! all_include_in_search);

	// Click action (touch, sit, buy)
	U8 click_action = 0;
	if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action))
	{
		LLComboBox*	ComboClickAction = getChild<LLComboBox>("clickaction");
		if(ComboClickAction)
		{
			ComboClickAction->setCurrentByIndex((S32)click_action);
		}
	}
	childSetEnabled("label click action",is_perm_modify && all_volume);
	childSetEnabled("clickaction",is_perm_modify && all_volume);
}
开发者ID:PhoenixDesmoulins,项目名称:imprudence,代码行数:101,代码来源:llpanelpermissions.cpp

示例8: refresh

void LLPrefsAscentSysImpl::refresh()
{	
	//General -----------------------------------------------------------------------------
	childSetValue("double_click_teleport_check",	mDoubleClickTeleport);
		childSetValue("center_after_teleport_check",	mResetCameraAfterTP);
		childSetValue("offset_teleport_check",			mOffsetTPByUserHeight);
	childSetValue("preview_anim_in_world_check",	mPreviewAnimInWorld);
	childSetValue("save_scripts_as_mono_check",		mSaveScriptsAsMono);
	childSetValue("always_rez_in_group_check",		mAlwaysRezInGroup);
	//Disable Teleport Progress
	//Disable Logout progress
	//always show Build
	childSetValue("always_fly_check",				mAlwaysShowFly);
	//Disable camera minimum distance
	//Chat --------------------------------------------------------------------------------
	childSetValue("hide_notifications_in_chat_check", mHideNotificationsInChat);
	childSetValue("play_typing_sound_check",		mPlayTypingSound);
	childSetValue("hide_typing_check",				mHideTypingNotification);
	childSetValue("seconds_in_chat_and_ims_check",	mSecondsInChatAndIMs);
	childSetValue("allow_mu_pose_check",			mEnableMUPose);
	childSetValue("close_ooc_check",				mEnableOOCAutoClose);
	LLRadioGroup* radioLinkOptions = getChild<LLRadioGroup>("objects_link");
	radioLinkOptions->selectNthItem(mLinksForChattingObjects);
	//childSetValue("objects_link",					mLinksForChattingObjects);
	std::string format = gSavedSettings.getString("ShortTimeFormat");
	if (format.find("%p") == -1)
	{
		mTimeFormat = 0;
	}
	else
	{
		mTimeFormat = 1;
	}

	format = gSavedSettings.getString("ShortDateFormat");
	if (format.find("%m/%d/%") != -1)
	{
		mDateFormat = 2;
	}
	else if (format.find("%d/%m/%") != -1)
	{
		mDateFormat = 1;
	}
	else
	{
		mDateFormat = 0;
	}

	// time format combobox
	LLComboBox* combo = getChild<LLComboBox>("time_format_combobox");
	if (combo)
	{
		combo->setCurrentByIndex(mTimeFormat);
	}

	// date format combobox
	combo = getChild<LLComboBox>("date_format_combobox");
	if (combo)
	{
		combo->setCurrentByIndex(mDateFormat);
	}

	childSetValue("seconds_in_chat_and_ims_check",	mEnableOOCAutoClose);
	//Save Performance --------------------------------------------------------------------
	childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin);
	childSetValue("enable_wind", mEnableLLWind);
	childSetValue("enable_clouds", mEnableClouds);
	childSetValue("speed_rez_check", mSpeedRez);
	if (mSpeedRez)
	{
		childEnable("speed_rez_interval");
		childEnable("speed_rez_seconds");
	}
	else
	{
		childDisable("speed_rez_interval");
		childDisable("speed_rez_seconds");
	}
	//Command Line ------------------------------------------------------------------------

	//Privacy -----------------------------------------------------------------------------
	childSetValue("broadcast_viewer_effects", mBroadcastViewerEffects);
	childSetValue("disable_point_at_and_beams_check", mDisablePointAtAndBeam);
	childSetValue("private_look_at_check", mPrivateLookAt);
	childSetValue("show_look_at_check", mShowLookAt);
	childSetValue("revoke_perms_on_stand_up_check", mRevokePermsOnStandUp);
}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:87,代码来源:ascentprefssys.cpp

示例9: refresh

// Update controls based on current settings
void LLPrefsAscentChat::refresh()
{
    //Chat --------------------------------------------------------------------------------
    // time format combobox
    LLComboBox* combo = getChild<LLComboBox>("time_format_combobox");
    if (combo)
    {
        combo->setCurrentByIndex(mTimeFormat);
    }

    // date format combobox
    combo = getChild<LLComboBox>("date_format_combobox");
    if (combo)
    {
        combo->setCurrentByIndex(mDateFormat);
    }

    childSetValue("AscentInstantMessageResponseAnyone",  mIMResponseAnyone);
    childSetValue("AscentInstantMessageResponseFriends", mIMResponseFriends);
    childSetValue("AscentInstantMessageResponseMuted",   mIMResponseMuted);
    childSetValue("AscentInstantMessageShowOnTyping",    mIMShowOnTyping);
    childSetValue("AscentInstantMessageShowResponded",   mIMShowResponded);
    childSetValue("AscentInstantMessageResponseRepeat",  mIMResponseRepeat);
    childSetValue("AscentInstantMessageResponseItem",    mIMResponseItem);

    LLWString auto_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("AscentInstantMessageResponse") );
    LLWStringUtil::replaceChar(auto_response, '^', '\n');
    LLWStringUtil::replaceChar(auto_response, '%', ' ');
    childSetText("im_response", wstring_to_utf8str(auto_response));

    //Text Options ------------------------------------------------------------------------
    combo = getChild<LLComboBox>("SpellBase");

    if (combo != NULL) 
    {
        combo->removeall();
        std::vector<std::string> names = glggHunSpell->getDicts();

        for (int i = 0; i < (int)names.size(); i++) 
        {
            combo->add(names[i]);
        }

        combo->setSimple(gSavedSettings.getString("SpellBase"));
    }

    combo = getChild<LLComboBox>("EmSpell_Avail");

    if (combo != NULL) 
    {
        combo->removeall();

        combo->add("");
        std::vector<std::string> names = glggHunSpell->getAvailDicts();

        for (int i = 0; i < (int)names.size(); i++) 
        {
            combo->add(names[i]);
        }

        combo->setSimple(std::string(""));
    }

    combo = getChild<LLComboBox>("EmSpell_Installed");

    if (combo != NULL) 
    {
        combo->removeall();

        combo->add("");
        std::vector<std::string> names = glggHunSpell->getInstalledDicts();

        for (int i = 0; i < (int)names.size(); i++) 
        {
            combo->add(names[i]);
        }

        combo->setSimple(std::string(""));
    }

    childSetEnabled("KeywordsList",        mKeywordsOn);
    childSetEnabled("KeywordsInChat",      mKeywordsOn);
    childSetEnabled("KeywordsInIM",        mKeywordsOn);
    childSetEnabled("KeywordsChangeColor", mKeywordsOn);
    childSetEnabled("KeywordsColor",       mKeywordsOn);
    childSetEnabled("KeywordsPlaySound",   mKeywordsOn);
    childSetEnabled("KeywordsSound",       mKeywordsOn);

    childSetValue("KeywordsOn",          mKeywordsOn);
    childSetValue("KeywordsList",        mKeywordsList);
    childSetValue("KeywordsInChat",      mKeywordsInChat);
    childSetValue("KeywordsInIM",        mKeywordsInIM);
    childSetValue("KeywordsChangeColor", mKeywordsChangeColor);

    LLColorSwatchCtrl* colorctrl = getChild<LLColorSwatchCtrl>("KeywordsColor");
    colorctrl->set(LLColor4(mKeywordsColor),TRUE);

    childSetValue("KeywordsPlaySound",   mKeywordsPlaySound);
    childSetValue("KeywordsSound",       mKeywordsSound);
//.........这里部分代码省略.........
开发者ID:samiam123,项目名称:SingularityViewer,代码行数:101,代码来源:ascentprefschat.cpp

示例10: postBuild

BOOL LLPanelGeneral::postBuild()
{
	LLComboBox* fade_out_combobox = getChild<LLComboBox>("fade_out_combobox");
	fade_out_combobox->setCurrentByIndex(gSavedSettings.getS32("RenderName"));

	LLComboBox* combo = getChild<LLComboBox>("default_location_combo");
	childSetCommitCallback("default_location_combo", onLocationChanged, this);
	combo->setAllowTextEntry(TRUE, 128, FALSE);

	// The XML file loads the combo with the following labels:
	// 0 - "My Home"
	// 1 - "My Last Location"
	// 2 - "<Type region name>"

	BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
	std::string sim_string = LLURLSimString::sInstance.mSimString;
	if (!sim_string.empty())
	{
		// Replace "<Type region name>" with this region name
		combo->remove(2);
		combo->add( sim_string );
		combo->setTextEntry(sim_string);
		combo->setCurrentByIndex( 2 );
	}
	else if (login_last)
	{
		combo->setCurrentByIndex( 1 );
	}
	else
	{
		combo->setCurrentByIndex( 0 );
	}

	childSetValue("show_location_checkbox", gSavedSettings.getBOOL("ShowStartLocation"));
	childSetValue("show_all_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitleAll"));
	childSetValue("show_my_name_checkbox", gSavedSettings.getBOOL("RenderNameHideSelf"));
	childSetValue("large_avatar_names_checkbox", !gSavedSettings.getBOOL("SmallAvatarNames"));
	childSetValue("highlight_friends_checkbox", gSavedSettings.getBOOL("HighlightFriends"));
	//childSetValue("show_my_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitle")); -- MC

	childSetEnabled("afk_timeout_spinner", gSavedSettings.getBOOL("AllowIdleAFK"));
	childSetValue("afk_timeout_spinner", llround(gSavedSettings.getF32("AFKTimeout") / 60)); // User enters minutes, we store as seconds -- MC
	childSetValue("afk_timeout_checkbox", gSavedSettings.getBOOL("AllowIdleAFK"));
	childSetCommitCallback("afk_timeout_checkbox", onCommitAFKCheckbox, this);

	childSetValue("mini_map_notify_chat", gSavedSettings.getBOOL("MiniMapNotifyChatRange"));
	childSetValue("mini_map_notify_sim", gSavedSettings.getBOOL("MiniMapNotifySimRange"));

// 	mDisplayNamesUsage =  gSavedSettings.getU32("DisplayNamesUsage");
// 	mLegacyNamesForFriends =  gSavedSettings.getBOOL("LegacyNamesForFriends");

	LLComboBox* time_combobox = getChild<LLComboBox>("time_combobox");
	time_combobox->setCurrentByIndex(gSavedSettings.getU32("TimeFormat"));
	
	childSetValue("language_combobox", 	gSavedSettings.getString("Language"));
	
	// if we have no agent, we can't let them choose anything
	// if we have an agent, then we only let them choose if they have a choice
	bool can_choose = gAgent.getID().notNull() &&
					 (gAgent.isMature() || gAgent.isGodlike());
	
	if (can_choose)
	{
		// if they're not adult or a god, they shouldn't see the adult selection, so delete it
		if (!gAgent.isAdult() && !gAgent.isGodlike())
		{
			LLComboBox* maturity_combo = getChild<LLComboBox>("maturity_desired_combobox");
			// we're going to remove the adult entry from the combo. This obviously depends
			// on the order of items in the XML file, but there doesn't seem to be a reasonable
			// way to depend on the field in XML called 'name'.
			maturity_combo->remove(0);
		}
	}
	
	U32 preferred_maturity = gSavedSettings.getU32("PreferredMaturity");
	childSetValue("maturity_desired_combobox", int(preferred_maturity));
	std::string selected_item_label = getChild<LLComboBox>("maturity_desired_combobox")->getSelectedItemLabel();
	childSetValue("maturity_desired_textbox", selected_item_label);
	
	childSetVisible("maturity_desired_combobox", can_choose);
	childSetVisible("maturity_desired_textbox",	!can_choose);

	childSetAction("grid_btn", onClickGrid, this);
			
	return TRUE;
}
开发者ID:9skunks,项目名称:imprudence,代码行数:86,代码来源:llpanelgeneral.cpp

示例11: onTextEntry

//static 
void LLComboBox::onTextEntry(LLLineEditor* line_editor, void* user_data)
{
	LLComboBox* self = (LLComboBox*)user_data;

	if (self->mTextEntryCallback)
	{
		(*self->mTextEntryCallback)(line_editor, self->mCallbackUserData);
	}

	KEY key = gKeyboard->currentKey();
	if (key == KEY_BACKSPACE || 
		key == KEY_DELETE)
	{
		if (self->mList->selectItemByLabel(line_editor->getText(), FALSE))
		{
			line_editor->setTentative(FALSE);
		}
		else
		{
			if (!self->mSuppressTentative) line_editor->setTentative(self->mTextEntryTentative);
			self->mList->deselectAllItems();
		}
		return;
	}

	if (key == KEY_LEFT || 
		key == KEY_RIGHT)
	{
		return;
	}

	if (key == KEY_DOWN)
	{
		self->setCurrentByIndex(llmin(self->getItemCount() - 1, self->getCurrentIndex() + 1));
		if (!self->mList->getVisible())
		{
			if( self->mPrearrangeCallback )
			{
				self->mPrearrangeCallback( self, self->mCallbackUserData );
			}

			if (self->mList->getItemCount() != 0)
			{
				self->showList();
			}
		}
		line_editor->selectAll();
		line_editor->setTentative(FALSE);
	}
	else if (key == KEY_UP)
	{
		self->setCurrentByIndex(llmax(0, self->getCurrentIndex() - 1));
		if (!self->mList->getVisible())
		{
			if( self->mPrearrangeCallback )
			{
				self->mPrearrangeCallback( self, self->mCallbackUserData );
			}

			if (self->mList->getItemCount() != 0)
			{
				self->showList();
			}
		}
		line_editor->selectAll();
		line_editor->setTentative(FALSE);
	}
	else
	{
		// RN: presumably text entry
		self->updateSelection();
	}
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:74,代码来源:llcombobox.cpp

示例12: postBuild

// virtual
BOOL LLPreviewTexture::postBuild()
{
	if (mCopyToInv) 
	{
		getChild<LLButton>("Keep")->setLabel(getString("Copy"));
		childSetAction("Keep",LLPreview::onBtnCopyToInv,this);
		getChildView("Discard")->setVisible( false);
	}
	else if (mShowKeepDiscard)
	{
		childSetAction("Keep",onKeepBtn,this);
		childSetAction("Discard",onDiscardBtn,this);
	}
	else
	{
		getChildView("Keep")->setVisible( false);
		getChildView("Discard")->setVisible( false);
	}
	
	childSetCommitCallback("save_tex_btn", onSaveAsBtn, this);
	getChildView("save_tex_btn")->setVisible(canSaveAs()); // Ansariel: No need to show the save button if we can't save anyway
	getChildView("save_tex_btn")->setEnabled(canSaveAs());
	
	if (!mCopyToInv) 
	{
		const LLInventoryItem* item = getItem();
		
		if (item)
		{
			childSetCommitCallback("desc", LLPreview::onText, this);
			getChild<LLUICtrl>("desc")->setValue(item->getDescription());
			getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
		}
	}

	// Fill in ratios list with common aspect ratio values
	mRatiosList.clear();
	mRatiosList.push_back(LLTrans::getString("Unconstrained"));
	mRatiosList.push_back("1:1");
	mRatiosList.push_back("4:3");
	mRatiosList.push_back("10:7");
	mRatiosList.push_back("3:2");
	mRatiosList.push_back("16:10");
	mRatiosList.push_back("16:9");
	mRatiosList.push_back("2:1");
	
	// Now fill combo box with provided list
	LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio");
	combo->removeall();

	for (std::vector<std::string>::const_iterator it = mRatiosList.begin(); it != mRatiosList.end(); ++it)
	{
		combo->add(*it);
	}

	childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this);
	combo->setCurrentByIndex(0);

	// <FS:Techwolf Lupindo> texture comment metadata reader
	getChild<LLButton>("openprofile")->setClickedCallback(boost::bind(&LLPreviewTexture::onButtonClickProfile, this));
	getChild<LLButton>("copyuuid")->setClickedCallback(boost::bind(&LLPreviewTexture::onButtonClickUUID, this));
	mUploaderDateTime = getString("UploaderDateTime");
	// </FS:Techwolf Lupindo>

	// <FS:Ansariel> AnsaStorm skin: Need to disable line editors from
	//               code or the floater would be dragged around if
	//               trying to mark text
	if (findChild<LLLineEditor>("uploader"))
	{
		getChild<LLLineEditor>("uploader")->setEnabled(FALSE);
		getChild<LLLineEditor>("upload_time")->setEnabled(FALSE);
		getChild<LLLineEditor>("uuid")->setEnabled(FALSE);
	}
	// </FS:Ansariel>

	// <FS:Ansariel> Performance improvement
	mDimensionsCtrl = getChild<LLUICtrl>("dimensions");

	return LLPreview::postBuild();
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:81,代码来源:llpreviewtexture.cpp

示例13: refresh

void LLPrefsAscentSysImpl::refresh()
{	
	//General -----------------------------------------------------------------------------
	childSetValue("double_click_teleport_check",	mDoubleClickTeleport);
		childSetValue("center_after_teleport_check",	mResetCameraAfterTP);
		childSetEnabled("center_after_teleport_check",	mDoubleClickTeleport);
		childSetValue("offset_teleport_check",			mOffsetTPByUserHeight);
		childSetEnabled("offset_teleport_check",		mDoubleClickTeleport);
	childSetValue("preview_anim_in_world_check",	mPreviewAnimInWorld);
	childSetValue("save_scripts_as_mono_check",		mSaveScriptsAsMono);
	childSetValue("always_rez_in_group_check",		mAlwaysRezInGroup);
	//Disable Teleport Progress
	//Disable Logout progress
	//always show Build
	childSetValue("always_fly_check",				mAlwaysShowFly);
	//Disable camera minimum distance
	childSetValue("power_user_check",				mPowerUser);
	childSetValue("power_user_confirm_check",		mPowerUser);
	childSetValue("system_folder_check",			mUseSystemFolder);
		childSetValue("temp_in_system_check",			mUploadToSystem);
		childSetEnabled("temp_in_system_check",			mUseSystemFolder);
	//Chat --------------------------------------------------------------------------------
	childSetValue("hide_notifications_in_chat_check", mHideNotificationsInChat);
	childSetValue("play_typing_sound_check",		mPlayTypingSound);
	childSetValue("hide_typing_check",				mHideTypingNotification);
	childSetValue("seconds_in_chat_and_ims_check",	mSecondsInChatAndIMs);
	childSetValue("allow_mu_pose_check",			mEnableMUPose);
	childSetValue("close_ooc_check",				mEnableOOCAutoClose);
	LLRadioGroup* radioLinkOptions = getChild<LLRadioGroup>("objects_link");
	radioLinkOptions->selectNthItem(mLinksForChattingObjects);
	//childSetValue("objects_link",					mLinksForChattingObjects);
	std::string format = gSavedSettings.getString("ShortTimeFormat");
	if (format.find("%p") == -1)
	{
		mTimeFormat = 0;
	}
	else
	{
		mTimeFormat = 1;
	}

	format = gSavedSettings.getString("ShortDateFormat");
	if (format.find("%m/%d/%") != -1)
	{
		mDateFormat = 2;
	}
	else if (format.find("%d/%m/%") != -1)
	{
		mDateFormat = 1;
	}
	else
	{
		mDateFormat = 0;
	}

	// time format combobox
	LLComboBox* combo = getChild<LLComboBox>("time_format_combobox");
	if (combo)
	{
		combo->setCurrentByIndex(mTimeFormat);
	}

	// date format combobox
	combo = getChild<LLComboBox>("date_format_combobox");
	if (combo)
	{
		combo->setCurrentByIndex(mDateFormat);
	}

	childSetValue("seconds_in_chat_and_ims_check",	mSecondsInChatAndIMs);


	LLWString auto_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("AscentInstantMessageResponse") );
	LLWStringUtil::replaceChar(auto_response, '^', '\n');
	LLWStringUtil::replaceChar(auto_response, '%', ' ');
	childSetText("im_response", wstring_to_utf8str(auto_response));
	childSetValue("AscentInstantMessageResponseFriends", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseFriends"));
	childSetValue("AscentInstantMessageResponseMuted", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseMuted"));
	childSetValue("AscentInstantMessageResponseAnyone", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseAnyone"));
	childSetValue("AscentInstantMessageShowResponded", gSavedPerAccountSettings.getBOOL("AscentInstantMessageShowResponded"));
	childSetValue("AscentInstantMessageShowOnTyping", gSavedPerAccountSettings.getBOOL("AscentInstantMessageAnnounceIncoming"));
	childSetValue("AscentInstantMessageResponseRepeat", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat" ));
	childSetValue("AscentInstantMessageResponseItem", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseItem"));


	//Save Performance --------------------------------------------------------------------
	childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin);
	childSetValue("enable_wind", mEnableLLWind);
	childSetValue("enable_clouds", mEnableClouds);
		childSetValue("enable_classic_clouds", mEnableClassicClouds);
	gLLWindEnabled = mEnableLLWind;
	childSetValue("speed_rez_check", mSpeedRez);
		childSetEnabled("speed_rez_interval", mSpeedRez);
		childSetEnabled("speed_rez_seconds", mSpeedRez);
	//Command Line ------------------------------------------------------------------------

	//Privacy -----------------------------------------------------------------------------
	childSetValue("broadcast_viewer_effects", mBroadcastViewerEffects);
	childSetValue("disable_point_at_and_beams_check", mDisablePointAtAndBeam);
	childSetValue("private_look_at_check", mPrivateLookAt);
//.........这里部分代码省略.........
开发者ID:CharleyLevenque,项目名称:SingularityViewer,代码行数:101,代码来源:ascentprefssys.cpp

示例14: if


//.........这里部分代码省略.........
		}
		childSetCommitCallback("name_combo", onSelectLoginMRU, this);
	}
	setLoginMRUEnabled(mru_enabled);


	childSetCommitCallback("password_edit", mungePassword);
	childSetKeystrokeCallback("password_edit", onPassKey, this);
	childSetUserData("password_edit", this);

	// change z sort of clickable text to be behind buttons
	sendChildToBack(getChildView("channel_text"));
	sendChildToBack(getChildView("forgot_password_text"));

	LLLineEditor* edit = getChild<LLLineEditor>("password_edit");
	if (edit) edit->setDrawAsterixes(TRUE);

	LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
	combo->setAllowTextEntry(TRUE, 128, FALSE);

	// The XML file loads the combo with the following labels:
	// 0 - "My Home"
	// 1 - "My Last Location"
	// 2 - "<Type region name>"

	BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
	std::string sim_string = LLURLSimString::sInstance.mSimString;
	if (!sim_string.empty())
	{
		// Replace "<Type region name>" with this region name
		combo->remove(2);
		combo->add( sim_string );
		combo->setTextEntry(sim_string);
		combo->setCurrentByIndex( 2 );
	}
	else if (login_last)
	{
		combo->setCurrentByIndex( 1 );
	}
	else
	{
		combo->setCurrentByIndex( 0 );
	}

	combo->setCommitCallback( &set_start_location );

	LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
	server_choice_combo->setCommitCallback(onSelectServer);
	server_choice_combo->setFocusLostCallback(onServerComboLostFocus);

	childSetAction("connect_btn", onClickConnect, this);

	setDefaultBtn("connect_btn");

	// childSetAction("quit_btn", onClickQuit, this);

	std::string channel = llformat("(%s)",
		DX_CHANNEL ); 
	// Kirsten uses version Viewer headers not saved settings! for channel info.
	std::string version = llformat("%d.%d.%d (%d)",
		LL_VERSION_MAJOR,
		LL_VERSION_MINOR,
		LL_VERSION_PATCH,
		LL_VIEWER_BUILD );
	LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
	channel_text->setTextArg("[CHANNEL]", channel); // though not displayed
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:67,代码来源:llpanellogin.cpp

示例15: refresh

// Update controls based on current settings
void LLPrefsAscentChat::refresh()
{
    //Chat --------------------------------------------------------------------------------
    // time format combobox
    LLComboBox* combo = getChild<LLComboBox>("time_format_combobox");
    if (combo)
    {
        combo->setCurrentByIndex(mTimeFormat);
    }

    // date format combobox
    combo = getChild<LLComboBox>("date_format_combobox");
    if (combo)
    {
        combo->setCurrentByIndex(mDateFormat);
    }

    //Antispam ------------------------------------------------------------------------
	// sensitivity tuners
	childSetEnabled("spammsg_checkbox",          mEnableAS);
	childSetEnabled("antispamtime",              mEnableAS);
	childSetEnabled("antispamamount",            mEnableAS);
	childSetEnabled("antispamsoundmulti",        mEnableAS);
	childSetEnabled("antispamsoundpreloadmulti", mEnableAS);
	childSetEnabled("antispamnewlines",          mEnableAS);
	childSetEnabled("Notify On Spam",            mEnableAS);
	// dialog blocking tuners
	childSetEnabled("Block All Dialogs From", !mBlockDialogSpam);
	childSetEnabled("Alerts",                 !mBlockDialogSpam);
	childSetEnabled("Friendship Offers",      !mBlockDialogSpam);
	childSetEnabled("Group Invites",          !mBlockDialogSpam);
	childSetEnabled("Group Fee Invites",      !mBlockDialogSpam && !mBlockGroupInviteSpam);
	childSetEnabled("Group Notices",          !mBlockDialogSpam);
	childSetEnabled("Item Offers",            !mBlockDialogSpam);
	childSetEnabled("Scripts",                !mBlockDialogSpam);
	childSetEnabled("Teleport Offers",        !mBlockDialogSpam);

    //Text Options ------------------------------------------------------------------------
    combo = getChild<LLComboBox>("SpellBase");

    if (combo != NULL) 
    {
        combo->removeall();
        std::vector<std::string> names = glggHunSpell->getDicts();

        for (int i = 0; i < (int)names.size(); i++) 
        {
            combo->add(names[i]);
        }

        combo->setSimple(gSavedSettings.getString("SpellBase"));
    }

    combo = getChild<LLComboBox>("EmSpell_Avail");

    if (combo != NULL) 
    {
        combo->removeall();

        combo->add("");
        std::vector<std::string> names = glggHunSpell->getAvailDicts();

        for (int i = 0; i < (int)names.size(); i++) 
        {
            combo->add(names[i]);
        }

        combo->setSimple(std::string(""));
    }

    combo = getChild<LLComboBox>("EmSpell_Installed");

    if (combo != NULL) 
    {
        combo->removeall();

        combo->add("");
        std::vector<std::string> names = glggHunSpell->getInstalledDicts();

        for (int i = 0; i < (int)names.size(); i++) 
        {
            combo->add(names[i]);
        }

        combo->setSimple(std::string(""));
    }

    childSetEnabled("KeywordsList",        mKeywordsOn);
    childSetEnabled("KeywordsInChat",      mKeywordsOn);
    childSetEnabled("KeywordsInIM",        mKeywordsOn);
    childSetEnabled("KeywordsChangeColor", mKeywordsOn);
    childSetEnabled("KeywordsColor",       mKeywordsOn);
    childSetEnabled("KeywordsPlaySound",   mKeywordsOn);
    childSetEnabled("KeywordsSound",       mKeywordsOn);

    childSetValue("KeywordsOn",          mKeywordsOn);
    childSetValue("KeywordsList",        mKeywordsList);
    childSetValue("KeywordsInChat",      mKeywordsInChat);
    childSetValue("KeywordsInIM",        mKeywordsInIM);
//.........这里部分代码省略.........
开发者ID:OS-Development,项目名称:VW.Singularity,代码行数:101,代码来源:ascentprefschat.cpp


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