本文整理汇总了C++中lluictrl::commitcallbackregistry::ScopedRegistrar类的典型用法代码示例。如果您正苦于以下问题:C++ ScopedRegistrar类的具体用法?C++ ScopedRegistrar怎么用?C++ ScopedRegistrar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ScopedRegistrar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mDirty
LLGroupList::LLGroupList(const Params& p)
: LLFlatListViewEx(p)
, mDirty(true) // to force initial update
{
// Listen for agent group changes.
gAgent.addListener(this, "new group");
mShowIcons = gSavedSettings.getBOOL("GroupListShowIcons");
setCommitOnSelectionChange(true);
// Set default sort order.
setComparator(&GROUP_COMPARATOR);
// Set up context menu.
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add("People.Groups.Action", boost::bind(&LLGroupList::onContextMenuItemClick, this, _2));
enable_registrar.add("People.Groups.Enable", boost::bind(&LLGroupList::onContextMenuItemEnable, this, _2));
LLMenuGL* context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_people_groups.xml",
gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if(context_menu)
mContextMenuHandle = context_menu->getHandle();
}
示例2:
LLOutfitListGearMenu(LLOutfitsList* olist)
: mOutfitList(olist),
mMenu(NULL)
{
llassert_always(mOutfitList);
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this));
registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this));
registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this));
registrar.add("Gear.Delete", boost::bind(&LLOutfitsList::removeSelected, mOutfitList));
registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2));
registrar.add("Gear.Collapse", boost::bind(&LLOutfitsList::collapse_all_folders, mOutfitList));
registrar.add("Gear.Expand", boost::bind(&LLOutfitsList::expand_all_folders, mOutfitList));
registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this));
//-TT Patch: ReplaceWornItemsOnly
registrar.add("Gear.WearReplaceItems",boost::bind(&LLOutfitListGearMenu::onReplaceItems, this));
//-TT
enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenu::onEnable, this, _2));
enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2));
mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
"menu_outfit_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
llassert(mMenu);
}
示例3: postBuild
BOOL FSFloaterNearbyChat::postBuild()
{
setIsSingleInstance(TRUE);
//menu
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
enable_registrar.add("NearbyChat.Check", boost::bind(&FSFloaterNearbyChat::onNearbyChatCheckContextMenuItem, this, _2));
registrar.add("NearbyChat.Action", boost::bind(&FSFloaterNearbyChat::onNearbyChatContextMenuItemClicked, this, _2));
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_nearby_chat.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if(menu)
mPopupMenuHandle = menu->getHandle();
gSavedSettings.declareS32("nearbychat_showicons_and_names",2,"NearByChat header settings");
mInputEditor = getChild<LLChatEntry>("chat_box");
if (mInputEditor)
{
mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2, _3, _4, _5));
mInputEditor->setCommitCallback(boost::bind(&FSFloaterNearbyChat::onChatBoxCommit, this));
mInputEditor->setKeystrokeCallback(boost::bind(&FSFloaterNearbyChat::onChatBoxKeystroke, this));
mInputEditor->setFocusLostCallback(boost::bind(&FSFloaterNearbyChat::onChatBoxFocusLost, this));
mInputEditor->setFocusReceivedCallback(boost::bind(&FSFloaterNearbyChat::onChatBoxFocusReceived, this));
mInputEditor->setTextExpandedCallback(boost::bind(&FSFloaterNearbyChat::reshapeChatLayoutPanel, this));
mInputEditor->setPassDelete(TRUE);
mInputEditor->setFont(LLViewerChat::getChatFont());
mInputEditor->setLabel(getString("chatbox_label"));
mInputEditor->enableSingleLineMode(gSavedSettings.getBOOL("FSUseSingleLineChatEntry"));
}
mChatLayoutPanel = getChild<LLLayoutPanel>("chat_layout_panel");
mInputPanels = getChild<LLLayoutStack>("input_panels");
mChatLayoutPanelHeight = mChatLayoutPanel->getRect().getHeight();
mInputEditorPad = mChatLayoutPanelHeight - mInputEditor->getRect().getHeight();
enableTranslationButton(LLTranslate::isTranslationConfigured());
childSetCommitCallback("chat_history_btn",onHistoryButtonClicked,this);
// chat type selector and send chat button
mChatTypeCombo=getChild<LLComboBox>("chat_type");
mChatTypeCombo->selectByValue("say");
mChatTypeCombo->setCommitCallback(boost::bind(&FSFloaterNearbyChat::onChatTypeChanged,this));
mSendChatButton=getChild<LLButton>("send_chat");
mSendChatButton->setCommitCallback(boost::bind(&FSFloaterNearbyChat::onChatBoxCommit,this));
onChatTypeChanged();
mChatHistory = getChild<FSChatHistory>("chat_history");
// <FS:Ansariel> Optional muted chat history
mChatHistoryMuted = getChild<FSChatHistory>("chat_history_muted");
FSUseNearbyChatConsole = gSavedSettings.getBOOL("FSUseNearbyChatConsole");
gSavedSettings.getControl("FSUseNearbyChatConsole")->getSignal()->connect(boost::bind(&FSFloaterNearbyChat::updateFSUseNearbyChatConsole, this, _2));
return LLFloater::postBuild();
}
示例4: postBuild
BOOL LLNetMap::postBuild()
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Minimap.Zoom", boost::bind(&LLNetMap::handleZoom, this, _2));
registrar.add("Minimap.Tracker", boost::bind(&LLNetMap::handleStopTracking, this, _2));
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_mini_map.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
return TRUE;
}
示例5: createMenu
LLContextMenu* FSAreaSearchMenu::createMenu()
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add("AreaSearch.Action", boost::bind(&FSAreaSearchMenu::onContextMenuItemClick, this, _2));
enable_registrar.add("AreaSearch.Enable", boost::bind(&FSAreaSearchMenu::onContextMenuItemEnable, this, _2));
return createFromFile("menu_fs_area_search.xml");
}
示例6: postBuild
BOOL LLMediaCtrl::postBuild ()
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar;
registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this));
mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
"menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
return TRUE;
}
示例7: postBuild
BOOL LLFloaterMap::postBuild()
{
mMap = getChild<LLNetMap>("Net Map");
// <FS:Ansariel> Synchronize tooltips throughout instances
//if (gSavedSettings.getBOOL("DoubleClickTeleport"))
//{
// mMap->setToolTipMsg(getString("AltToolTipMsg"));
//}
//else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap"))
//{
// mMap->setToolTipMsg(getString("ToolTipMsg"));
//}
// </FS:Ansariel> Synchronize tooltips throughout instances
sendChildToBack(mMap);
mTextBoxNorth = getChild<LLTextBox> ("floater_map_north");
mTextBoxEast = getChild<LLTextBox> ("floater_map_east");
mTextBoxWest = getChild<LLTextBox> ("floater_map_west");
mTextBoxSouth = getChild<LLTextBox> ("floater_map_south");
mTextBoxSouthEast = getChild<LLTextBox> ("floater_map_southeast");
mTextBoxNorthEast = getChild<LLTextBox> ("floater_map_northeast");
mTextBoxSouthWest = getChild<LLTextBox> ("floater_map_southwest");
mTextBoxNorthWest = getChild<LLTextBox> ("floater_map_northwest");
// <Firestorm Minimap changes>
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Minimap.Zoom", boost::bind(&LLFloaterMap::handleZoom, this, _2));
registrar.add("Minimap.Tracker", boost::bind(&LLFloaterMap::handleStopTracking, this, _2));
registrar.add("Minimap.Mark", boost::bind(&LLFloaterMap::handleMark, this, _2));
registrar.add("Minimap.ClearMarks", boost::bind(&LLFloaterMap::handleClearMarks, this));
registrar.add("Minimap.Cam", boost::bind(&LLFloaterMap::handleCam, this));
registrar.add("Minimap.ShowProfile", boost::bind(&LLFloaterMap::handleShowProfile, this));
registrar.add("Minimap.StartTracking", boost::bind(&LLFloaterMap::handleStartTracking, this));
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_mini_map.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (mPopupMenu && !LLTracker::isTracking(0))
{
mPopupMenu->setItemEnabled ("Stop Tracking", false);
}
// </Firestorm minimap changes>
stretchMiniMap(getRect().getWidth() - MAP_PADDING_LEFT - MAP_PADDING_RIGHT,
getRect().getHeight() - MAP_PADDING_TOP - MAP_PADDING_BOTTOM);
updateMinorDirections();
// Get the drag handle all the way in back
sendChildToBack(getDragHandle());
setIsChrome(TRUE);
getDragHandle()->setTitleVisible(TRUE);
// keep onscreen
gFloaterView->adjustToFitScreen(this, FALSE);
return TRUE;
}
示例8: createFromFile
/* virtual */ LLContextMenu* createMenu()
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
LLUUID selected_id = mUUIDs.front();
registrar.add("Outfit.WearReplace",
boost::bind(&LLAppearanceMgr::replaceCurrentOutfit, &LLAppearanceMgr::instance(), selected_id));
registrar.add("Outfit.WearAdd",
boost::bind(&LLAppearanceMgr::addCategoryToCurrentOutfit, &LLAppearanceMgr::instance(), selected_id));
//-TT Patch: ReplaceWornItemsOnly
registrar.add("Outfit.WearReplaceItems",
boost::bind(&LLAppearanceMgr::replaceCategoryInCurrentOutfit, &LLAppearanceMgr::instance(), selected_id));
//-TT
registrar.add("Outfit.TakeOff",
boost::bind(&LLAppearanceMgr::takeOffOutfit, &LLAppearanceMgr::instance(), selected_id));
registrar.add("Outfit.Edit", boost::bind(editOutfit));
registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id));
registrar.add("Outfit.Delete", boost::bind(&LLOutfitsList::removeSelected, mOutfitList));
enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitContextMenu::onEnable, this, _2));
enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitContextMenu::onVisible, this, _2));
return createFromFile("menu_outfit_tab.xml");
}
示例9: mPanelWearing
LLWearingGearMenu(LLPanelWearing* panel_wearing)
: mMenu(NULL), mPanelWearing(panel_wearing)
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add("Gear.Edit", boost::bind(&edit_outfit));
registrar.add("Gear.TakeOff", boost::bind(&LLWearingGearMenu::onTakeOff, this));
enable_registrar.add("Gear.OnEnable", boost::bind(&LLPanelWearing::isActionEnabled, mPanelWearing, _2));
mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
"menu_wearing_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
llassert(mMenu);
}
示例10: create
static LLToggleableMenu* create()
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Wearable.Create", boost::bind(onCreate, _2));
LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
"menu_cof_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
llassert(menu);
if (menu)
{
populateCreateWearableSubmenus(menu);
}
return menu;
}
示例11: createFromFile
/* virtual */ LLContextMenu* createMenu()
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
functor_t take_off = boost::bind(&LLAppearanceMgr::removeItemFromAvatar, LLAppearanceMgr::getInstance(), _1);
registrar.add("Wearing.Edit", boost::bind(&edit_outfit));
registrar.add("Wearing.TakeOff", boost::bind(handleMultiple, take_off, mUUIDs));
registrar.add("Wearing.Detach", boost::bind(handleMultiple, take_off, mUUIDs));
LLContextMenu* menu = createFromFile("menu_wearing_tab.xml");
updateMenuItemsVisibility(menu);
return menu;
}
示例12: postBuild
BOOL LLFloaterMap::postBuild()
{
mMap = getChild<LLNetMap>("Net Map");
mMap->setScale(gSavedSettings.getF32("MiniMapScale"));
mMap->setToolTipMsg(getString("ToolTipMsg"));
sendChildToBack(mMap);
mTextBoxNorth = getChild<LLTextBox> ("floater_map_north");
mTextBoxEast = getChild<LLTextBox> ("floater_map_east");
mTextBoxWest = getChild<LLTextBox> ("floater_map_west");
mTextBoxSouth = getChild<LLTextBox> ("floater_map_south");
mTextBoxSouthEast = getChild<LLTextBox> ("floater_map_southeast");
mTextBoxNorthEast = getChild<LLTextBox> ("floater_map_northeast");
mTextBoxSouthWest = getChild<LLTextBox> ("floater_map_southwest");
mTextBoxNorthWest = getChild<LLTextBox> ("floater_map_northwest");
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Minimap.Zoom", boost::bind(&LLFloaterMap::handleZoom, this, _2));
registrar.add("Minimap.Tracker", boost::bind(&LLFloaterMap::handleStopTracking, this, _2));
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_mini_map.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (mPopupMenu && !LLTracker::isTracking(0))
{
mPopupMenu->setItemEnabled ("Stop Tracking", false);
}
stretchMiniMap(getRect().getWidth() - MAP_PADDING_LEFT - MAP_PADDING_RIGHT
,getRect().getHeight() - MAP_PADDING_TOP - MAP_PADDING_BOTTOM);
updateMinorDirections();
// Get the drag handle all the way in back
sendChildToBack(getDragHandle());
setIsChrome(TRUE);
getDragHandle()->setTitleVisible(TRUE);
// keep onscreen
gFloaterView->adjustToFitScreen(this, FALSE);
return TRUE;
}
示例13:
// [SL:KB] - Patch: UI-Notecards | Checked: 2010-09-12 (Catznip-2.1.2d) | Added: Catznip-2.1.2d
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if (!mContextMenu)
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Embedded.Open", boost::bind(&LLEmbeddedItemSegment::onOpen, this));
registrar.add("Embedded.CopyToInv", boost::bind(&LLEmbeddedItemSegment::onCopyToInventory, this));
mContextMenu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_embedded_item.xml",
LLMenuGL::sMenuContainer,
LLMenuHolderGL::child_registry_t::instance());
}
S32 screen_x, screen_y;
mEditor.localPointToScreen(x, y, &screen_x, &screen_y);
mContextMenu->show(screen_x, screen_y);
return TRUE;
}
示例14: postBuild
BOOL postBuild()
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2));
registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2));
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mPopupMenuHandleAvatar = menu->getHandle();
menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mPopupMenuHandleObject = menu->getHandle();
setDoubleClickCallback(boost::bind(&LLChatHistoryHeader::showInspector, this));
setMouseEnterCallback(boost::bind(&LLChatHistoryHeader::showInfoCtrl, this));
setMouseLeaveCallback(boost::bind(&LLChatHistoryHeader::hideInfoCtrl, this));
return LLPanel::postBuild();
}
示例15: enableForAgent
void LLGroupList::enableForAgent(bool show_icons)
{
mForAgent = true;
mShowIcons = mForAgent && gSavedSettings.getBOOL("GroupListShowIcons") && show_icons;
// Listen for agent group changes.
gAgent.addListener(this, "new group");
// Set up context menu.
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add("People.Groups.Action", boost::bind(&LLGroupList::onContextMenuItemClick, this, _2));
enable_registrar.add("People.Groups.Enable", boost::bind(&LLGroupList::onContextMenuItemEnable, this, _2));
LLMenuGL* context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_people_groups.xml",
gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if(context_menu)
mContextMenuHandle = context_menu->getHandle();
}