本文整理汇总了C++中LLComboBox::setTextEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ LLComboBox::setTextEntry方法的具体用法?C++ LLComboBox::setTextEntry怎么用?C++ LLComboBox::setTextEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLComboBox
的用法示例。
在下文中一共展示了LLComboBox::setTextEntry方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refreshLocation
// static
void LLPanelLogin::refreshLocation( bool force_visible )
{
if (!sInstance) return;
#if USE_VIEWER_AUTH
loadLoginPage();
#else
LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
if (LLURLSimString::parse())
{
combo->setCurrentByIndex( 3 ); // BUG? Maybe 2?
combo->setTextEntry(LLURLSimString::sInstance.mSimString);
}
else
{
BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
combo->setCurrentByIndex( login_last ? 1 : 0 );
}
BOOL show_start = TRUE;
if ( ! force_visible )
show_start = gSavedSettings.getBOOL("ShowStartLocation");
// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
// TODO-RLVa: figure out some way to make this work with RLV_EXTENSION_STARTLOCATION
#ifndef RLV_EXTENSION_STARTLOCATION
if (rlv_handler_t::isEnabled())
{
show_start = FALSE;
}
#endif // RLV_EXTENSION_STARTLOCATION
// [/RLVa:KB]
// OGPX : if --ogp on the command line (or --set OpenGridProtocol TRUE), then
// the start location is hidden, and regionuri shows in its place.
// "Home", and "Last" have no meaning in OGPX, so it's OK to not have the start_location combo
// box unavailable on the menu panel.
if (gSavedSettings.getBOOL("OpenGridProtocol"))
{
sInstance->childSetVisible("start_location_combo", FALSE); // hide legacy box
sInstance->childSetVisible("start_location_text", TRUE); // when OGPX always show location
sInstance->childSetVisible("regionuri_edit",TRUE); // show regionuri box if OGPX
}
else
{
sInstance->childSetVisible("start_location_combo", show_start); // maintain ShowStartLocation if legacy
sInstance->childSetVisible("start_location_text", show_start);
sInstance->childSetVisible("regionuri_edit",FALSE); // Do Not show regionuri box if legacy
}
BOOL show_server = sInstance->mShowServerCombo || gSavedSettings.getBOOL("ForceShowGrid");
sInstance->childSetVisible("server_combo", show_server);
#endif
}
示例2: updateLocationCombo
// static
void LLPanelLogin::updateLocationCombo( bool force_visible )
{
if (!sInstance)
{
return;
}
LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
switch(LLStartUp::getStartSLURL().getType())
{
case LLSLURL::LOCATION:
{
combo->setCurrentByIndex( 2 );
combo->setTextEntry(LLStartUp::getStartSLURL().getLocationString());
break;
}
case LLSLURL::HOME_LOCATION:
combo->setCurrentByIndex(1);
break;
default:
combo->setCurrentByIndex(0);
break;
}
BOOL show_start = TRUE;
if ( ! force_visible )
show_start = gSavedSettings.getBOOL("ShowStartLocation");
sInstance->getChildView("start_location_combo")->setVisible( show_start);
sInstance->getChildView("start_location_text")->setVisible( show_start);
BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid");
sInstance->getChildView("server_combo_text")->setVisible( show_server);
sInstance->getChildView("grid_selection_text")->setVisible( show_server);
sInstance->getChildView("server_combo")->setVisible( show_server);
// <FS:Ansariel> Update visibility of Grid Manager help link
sInstance->getChildView("grid_mgr_help_text")->setVisible(show_server);
if (show_server)
{
updateServerCombo();
}
}
示例3: refreshLocation
// static
void LLPanelLogin::refreshLocation( bool force_visible )
{
if (!sInstance) return;
#if USE_VIEWER_AUTH
loadLoginPage();
#else
LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
if (LLURLSimString::parse())
{
combo->setCurrentByIndex( 3 ); // BUG? Maybe 2?
combo->setTextEntry(LLURLSimString::sInstance.mSimString);
}
else
{
BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
combo->setCurrentByIndex( login_last ? 1 : 0 );
}
BOOL show_start = TRUE;
if ( ! force_visible )
show_start = gSavedSettings.getBOOL("ShowStartLocation");
// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
// TODO-RLVa: figure out some way to make this work with RLV_EXTENSION_STARTLOCATION
#ifndef RLV_EXTENSION_STARTLOCATION
if (rlv_handler_t::isEnabled())
{
show_start = FALSE;
}
#endif // RLV_EXTENSION_STARTLOCATION
// [/RLVa:KB]
sInstance->childSetVisible("start_location_combo", show_start); // maintain ShowStartLocation if legacy
sInstance->childSetVisible("start_location_text", show_start);
sInstance->childSetVisible("regionuri_edit",FALSE); // Do Not show regionuri box if legacy
#endif
}
示例4: refreshLocation
// static
void LLPanelLogin::refreshLocation( bool force_visible )
{
if (!sInstance) return;
#if USE_VIEWER_AUTH
loadLoginPage();
#else
LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
if (LLURLSimString::parse())
{
combo->setCurrentByIndex( 3 ); // BUG? Maybe 2?
combo->setTextEntry(LLURLSimString::sInstance.mSimString);
}
else
{
BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
combo->setCurrentByIndex( login_last ? 1 : 0 );
}
BOOL show_start = TRUE;
if ( ! force_visible )
show_start = gSavedSettings.getBOOL("ShowStartLocation");
sInstance->childSetVisible("start_location_combo", show_start);
sInstance->childSetVisible("start_location_text", show_start);
#if LL_RELEASE_FOR_DOWNLOAD
// BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid");
// sInstance->childSetVisible("server_combo", show_server);
sInstance->childSetVisible("server_combo", TRUE); // Kirsten Always show Grid Choices!
#else
sInstance->childSetVisible("server_combo", TRUE);
#endif
#endif
}
示例5: if
//---------------------------------------------------------------------------
// Public methods
//---------------------------------------------------------------------------
LLPanelLogin::LLPanelLogin(const LLRect &rect,
BOOL show_server,
void (*callback)(S32 option, void* user_data),
void *cb_data)
: LLPanel(std::string("panel_login"), LLRect(0,600,800,0), FALSE), // not bordered
mLogoImage(),
mCallback(callback),
mCallbackData(cb_data),
mHtmlAvailable( TRUE )
{
setFocusRoot(TRUE);
setBackgroundVisible(FALSE);
setBackgroundOpaque(TRUE);
// instance management
if (LLPanelLogin::sInstance)
{
llwarns << "Duplicate instance of login view deleted" << llendl;
delete LLPanelLogin::sInstance;
// Don't leave bad pointer in gFocusMgr
gFocusMgr.setDefaultKeyboardFocus(NULL);
}
LLPanelLogin::sInstance = this;
// add to front so we are the bottom-most child
gViewerWindow->getRootView()->addChildAtEnd(this);
// Logo
mLogoImage = LLUI::getUIImage("startup_logo.j2c");
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_login.xml");
#if USE_VIEWER_AUTH
//leave room for the login menu bar
setRect(LLRect(0, rect.getHeight()-18, rect.getWidth(), 0));
#endif
reshape(rect.getWidth(), rect.getHeight());
#if !USE_VIEWER_AUTH
childSetPrevalidate("first_name_edit", LLLineEditor::prevalidatePrintableNoSpace);
childSetPrevalidate("last_name_edit", LLLineEditor::prevalidatePrintableNoSpace);
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 );
}
LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
server_choice_combo->setCommitCallback(onSelectServer);
//server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
childSetAction("connect_btn", onClickConnect, this);
childSetAction("grid_btn", onClickGrid, this);
setDefaultBtn("connect_btn");
// childSetAction("quit_btn", onClickQuit, this);
std::string imp_channel = gSavedSettings.getString("VersionChannelName");
std::string imp_version = llformat("%d.%d.%d %s",
//.........这里部分代码省略.........
示例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);
示例7: 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;
}
示例8: if
//---------------------------------------------------------------------------
// Public methods
//---------------------------------------------------------------------------
LLPanelLogin::LLPanelLogin(const LLRect &rect,
BOOL show_server,
void (*callback)(S32 option, void* user_data),
void *cb_data)
: LLPanel(std::string("panel_login"), LLRect(0,600,800,0), FALSE), // not bordered
mLogoImage(),
mCallback(callback),
mCallbackData(cb_data),
mHtmlAvailable( TRUE )
{
setFocusRoot(TRUE);
setBackgroundVisible(FALSE);
setBackgroundOpaque(TRUE);
// instance management
if (LLPanelLogin::sInstance)
{
llwarns << "Duplicate instance of login view deleted" << llendl;
delete LLPanelLogin::sInstance;
// Don't leave bad pointer in gFocusMgr
gFocusMgr.setDefaultKeyboardFocus(NULL);
}
LLPanelLogin::sInstance = this;
// add to front so we are the bottom-most child
gViewerWindow->getRootView()->addChildAtEnd(this);
// Logo
mLogoImage = LLUI::getUIImage("startup_logo.j2c");
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_login.xml");
#if USE_VIEWER_AUTH
//leave room for the login menu bar
setRect(LLRect(0, rect.getHeight()-18, rect.getWidth(), 0));
#endif
reshape(rect.getWidth(), rect.getHeight());
#if !USE_VIEWER_AUTH
childSetPrevalidate("first_name_edit", LLLineEditor::prevalidatePrintableNoSpace);
childSetPrevalidate("last_name_edit", LLLineEditor::prevalidatePrintableNoSpace);
LLComboBox* name_combo = getChild<LLComboBox>("name_combo");
// Only works as intended with this combination of flags,
// and in this order of setting them, therefore overriding xui
name_combo->setAllowTextEntry(TRUE);
name_combo->setTextEntryVisible(FALSE);
// Send it down the line, or the invisible text entry covers up our normal
// input fields if placed after them in xui
sendChildToBack(getChildView("name_combo"));
bool mru_enabled = gSavedSettings.getBOOL("LoginMRUEnabled");
if (mru_enabled)
{
LLSD name_list = gSavedSettings.getLLSD("LoginMRUList");
if (name_list.isArray())
{
for (LLSD::array_iterator iter = name_list.endArray() - 1; iter >= name_list.beginArray(); --iter)
{
if (iter->isMap() && iter->has("first") && iter->has("last"))
{
name_combo->add((*iter)["first"].asString() + " " + (*iter)["last"].asString(), *iter);
}
}
}
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
//.........这里部分代码省略.........