LLFloaterDirectory::LLFloaterDirectory(const std::string& name) : LLFloater(name, "FloaterFindRect2", ""), mMinimizing(false) { sInstance = this; mFindAllPanel = NULL; mClassifiedPanel = NULL; mEventsPanel = NULL; mPopularPanel = NULL; mLandPanel = NULL; mPanelAvatarp = NULL; mPanelEventp = NULL; mPanelGroupp = NULL; mPanelGroupHolderp = NULL; mPanelPlacep = NULL; mPanelPlaceSmallp = NULL; mPanelClassifiedp = NULL; // Build the floater with our tab panel classes LLCallbackMap::map_t factory_map; factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this); factory_map["classified_panel"] = LLCallbackMap(createClassified, this); factory_map["events_panel"] = LLCallbackMap(createEvents, this); factory_map["popular_panel"] = LLCallbackMap(createPopular, this); factory_map["places_panel"] = LLCallbackMap(createPlaces, this); factory_map["land_sales_panel"] = LLCallbackMap(createLand, this); factory_map["people_panel"] = LLCallbackMap(createPeople, this); factory_map["groups_panel"] = LLCallbackMap(createGroups, this); factory_map["find_all_old_panel"] = LLCallbackMap(createFindAllOld, this); factory_map["classified_details_panel"] = LLCallbackMap(createClassifiedDetail, this); factory_map["event_details_panel"] = LLCallbackMap(createEventDetail, this); factory_map["group_details_panel"] = LLCallbackMap(createGroupDetail, this); factory_map["group_details_panel_holder"] = LLCallbackMap(createGroupDetailHolder, this); factory_map["place_details_panel"] = LLCallbackMap(createPlaceDetail, this); factory_map["place_details_small_panel"] = LLCallbackMap(createPlaceDetailSmall, this); factory_map["Panel Avatar"] = LLCallbackMap(createPanelAvatar, this); gUICtrlFactory->buildFloater(this, "floater_directory.xml", &factory_map); moveResizeHandlesToFront(); if(mPanelAvatarp) { mPanelAvatarp->selectTab(0); } childSetTabChangeCallback("Directory Tabs", "find_all_panel", onTabChangedFindAll, this); childSetTabChangeCallback("Directory Tabs", "classified_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "events_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "popular_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "places_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "land_sales_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "people_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "groups_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "find_all_old_panel", onTabChanged, this); }
LLFloaterDirectory::LLFloaterDirectory(const std::string& name) : LLFloater(name, std::string("FloaterFindRect2"), LLStringUtil::null), mMinimizing(false) { sInstance = this; mFindAllPanel = NULL; mClassifiedPanel = NULL; mEventsPanel = NULL; mLandPanel = NULL; mPanelAvatarp = NULL; mPanelEventp = NULL; mPanelGroupp = NULL; mPanelGroupHolderp = NULL; mPanelPlacep = NULL; mPanelPlaceSmallp = NULL; mPanelClassifiedp = NULL; // Build the floater with our tab panel classes bool secondlife = gHippoGridManager->getConnectedGrid()->isSecondLife(); LLCallbackMap::map_t factory_map; factory_map["classified_panel"] = LLCallbackMap(createClassified, this); factory_map["events_panel"] = LLCallbackMap(createEvents, this); factory_map["places_panel"] = LLCallbackMap(createPlaces, this); factory_map["land_sales_panel"] = LLCallbackMap(createLand, this); factory_map["people_panel"] = LLCallbackMap(createPeople, this); factory_map["groups_panel"] = LLCallbackMap(createGroups, this); factory_map[market_panel] = LLCallbackMap(LLPanelDirMarket::create, this); factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this); factory_map["showcase_panel"] = LLCallbackMap(createShowcase, this); if (secondlife) { factory_map["web_panel"] = LLCallbackMap(createWebPanel, this); } else { factory_map["find_all_old_panel"] = LLCallbackMap(createFindAllOld, this); } factory_map["classified_details_panel"] = LLCallbackMap(createClassifiedDetail, this); factory_map["event_details_panel"] = LLCallbackMap(createEventDetail, this); factory_map["group_details_panel"] = LLCallbackMap(createGroupDetail, this); factory_map["group_details_panel_holder"] = LLCallbackMap(createGroupDetailHolder, this); factory_map["place_details_panel"] = LLCallbackMap(createPlaceDetail, this); factory_map["place_details_small_panel"] = LLCallbackMap(createPlaceDetailSmall, this); factory_map["Panel Avatar"] = LLCallbackMap(createPanelAvatar, this); mCommitCallbackRegistrar.add("Search.WebFloater", boost::bind(&LLFloaterSearch::open, boost::bind(LLFloaterSearch::getInstance))); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory.xml", &factory_map); moveResizeHandlesToFront(); if (mPanelAvatarp) { mPanelAvatarp->selectTab(0); } LLTabContainer* container = getChild<LLTabContainer>("Directory Tabs"); if (secondlife) { container->removeTabPanel(getChild<LLPanel>("find_all_old_panel")); // Not used } else { container->removeTabPanel(getChild<LLPanel>("web_panel")); // Not needed LLPanel* panel(getChild<LLPanel>("find_all_panel")); LLPanel* prev_tab(getChild<LLPanel>("find_all_old_panel")); LFSimFeatureHandler& inst(LFSimFeatureHandler::instance()); set_tab_visible(container, panel, !inst.searchURL().empty(), prev_tab); inst.setSearchURLCallback(boost::bind(set_tab_visible, container, panel, !boost::bind(&std::string::empty, _1), prev_tab)); panel = getChild<LLPanel>("showcase_panel"); prev_tab = getChild<LLPanel>("events_panel"); set_tab_visible(container, panel, !inst.destinationGuideURL().empty(), prev_tab); inst.setDestinationGuideURLCallback(boost::bind(set_tab_visible, container, panel, !boost::bind(&std::string::empty, _1), prev_tab)); LLPanelDirMarket* marketp = static_cast<LLPanelDirMarket*>(container->getPanelByName(market_panel)); container->removeTabPanel(marketp); // Until we get a MarketPlace URL, tab is removed. marketp->handleRegionChange(container); gAgent.addRegionChangedCallback(boost::bind(&LLPanelDirMarket::handleRegionChange, marketp, container)); } container->setCommitCallback(boost::bind(&LLFloaterDirectory::onTabChanged,_2)); }
/** void addFloater(LLFloater* floaterp, BOOL select_added_floater) Adds the LLFloater pointed to by floaterp to this. If floaterp is already hosted by this, then it is re-added to get new titles, etc. If select_added_floater is true, the LLFloater pointed to by floaterp will become the selected tab in this Affects: mTabContainer, floaterp **/ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point) { if (!floaterp) { return; } if (!mTabContainer) { LL_ERRS() << "Tab Container used without having been initialized." << LL_ENDL; return; } if (floaterp->getHost() == this) { // already hosted by me, remove // do this so we get updated title, etc. mFloaterDataMap.erase(floaterp->getHandle()); mTabContainer->removeTabPanel(floaterp); } else if (floaterp->getHost()) { // floaterp is hosted by somebody else and // this is adding it, so remove it from its old host floaterp->getHost()->removeFloater(floaterp); } else if (floaterp->getParent() == gFloaterView) { // rehost preview floater as child panel gFloaterView->removeChild(floaterp); } // store original configuration LLFloaterData floater_data; floater_data.mWidth = floaterp->getRect().getWidth(); floater_data.mHeight = floaterp->getRect().getHeight(); floater_data.mCanMinimize = floaterp->isMinimizeable(); floater_data.mCanResize = floaterp->isResizable(); floater_data.mSaveRect = floaterp->mSaveRect; // remove minimize and close buttons floaterp->setCanMinimize(FALSE); floaterp->setCanResize(FALSE); floaterp->setCanDrag(FALSE); floaterp->mSaveRect = FALSE; floaterp->storeRectControl(); // avoid double rendering of floater background (makes it more opaque) floaterp->setBackgroundVisible(FALSE); if (mAutoResize) { growToFit(floater_data.mWidth, floater_data.mHeight); } //add the panel, add it to proper maps mTabContainer->addTabPanel( LLTabContainer::TabPanelParams() .panel(floaterp) .label(floaterp->getShortTitle()) .insert_at(insertion_point)); mFloaterDataMap[floaterp->getHandle()] = floater_data; updateResizeLimits(); if ( select_added_floater ) { mTabContainer->selectTabPanel(floaterp); } else { // reassert visible tab (hiding new floater if necessary) mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex()); } floaterp->setHost(this); if (isMinimized()) { floaterp->setVisible(FALSE); } // Tabs sometimes overlap resize handle moveResizeHandlesToFront(); }
LLFloaterDirectory::LLFloaterDirectory(const std::string& name) : LLFloater(name, std::string("FloaterFindRect2"), LLStringUtil::null), mMinimizing(false) { sInstance = this; mFindAllPanel = NULL; mClassifiedPanel = NULL; mEventsPanel = NULL; mLandPanel = NULL; mPanelAvatarp = NULL; mPanelEventp = NULL; mPanelGroupp = NULL; mPanelGroupHolderp = NULL; mPanelPlacep = NULL; mPanelPlaceSmallp = NULL; mPanelClassifiedp = NULL; // Build the floater with our tab panel classes bool enableWebSearch = !gHippoGridManager->getConnectedGrid()->getSearchUrl().empty(); bool enableClassicAllSearch = !gHippoGridManager->getConnectedGrid()->isSecondLife(); LLCallbackMap::map_t factory_map; factory_map["classified_panel"] = LLCallbackMap(createClassified, this); factory_map["events_panel"] = LLCallbackMap(createEvents, this); factory_map["places_panel"] = LLCallbackMap(createPlaces, this); factory_map["land_sales_panel"] = LLCallbackMap(createLand, this); factory_map["people_panel"] = LLCallbackMap(createPeople, this); factory_map["groups_panel"] = LLCallbackMap(createGroups, this); if (enableWebSearch) { // web search and showcase only for SecondLife factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this); factory_map["showcase_panel"] = LLCallbackMap(createShowcase, this); } if (enableClassicAllSearch) { factory_map["find_all_old_panel"] = LLCallbackMap(createFindAllOld, this); } factory_map["classified_details_panel"] = LLCallbackMap(createClassifiedDetail, this); factory_map["event_details_panel"] = LLCallbackMap(createEventDetail, this); factory_map["group_details_panel"] = LLCallbackMap(createGroupDetail, this); factory_map["group_details_panel_holder"] = LLCallbackMap(createGroupDetailHolder, this); factory_map["place_details_panel"] = LLCallbackMap(createPlaceDetail, this); factory_map["place_details_small_panel"] = LLCallbackMap(createPlaceDetailSmall, this); factory_map["Panel Avatar"] = LLCallbackMap(createPanelAvatar, this); if (enableWebSearch) { if (enableClassicAllSearch) LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory3.xml", &factory_map); else LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory.xml", &factory_map); } else { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory2.xml", &factory_map); } moveResizeHandlesToFront(); if(mPanelAvatarp) { mPanelAvatarp->selectTab(0); } childSetTabChangeCallback("Directory Tabs", "classified_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "events_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "places_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "land_sales_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "people_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "groups_panel", onTabChanged, this); if (enableWebSearch) { // web search and showcase for SecondLife childSetTabChangeCallback("Directory Tabs", "find_all_panel", onTabChanged, this); childSetTabChangeCallback("Directory Tabs", "showcase_panel", onTabChanged, this); } if(enableClassicAllSearch) { childSetTabChangeCallback("Directory Tabs", "find_all_old_panel", onTabChanged, this); } }