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(); }
BOOL LLMediaCtrl::postBuild () { LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_media_ctrl.xml",LLMenuGL::sMenuContainer); if(menu) { mContextMenu = menu->getHandle(); } setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2)); return true; }
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(); }
LLNetMap::LLNetMap(const std::string& name) : LLPanel(name), mScale(128.f), mObjectMapTPM(1.f), mObjectMapPixels(255.f), mTargetPanX( 0.f ), mTargetPanY( 0.f ), mCurPanX( 0.f ), mCurPanY( 0.f ), mUpdateNow( FALSE ) { mScale = gSavedSettings.getF32("MiniMapScale"); mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); mObjectImageCenterGlobal = gAgentCamera.getCameraPositionGlobal(); // Register event listeners for popup menu (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel"); (new LLCenterMap())->registerListener(this, "MiniMap.Center"); (new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter"); (new LLRotateMap())->registerListener(this, "MiniMap.Rotate"); (new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate"); (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); (new LLCamFollow())->registerListener(this, "MiniMap.CamFollow"); //moymod - add cam follow crap thingie (new mmsetred())->registerListener(this, "MiniMap.setred"); (new mmsetgreen())->registerListener(this, "MiniMap.setgreen"); (new mmsetblue())->registerListener(this, "MiniMap.setblue"); (new mmsetyellow())->registerListener(this, "MiniMap.setyellow"); (new mmsetcustom())->registerListener(this, "MiniMap.setcustom"); (new mmsetunmark())->registerListener(this, "MiniMap.setunmark"); (new mmenableunmark())->registerListener(this, "MiniMap.enableunmark"); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); updateMinorDirections(); LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_mini_map.xml", this); if (!menu) { menu = new LLMenuGL(LLStringUtil::null); } menu->setVisible(FALSE); mPopupMenuHandle = menu->getHandle(); }
LLNetMap::LLNetMap( const std::string& name, const LLRect& rect, const LLColor4& bg_color ) : LLUICtrl(name, rect, FALSE, NULL, NULL), mBackgroundColor( bg_color ), mObjectMapTPM(1.f), mObjectMapPixels(255.f), mTargetPanX( 0.f ), mTargetPanY( 0.f ), mCurPanX( 0.f ), mCurPanY( 0.f ), mUpdateNow( FALSE ) { mPixelsPerMeter = gMiniMapScale / REGION_WIDTH_METERS; LLNetMap::sRotateMap = gSavedSettings.getBOOL( "MiniMapRotate" ); // Surface texture is dynamically generated/updated. // createObjectImage(); mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal(); // TODO: exteralize hardcoded constants. const S32 DIR_WIDTH = 10; const S32 DIR_HEIGHT = 10; LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); const LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); const LLRect minor_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH * 2, 0 ); // Note: removing special treatment for north compass point (DEV-10559). -MG //mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); //mTextBoxNorth->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); //addChild( mTextBoxNorth ); mTextBoxNorth = new LLTextBox( std::string("N"), major_dir_rect ); mTextBoxNorth->setColor( minor_color ); addChild( mTextBoxNorth ); mTextBoxEast = new LLTextBox( std::string("E"), major_dir_rect ); mTextBoxEast->setColor( minor_color ); addChild( mTextBoxEast ); major_dir_rect.mRight += 1 ; mTextBoxWest = new LLTextBox( std::string("W"), major_dir_rect ); mTextBoxWest->setColor( minor_color ); addChild( mTextBoxWest ); major_dir_rect.mRight -= 1 ; mTextBoxSouth = new LLTextBox( std::string("S"), major_dir_rect ); mTextBoxSouth->setColor( minor_color ); addChild( mTextBoxSouth ); mTextBoxSouthEast = new LLTextBox( std::string("SE"), minor_dir_rect ); mTextBoxSouthEast->setColor( minor_color ); addChild( mTextBoxSouthEast ); mTextBoxNorthEast = new LLTextBox( std::string("NE"), minor_dir_rect ); mTextBoxNorthEast->setColor( minor_color ); addChild( mTextBoxNorthEast ); mTextBoxSouthWest = new LLTextBox( std::string("SW"), minor_dir_rect ); mTextBoxSouthWest->setColor( minor_color ); addChild( mTextBoxSouthWest ); mTextBoxNorthWest = new LLTextBox( std::string("NW"), minor_dir_rect ); mTextBoxNorthWest->setColor( minor_color ); addChild( mTextBoxNorthWest ); // Right-click menu LLMenuGL* menu; menu = new LLMenuGL(std::string("popup")); menu->setCanTearOff(FALSE); menu->append(new LLMenuItemCallGL(std::string("Zoom Close"), handleZoomLevel, NULL, (void*)2) ); menu->append(new LLMenuItemCallGL(std::string("Zoom Medium"), handleZoomLevel, NULL, (void*)1) ); menu->append(new LLMenuItemCallGL(std::string("Zoom Far"), handleZoomLevel, NULL, (void*)0) ); menu->appendSeparator(); menu->append(new LLMenuItemCallGL(std::string("Stop Tracking"), &LLTracker::stopTracking, &LLTracker::isTracking, NULL) ); menu->setVisible(FALSE); addChild(menu); mPopupMenuHandle = menu->getHandle(); sInstance = this; }