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


C++ commitcallbackregistry::ScopedRegistrar类代码示例

本文整理汇总了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();
}
开发者ID:otwstephanie,项目名称:hpa2oar,代码行数:25,代码来源:llgrouplist.cpp

示例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);
	}
开发者ID:gabeharms,项目名称:firestorm,代码行数:28,代码来源:lloutfitslist.cpp

示例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();
}
开发者ID:gabeharms,项目名称:firestorm,代码行数:58,代码来源:fsfloaternearbychat.cpp

示例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;
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:10,代码来源:llnetmap.cpp

示例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");
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:10,代码来源:fsareasearchmenu.cpp

示例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;
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:11,代码来源:llmediactrl.cpp

示例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;
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:60,代码来源:llfloatermap.cpp

示例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");
	}
开发者ID:gabeharms,项目名称:firestorm,代码行数:25,代码来源:lloutfitslist.cpp

示例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);
	}
开发者ID:Xara,项目名称:kris-clone,代码行数:15,代码来源:llpanelwearing.cpp

示例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;
	}
开发者ID:NickyPerian,项目名称:viewer-development,代码行数:16,代码来源:llpaneloutfitedit.cpp

示例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;
	}
开发者ID:Xara,项目名称:kris-clone,代码行数:16,代码来源:llpanelwearing.cpp

示例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;
}
开发者ID:Katharine,项目名称:kittyviewer,代码行数:43,代码来源:llfloatermap.cpp

示例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;
	}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:20,代码来源:llviewertexteditor.cpp

示例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();
	}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:20,代码来源:llchathistory.cpp

示例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();
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:21,代码来源:llgrouplist.cpp


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