本文整理汇总了C++中setDefaultBtn函数的典型用法代码示例。如果您正苦于以下问题:C++ setDefaultBtn函数的具体用法?C++ setDefaultBtn怎么用?C++ setDefaultBtn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setDefaultBtn函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: childSetCommitCallback
// virtual
BOOL LLPanelFriends::postBuild()
{
mFriendsList = getChild<LLScrollListCtrl>("friend_list");
mFriendsList->setCommitOnSelectionChange(TRUE);
childSetCommitCallback("friend_list", onSelectName, this);
childSetCommitCallback("buddy_group_combobox", onChangeContactGroup, this);
childSetDoubleClickCallback("friend_list", onClickIM);
// <dogmode>
// Contact search and group system.
// 09/05/2010 - Charley Levenque
LLSearchEditor* contact = getChild<LLSearchEditor>("buddy_search_lineedit");
if (contact)
{
contact->setSearchCallback(&onContactSearchEdit, this);
}
getChild<LLTextBox>("s_num")->setValue("0");
getChild<LLTextBox>("f_num")->setValue(llformat("%d", mFriendsList->getItemCount()));
U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE;
refreshNames(changed_mask);
childSetAction("im_btn", onClickIM, this);
childSetAction("assign_btn", onClickAssign, this);
childSetAction("expand_collapse_btn", onClickExpand, this);
childSetAction("profile_btn", onClickProfile, this);
childSetAction("offer_teleport_btn", onClickOfferTeleport, this);
childSetAction("pay_btn", onClickPay, this);
childSetAction("add_btn", onClickAddFriend, this);
childSetAction("remove_btn", onClickRemove, this);
//childSetAction("export_btn", onClickExport, this); Making Dummy View -HgB
//childSetAction("import_btn", onClickImport, this); Making Dummy View -HgB
setDefaultBtn("im_btn");
updateFriends(LLFriendObserver::ADD);
refreshUI();
// primary sort = online status, secondary sort = name
mFriendsList->sortByColumn(std::string("friend_name"), TRUE);
mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE);
updateColumns(this);
return TRUE;
}
开发者ID:Krazy-Bish-Margie,项目名称:SingularityViewer,代码行数:48,代码来源:llfloaterfriends.cpp
示例2: setDefaultBtn
// virtual
void LLAlertDialog::draw()
{
// if the default button timer has just expired, activate the default button
if(mDefaultBtnTimer.hasExpired() && mDefaultBtnTimer.getStarted())
{
mDefaultBtnTimer.stop(); // prevent this block from being run more than once
setDefaultBtn(mDefaultButton);
}
static LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow");
static S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater");
gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0,
shadow_color, shadow_lines);
LLModalDialog::draw();
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:18,代码来源:llalertdialog.cpp
示例3: init_group_list
BOOL LLFloaterGroupPicker::postBuild()
{
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), mPowersMask);
childSetAction("OK", onBtnOK, this);
childSetAction("Cancel", onBtnCancel, this);
setDefaultBtn("OK");
childSetDoubleClickCallback("group list", onBtnOK);
childSetUserData("group list", this);
childEnable("OK");
return TRUE;
}
开发者ID:Nora28,项目名称:imprudence,代码行数:17,代码来源:llfloatergroups.cpp
示例4: LLFloater
LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarType var_type, void *var) :
LLFloater(std::string("msg box"), LLRect(10,160,400,10), title),
mVarType(var_type), mVarData(var), mAnimate(FALSE)
{
switch(var_type)
{
case VAR_TYPE_F32:
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, *((F32*)var), -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider1->setPrecision(3);
addChild(mSlider1);
mSlider2 = NULL;
mSlider3 = NULL;
break;
case VAR_TYPE_S32:
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,100,190,80), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, (F32)*((S32*)var), -255.f, 255.f, 1.f, LLStringUtil::null);
mSlider1->setPrecision(0);
addChild(mSlider1);
mSlider2 = NULL;
mSlider3 = NULL;
break;
case VAR_TYPE_VEC3:
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), std::string("x: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VX], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider1->setPrecision(3);
mSlider2 = new LLSliderCtrl(std::string("slider 2"), LLRect(20,100,190,80), std::string("y: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VY], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider2->setPrecision(3);
mSlider3 = new LLSliderCtrl(std::string("slider 3"), LLRect(20,70,190,50), std::string("z: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VZ], -100.f, 100.f, 0.1f, LLStringUtil::null);
mSlider3->setPrecision(3);
addChild(mSlider1);
addChild(mSlider2);
addChild(mSlider3);
break;
default:
llwarns << "Unhandled var type " << var_type << llendl;
break;
}
mAnimateButton = new LLButton(std::string("Animate"), LLRect(20, 45, 180, 25), LLStringUtil::null, boost::bind(&LLDebugVarMessageBox::onAnimateClicked, this));
addChild(mAnimateButton);
mText = new LLTextBox(std::string("value"), LLRect(20,20,190,0));
addChild(mText);
//disable hitting enter closes dialog
setDefaultBtn();
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:45,代码来源:lldebugmessagebox.cpp
示例5: getChildView
BOOL LLFloaterBuy::postBuild()
{
getChildView("object_list")->setEnabled(FALSE);
getChildView("item_list")->setEnabled(FALSE);
getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuy::onClickCancel, this));
getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuy::onClickBuy, this));
setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130)
// Always center the dialog. User can change the size,
// but purchases are important and should be center screen.
// This also avoids problems where the user resizes the application window
// mid-session and the saved rect is off-center.
center();
return TRUE;
}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:18,代码来源:llfloaterbuy.cpp
示例6: LLFloater
//
// Member Functions
//
LLFloaterChat::LLFloaterChat(const LLSD& seed)
: LLFloater(std::string("chat floater"), std::string("FloaterChatRect"), LLStringUtil::null,
RESIZE_YES, 440, 100, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES),
mPanel(NULL)
{
mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL);
mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL);
// do not automatically open singleton floaters (as result of getInstance())
BOOL no_open = FALSE;
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml",&getFactoryMap(),no_open);
childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes
childSetVisible("Chat History Editor with mute",FALSE);
childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this);
setDefaultBtn("Chat");
//toggleHistoryChannelControl(); temporarily disable until working
}
开发者ID:PhoenixDesmoulins,项目名称:imprudence,代码行数:21,代码来源:llfloaterchat.cpp
示例7: childGetListInterface
void LLFloaterWorldMap::onCommitSearchResult()
{
LLCtrlListInterface *list = childGetListInterface("search_results");
if (!list) return;
LLSD selected_value = list->getSelectedValue();
std::string sim_name = selected_value.asString();
if (sim_name.empty())
{
return;
}
LLStringUtil::toLower(sim_name);
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
{
LLSimInfo* info = it->second;
if (info->isName(sim_name))
{
LLVector3d pos_global = info->getGlobalOrigin();
const F64 SIM_COORD_DEFAULT = 128.0;
LLVector3 pos_local(SIM_COORD_DEFAULT, SIM_COORD_DEFAULT, 0.0f);
// Did this value come from a trackURL() request?
if (!mCompletingRegionPos.isExactlyZero())
{
pos_local = mCompletingRegionPos;
mCompletingRegionPos.clear();
}
pos_global.mdV[VX] += (F64)pos_local.mV[VX];
pos_global.mdV[VY] += (F64)pos_local.mV[VY];
pos_global.mdV[VZ] = (F64)pos_local.mV[VZ];
childSetValue("location", sim_name);
trackLocation(pos_global);
setDefaultBtn("Teleport");
break;
}
}
onShowTargetBtn();
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:44,代码来源:llfloaterworldmap.cpp
示例8: childSetValue
BOOL LLPanelDirLand::postBuild()
{
LLPanelDirBrowser::postBuild();
childSetValue("type", gSavedSettings.getString("FindLandType"));
bool adult_enabled = gAgent.canAccessAdult();
bool mature_enabled = gAgent.canAccessMature();
childSetVisible("incpg", true);
if (!mature_enabled)
{
childSetValue("incmature", FALSE);
childDisable("incmature");
}
if (!adult_enabled)
{
childSetValue("incadult", FALSE);
childDisable("incadult");
}
childSetCommitCallback("pricecheck", onCommitPrice, this);
childSetCommitCallback("areacheck", onCommitArea, this);
childSetValue("priceedit", gStatusBar->getBalance());
childSetEnabled("priceedit", gSavedSettings.getBOOL("FindLandPrice"));
childSetPrevalidate("priceedit", LLLineEditor::prevalidateNonNegativeS32);
childSetEnabled("areaedit", gSavedSettings.getBOOL("FindLandArea"));
childSetPrevalidate("areaedit", LLLineEditor::prevalidateNonNegativeS32);
childSetAction("Search", onClickSearchCore, this);
setDefaultBtn("Search");
mCurrentSortColumn = "per_meter";
LLScrollListCtrl* results = getChild<LLScrollListCtrl>("results");
if (results)
{
results->setSortChangedCallback(onClickSort);
results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending);
}
return TRUE;
}
开发者ID:Boy,项目名称:rainbow,代码行数:44,代码来源:llpaneldirland.cpp
示例9: llformat
//virtual
BOOL LLFloaterPriceForListing::postBuild()
{
LLLineEditor* edit = getChild<LLLineEditor>("price_edit");
if (edit)
{
edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32);
std::string min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING);
edit->setText(min_price);
edit->selectAll();
edit->setFocus(TRUE);
}
childSetAction("set_price_btn", onClickSetPrice, this);
childSetAction("cancel_btn", onClickCancel, this);
setDefaultBtn("set_price_btn");
return TRUE;
}
开发者ID:Logear,项目名称:PartyHatViewer,代码行数:20,代码来源:llpanelclassified.cpp
示例10: childSetCommitCallback
BOOL LLPanelGroups::postBuild()
{
childSetCommitCallback("group list", onGroupList, this);
LLSearchEditor* group_search = getChild<LLSearchEditor>("group_search");
if (group_search)
{
group_search->setSearchCallback(&onGroupSearchKeystroke, this);
}
childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count()));
childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS));
const std::string none_text = getString("none");
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text, false);
childSetAction("Activate", onBtnActivate, this);
childSetAction("Info", onBtnInfo, this);
childSetAction("IM", onBtnIM, this);
childSetAction("Leave", onBtnLeave, this);
childSetAction("Create", onBtnCreate, this);
childSetAction("Search...", onBtnSearch, this);
childSetAction("Invite...", onBtnInvite, this);
childSetAction("Titles...", onBtnTitles, this);
setDefaultBtn("IM");
childSetDoubleClickCallback("group list", onBtnIM);
childSetUserData("group list", this);
reset();
return TRUE;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:41,代码来源:llfloatergroups.cpp
示例11: setDefaultBtn
BOOL LLFloaterHtmlFind::postBuild()
{
mCloseButton = LLUICtrlFactory::getButtonByName(this, "close_btn" );
if ( mCloseButton )
{
mCloseButton->setClickedCallback( onClickClose );
mCloseButton->setCallbackUserData( this );
setDefaultBtn( mCloseButton );
};
mWebBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "html_find_browser" );
// // observe browser events
mWebBrowser->addObserver( this );
// browser built so navigate to the right page
LLString homePageUrl( "http://user.lindenlab.com/~callum/search.php" );
mWebBrowser->navigateTo( homePageUrl );
return TRUE;
}
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:21,代码来源:llfloaterhtmlfind.cpp
示例12: childSetAction
BOOL LLChatBar::postBuild()
{
childSetAction("History", toggleChatHistory, this);
childSetCommitCallback("Say", onClickSay, this);
// attempt to bind to an existing combo box named gesture
setGestureCombo(getChild<LLComboBox>( "Gesture"));
LLButton * sayp = getChild<LLButton>("Say");
if(sayp)
{
setDefaultBtn(sayp);
}
mInputEditor = getChild<LLLineEditor>("Chat Editor");
if (mInputEditor)
{
mInputEditor->setCallbackUserData(this);
mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke);
mInputEditor->setFocusLostCallback(&onInputEditorFocusLost, this);
mInputEditor->setFocusReceivedCallback( &onInputEditorGainFocus, this );
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setRevertOnEsc( FALSE );
mInputEditor->setIgnoreTab(TRUE);
mInputEditor->setPassDelete(TRUE);
mInputEditor->setReplaceNewlinesWithSpaces(FALSE);
mInputEditor->setMaxTextLength(DB_CHAT_MSG_STR_LEN);
mInputEditor->setEnableLineHistory(TRUE);
}
mChannelControl = getChild<LLSpinCtrl>("channel_control");
toggleChannelControl();
mIsBuilt = TRUE;
return TRUE;
}
开发者ID:kow,项目名称:pleiaviewer,代码行数:39,代码来源:llchatbar.cpp
示例13: log
BOOL LLFloaterWorldMap::postBuild()
{
mPanel = getChild<LLPanel>("objects_mapview");
LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo");
if (avatar_combo)
{
avatar_combo->selectFirstItem();
avatar_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onAvatarComboPrearrange, this) );
avatar_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) );
}
getChild<LLScrollListCtrl>("location")->setFocusChangedCallback(boost::bind(&LLFloaterWorldMap::onLocationFocusChanged, this, _1));
LLLineEditor *location_editor = getChild<LLLineEditor>("location");
if (location_editor)
{
location_editor->setKeystrokeCallback( boost::bind(&LLFloaterWorldMap::onSearchTextEntry, this, _1), NULL );
}
getChild<LLScrollListCtrl>("search_results")->setDoubleClickCallback( boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this));
LLComboBox *landmark_combo = getChild<LLComboBox>( "landmark combo");
if (landmark_combo)
{
landmark_combo->selectFirstItem();
landmark_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onLandmarkComboPrearrange, this) );
landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) );
}
mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f);
childSetValue("zoom slider", LLWorldMapView::sMapScale);
setDefaultBtn(NULL);
mZoomTimer.stop();
return TRUE;
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:39,代码来源:llfloaterworldmap.cpp
示例14: childSetAction
BOOL LLFloaterURLEntry::postBuild()
{
mMediaURLEdit = getChild<LLComboBox>("media_entry");
// Cancel button
childSetAction("cancel_btn", onBtnCancel, this);
// Cancel button
childSetAction("clear_btn", onBtnClear, this);
// clear media list button
LLSD parcel_history = LLURLHistory::getURLHistory("parcel");
bool enable_clear_button = parcel_history.size() > 0 ? true : false;
childSetEnabled( "clear_btn", enable_clear_button );
// OK button
childSetAction("ok_btn", onBtnOK, this);
setDefaultBtn("ok_btn");
buildURLHistory();
return TRUE;
}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:22,代码来源:llfloaterurlentry.cpp
示例15: childSetCommitCallback
// virtual
BOOL LLPanelFriends::postBuild()
{
mFriendsList = getChild<LLScrollListCtrl>("friend_list");
mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT);
mFriendsList->setMaximumSelectCallback(onMaximumSelect);
mFriendsList->setCommitOnSelectionChange(TRUE);
childSetCommitCallback("friend_list", onSelectName, this);
childSetDoubleClickCallback("friend_list", onClickIM);
LLSearchEditor* buddy_search = getChild<LLSearchEditor>("buddy_search");
if (buddy_search)
{
buddy_search->setSearchCallback(&onContactSearchKeystroke, this);
}
U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE;
refreshNames(changed_mask, "");
childSetAction("im_btn", onClickIM, this);
childSetAction("profile_btn", onClickProfile, this);
childSetAction("offer_teleport_btn", onClickOfferTeleport, this);
childSetAction("pay_btn", onClickPay, this);
childSetAction("add_btn", onClickAddFriend, this);
childSetAction("remove_btn", onClickRemove, this);
setDefaultBtn("im_btn");
updateFriends(LLFriendObserver::ADD);
refreshUI();
// primary sort = online status, secondary sort = name
mFriendsList->sortByColumn(std::string("friend_name"), TRUE);
mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE);
return TRUE;
}
开发者ID:kow,项目名称:imprudence,代码行数:37,代码来源:llfloaterfriends.cpp
示例16: childSetValue
BOOL LLPanelDirLand::postBuild()
{
LLPanelDirBrowser::postBuild();
childSetValue("type", gSavedSettings.getString("FindLandType"));
if (gAgent.mAccess <= SIM_ACCESS_PG)
{
childSetValue("rating", PG_ONLY);
childDisable("rating");
}
childSetCommitCallback("pricecheck", onCommitPrice, this);
childSetCommitCallback("areacheck", onCommitArea, this);
childSetValue("priceedit", gStatusBar->getBalance());
childSetEnabled("priceedit", gSavedSettings.getBOOL("FindLandPrice"));
childSetPrevalidate("priceedit", LLLineEditor::prevalidateNonNegativeS32);
childSetEnabled("areaedit", gSavedSettings.getBOOL("FindLandArea"));
childSetPrevalidate("areaedit", LLLineEditor::prevalidateNonNegativeS32);
childSetAction("Search", onClickSearchCore, this);
setDefaultBtn("Search");
mCurrentSortColumn = "per_meter";
LLScrollListCtrl* results = (LLScrollListCtrl*)getChildByName("results");
if (results)
{
results->setSortChangedCallback(onClickSort);
results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending);
}
return TRUE;
}
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:36,代码来源:llpaneldirland.cpp
示例17: LLGiveMoneyInfo
BOOL LLFloaterPay::postBuild()
{
S32 i = 0;
LLGiveMoneyInfo* info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_0);
mCallbackData.push_back(info);
childSetAction("fastpay 1",&LLFloaterPay::onGive,info);
childSetVisible("fastpay 1", FALSE);
mQuickPayButton[i] = getChild<LLButton>("fastpay 1");
mQuickPayInfo[i] = info;
++i;
info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_1);
mCallbackData.push_back(info);
childSetAction("fastpay 5",&LLFloaterPay::onGive,info);
childSetVisible("fastpay 5", FALSE);
mQuickPayButton[i] = getChild<LLButton>("fastpay 5");
mQuickPayInfo[i] = info;
++i;
info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_2);
mCallbackData.push_back(info);
childSetAction("fastpay 10",&LLFloaterPay::onGive,info);
childSetVisible("fastpay 10", FALSE);
mQuickPayButton[i] = getChild<LLButton>("fastpay 10");
mQuickPayInfo[i] = info;
++i;
info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_3);
mCallbackData.push_back(info);
childSetAction("fastpay 20",&LLFloaterPay::onGive,info);
childSetVisible("fastpay 20", FALSE);
mQuickPayButton[i] = getChild<LLButton>("fastpay 20");
mQuickPayInfo[i] = info;
++i;
childSetVisible("amount text", FALSE);
std::string last_amount;
if(sLastAmount > 0)
{
last_amount = llformat("%d", sLastAmount);
}
childSetVisible("amount", FALSE);
getChild<LLLineEditor>("amount")->setKeystrokeCallback(&LLFloaterPay::onKeystroke, this);
childSetText("amount", last_amount);
childSetPrevalidate("amount", LLTextValidate::validateNonNegativeS32);
info = new LLGiveMoneyInfo(this, 0);
mCallbackData.push_back(info);
childSetAction("pay btn",&LLFloaterPay::onGive,info);
setDefaultBtn("pay btn");
childSetVisible("pay btn", FALSE);
childSetEnabled("pay btn", (sLastAmount > 0));
childSetAction("cancel btn",&LLFloaterPay::onCancel,this);
return TRUE;
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:71,代码来源:llfloaterpay.cpp
示例18: LLPanel
//.........这里部分代码省略.........
if (mHasInventory)
{
addChild(new NoticeText(std::string("subjecttitle"),LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT),std::string("Attached: "),LLFontGL::sSansSerif));
LLUIImagePtr item_icon = get_item_icon(mInventoryOffer->mType,
LLInventoryType::IT_TEXTURE,
0, FALSE);
x += LABEL_WIDTH + HPAD;
std::stringstream ss;
ss << " " << inventory_name;
LLTextBox *line = new LLTextBox(std::string("object_name"),LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),ss.str(),LLFontGL::sSansSerif);
line->setEnabled(FALSE);
line->setBorderVisible(TRUE);
line->setDisabledColor(LLColor4::blue4);
line->setFontStyle(LLFontGL::NORMAL);
line->setBackgroundVisible(true);
line->setBackgroundColor( semi_transparent );
addChild(line);
icon = new LLIconCtrl(std::string("icon"),
LLRect(x, y, x+16, y-16),
item_icon->getName());
icon->setMouseOpaque(FALSE);
addChild(icon);
}
LLButton* btn;
btn = new LLButton(std::string("next"),
LLRect(getRect().getWidth()-26, BOTTOM_PAD + 20, getRect().getWidth()-2, BOTTOM_PAD),
std::string("notify_next.png"),
std::string("notify_next.png"),
LLStringUtil::null,
onClickNext,
this,
LLFontGL::sSansSerif);
btn->setToolTip(std::string("Next")); // *TODO: Translate
btn->setScaleImage(TRUE);
addChild(btn);
mNextBtn = btn;
S32 btn_width = 80;
S32 wide_btn_width = 120;
LLRect btn_rect;
x = 3 * HPAD;
btn_rect.setOriginAndSize(x,
BOTTOM_PAD,
btn_width,
BTN_HEIGHT);
btn = new LLButton(std::string("OK"), btn_rect, LLStringUtil::null, onClickOk, this);
addChild(btn, -1);
setDefaultBtn(btn);
x += btn_width + HPAD;
btn_rect.setOriginAndSize(x,
BOTTOM_PAD,
wide_btn_width,
BTN_HEIGHT);
btn = new LLButton(std::string("Group Notices"), btn_rect, LLStringUtil::null, onClickGroupInfo, this);
btn->setToolTip(std::string("View past notices or opt-out of receiving these messages here.")); // TODO: Translate
addChild(btn, -1);
if (mHasInventory && mInventoryOffer)
{
x += wide_btn_width + HPAD;
btn_rect.setOriginAndSize(x,
BOTTOM_PAD,
wide_btn_width,
BTN_HEIGHT);
std::string btn_lbl("");
if(is_openable(mInventoryOffer->mType))
{
btn_lbl = "Open Attachment";
}
else
{
btn_lbl = "Save Attachment";
}
mSaveInventoryBtn = new LLButton(btn_lbl, btn_rect, LLStringUtil::null, onClickSaveInventory, this);
mSaveInventoryBtn->setVisible(mHasInventory);
addChild(mSaveInventoryBtn);
}
sGroupNotifyBoxCount++;
// If this is the only notify box, don't show the next button
if (sGroupNotifyBoxCount == 1)
{
mNextBtn->setVisible(FALSE);
}
}
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:101,代码来源:llgroupnotify.cpp
示例19: childSetAction
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::postBuild()
{
LLKeyframeMotion* motionp = NULL;
LLBVHLoader* loaderp = NULL;
if (!LLFloaterNameDesc::postBuild())
{
return FALSE;
}
getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitName, this));
childSetAction("ok_btn", onBtnOK, this);
setDefaultBtn();
mPreviewRect.set(PREVIEW_HPAD,
PREVIEW_TEXTURE_HEIGHT,
getRect().getWidth() - PREVIEW_HPAD,
PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);
mPlayButton = getChild<LLButton>( "play_btn");
mPlayButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPlay, this));
mPlayButton->setVisible(true);
mPauseButton = getChild<LLButton>( "pause_btn");
mPauseButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPause, this));
mPauseButton->setVisible(false);
mStopButton = getChild<LLButton>( "stop_btn");
mStopButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnStop, this));
getChildView("bad_animation_text")->setVisible(FALSE);
std::string exten = gDirUtilp->getExtension(mFilename);
if (exten == "bvh")
{
// loading a bvh file
// now load bvh file
S32 file_size;
LLAPRFile infile ;
infile.open(mFilenameAndPath, LL_APR_RB, NULL, &file_size);
if (!infile.getFileHandle())
{
llwarns << "Can't open BVH file:" << mFilename << llendl;
}
else
{
char* file_buffer;
file_buffer = new char[file_size + 1];
if (file_size == infile.read(file_buffer, file_size))
{
file_buffer[file_size] = '\0';
llinfos << "Loading BVH file " << mFilename << llendl;
ELoadStatus load_status = E_ST_OK;
S32 line_number = 0;
loaderp = new LLBVHLoader(file_buffer, load_status, line_number);
std::string status = getString(STATUS[load_status]);
if(load_status == E_ST_NO_XLT_FILE)
{
llwarns << "NOTE: No translation table found." << llendl;
}
else
{
llwarns << "ERROR: [line: " << line_number << "] " << status << llendl;
}
}
infile.close() ;
delete[] file_buffer;
}
}
if (loaderp && loaderp->isInitialized() && loaderp->getDuration() <= MAX_ANIM_DURATION)
{
// generate unique id for this motion
mTransactionID.generate();
mMotionID = mTransactionID.makeAssetID(gAgent.getSecureSessionID());
mAnimPreview = new LLPreviewAnimation(256, 256);
// motion will be returned, but it will be in a load-pending state, as this is a new motion
// this motion will not request an asset transfer until next update, so we have a chance to
// load the keyframe data locally
motionp = (LLKeyframeMotion*)mAnimPreview->getDummyAvatar()->createMotion(mMotionID);
// create data buffer for keyframe initialization
S32 buffer_size = loaderp->getOutputSize();
U8* buffer = new U8[buffer_size];
LLDataPackerBinaryBuffer dp(buffer, buffer_size);
//.........这里部分代码省略.........
开发者ID:jacek,项目名称:viewer-development,代码行数:101,代码来源:llfloateranimpreview.cpp
示例20: void
//.........这里部分代码省略.........
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
channel_text->setTextArg("[VERSION]", version);
channel_text->setClickedCallback(onClickVersion);
channel_text->setCallbackUserData(this);
LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
forgot_password_text->setClickedCallback(onClickForgotPassword);
LLTextBox* create_new_account_text = getChild<LLTextBox>("create_new_account_text");
create_new_account_text->setClickedCallback(onClickNewAccount);
#endif
// get the web browser control
LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("login_html");
// Need to handle login secondlife:///app/ URLs
web_browser->setTrusted( true );
// observe browser events
web_browser->addObserver( this );
// don't make it a tab stop until SL-27594 is fixed
web_browser->setTabStop(FALSE);
web_browser->navigateToLocalPage( "loading", "loading.html" );
// make links open in external browser
web_browser->setOpenInExternalBrowser( true );
// force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through)
LLRect htmlRect = getRect();
#if USE_VIEWER_AUTH
htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight());
#else
htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 );
#endif
web_browser->setRect( htmlRect );
web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE );
reshape( getRect().getWidth(), getRect().getHeight(), 1 );
// kick off a request to grab the url manually
gResponsePtr = LLIamHereLogin::build( this );
std::string login_page = gSavedSettings.getString("LoginPage");
if (login_page.empty())
{
login_page = getString( "real_url" );
}
LLHTTPClient::head( login_page, gResponsePtr );
#if !USE_VIEWER_AUTH
// Initialize visibility (and don't force visibility - use prefs)
refreshLocation( false );
#endif
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:101,代码来源:llpanellogin.cpp
注:本文中的setDefaultBtn函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论