void LLFloaterGodTools::showPanel(const LLString& panel_name) { childShowTab("GodTools Tabs", panel_name); open(); /*Flawfinder: ignore*/ LLPanel *panel = childGetVisibleTab("GodTools Tabs"); if (panel) panel->setFocus(TRUE); }
// virtual void LLInspectToast::onOpen(const LLSD& notification_id) { LLInspect::onOpen(notification_id); LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id); if (toast == NULL) { llwarns << "Could not get requested toast from screen channel." << llendl; return; } mConnection = toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1)); LLPanel * panel = toast->getPanel(); panel->setVisible(TRUE); panel->setMouseOpaque(FALSE); if(mPanel != NULL && mPanel->getParent() == this) { removeChild(mPanel); } addChild(panel); panel->setFocus(TRUE); mPanel = panel; LLRect panel_rect; panel_rect = panel->getRect(); reshape(panel_rect.getWidth(), panel_rect.getHeight()); LLUI::positionViewNearMouse(this); }
void LLFloaterGodTools::showPanel(const std::string& panel_name) { getChild<LLTabContainer>("GodTools Tabs")->selectTabByName(panel_name); openFloater(); LLPanel *panel = getChild<LLTabContainer>("GodTools Tabs")->getCurrentPanel(); if (panel) panel->setFocus(TRUE); }
// static void LLFloaterGodTools::onTabChanged(void* data, bool from_click) { LLPanel* panel = (LLPanel*)data; if (panel) { panel->setFocus(TRUE); } }
void LLFloaterGodTools::showPanel(const std::string& panel_name) { childShowTab("GodTools Tabs", panel_name); openFloater(); LLPanel *panel = childGetVisibleTab("GodTools Tabs"); if (panel) panel->setFocus(TRUE); }
void LLFloaterDirectory::focusCurrentPanel() { LLTabContainer* tabs = getChild<LLTabContainer>("Directory Tabs"); if (!tabs) return; LLPanel* panel = tabs->getCurrentPanel(); if (!panel) return; panel->setFocus(TRUE); }
void LLFloaterDirectory::focusCurrentPanel() { LLTabContainerCommon* tabs = LLUICtrlFactory::getTabContainerByName(this, "Directory Tabs"); if (!tabs) return; LLPanel* panel = tabs->getCurrentPanel(); if (!panel) return; panel->setFocus(TRUE); }
//----------------------------------------------------------------------------- // rebuild() //----------------------------------------------------------------------------- void LLUICtrlFactory::rebuild() { built_panel_t built_panels = mBuiltPanels; mBuiltPanels.clear(); built_panel_t::iterator built_panel_it; for (built_panel_it = built_panels.begin(); built_panel_it != built_panels.end(); ++built_panel_it) { std::string filename = built_panel_it->second; LLPanel* panelp = built_panel_it->first.get(); if (!panelp) { continue; } llinfos << "Rebuilding UI panel " << panelp->getName() << " from " << filename << llendl; BOOL visible = panelp->getVisible(); panelp->setVisible(FALSE); panelp->setFocus(FALSE); panelp->deleteAllChildren(); buildPanel(panelp, filename.c_str(), &panelp->getFactoryMap()); panelp->setVisible(visible); } built_floater_t::iterator built_floater_it; for (built_floater_it = mBuiltFloaters.begin(); built_floater_it != mBuiltFloaters.end(); ++built_floater_it) { LLFloater* floaterp = built_floater_it->first.get(); if (!floaterp) { continue; } std::string filename = built_floater_it->second; llinfos << "Rebuilding UI floater " << floaterp->getName() << " from " << filename << llendl; BOOL visible = floaterp->getVisible(); floaterp->setVisible(FALSE); floaterp->setFocus(FALSE); floaterp->deleteAllChildren(); gFloaterView->removeChild(floaterp); buildFloater(floaterp, filename, &floaterp->getFactoryMap()); floaterp->setVisible(visible); } }
// static void LLFloaterGodTools::show(void *) { LLFloaterGodTools* god_tools = instance(); god_tools->open(); LLPanel *panel = god_tools->childGetVisibleTab("GodTools Tabs"); if (panel) panel->setFocus(TRUE); if (god_tools->mPanelObjectTools) god_tools->mPanelObjectTools->setTargetAvatar(LLUUID::null); if (gAgent.getRegionHost() != god_tools->mCurrentHost) { // we're in a new region god_tools->sendRegionInfoRequest(); } }
void LLTabContainer::removeTabPanel(LLPanel* child) { if (mIsVertical) { // Fix-up button sizes S32 tab_count = 0; for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { LLTabTuple* tuple = *iter; LLRect rect; rect.setLeftTopAndSize(TABCNTRV_PAD + LLPANEL_BORDER_WIDTH + 2, // JC - Fudge factor (getRect().getHeight() - LLPANEL_BORDER_WIDTH - 1) - ((BTN_HEIGHT + TABCNTRV_PAD) * (tab_count)), mMinTabWidth, BTN_HEIGHT); if (tuple->mPlaceholderText) { tuple->mPlaceholderText->setRect(rect); } else { tuple->mButton->setRect(rect); } tab_count++; } } else { // Adjust the total tab width. for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { LLTabTuple* tuple = *iter; if( tuple->mTabPanel == child ) { mTotalTabWidth -= tuple->mButton->getRect().getWidth(); break; } } } BOOL has_focus = gFocusMgr.childHasKeyboardFocus(this); // If the tab being deleted is the selected one, select a different tab. for(std::vector<LLTabTuple*>::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { LLTabTuple* tuple = *iter; if( tuple->mTabPanel == child ) { removeChild( tuple->mButton ); delete tuple->mButton; removeChild( tuple->mTabPanel ); // delete tuple->mTabPanel; mTabList.erase( iter ); delete tuple; break; } } // make sure we don't have more locked tabs than we have tabs mLockedTabCount = llmin(getTabCount(), mLockedTabCount); if (mCurrentTabIdx >= (S32)mTabList.size()) { mCurrentTabIdx = mTabList.size()-1; } selectTab(mCurrentTabIdx); if (has_focus) { LLPanel* panelp = getPanelByIndex(mCurrentTabIdx); if (panelp) { panelp->setFocus(TRUE); } } updateMaxScrollPos(); }