PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/llmenucommands.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 94 lines | 49 code | 9 blank | 36 comment | 2 complexity | 797071411801deb67d09f4b3c8ba507a MD5 | raw file
 1/** 
 2 * @file llmenucommands.cpp
 3 * @brief Implementations of menu commands.
 4 *
 5 * $LicenseInfo:firstyear=2003&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#include "llviewerprecompiledheaders.h"
28
29#include "llmenucommands.h"
30
31#include "imageids.h"
32#include "llfloaterreg.h"
33#include "llfontgl.h"
34#include "llrect.h"
35#include "llerror.h"
36#include "llstring.h"
37#include "message.h"
38
39#include "llagentcamera.h"
40#include "llcallingcard.h"
41#include "llviewercontrol.h"
42//#include "llfirstuse.h"
43#include "llfloaterworldmap.h"
44#include "lllineeditor.h"
45#include "llstatusbar.h"
46#include "llimview.h"
47#include "lltextbox.h"
48#include "llui.h"
49#include "llviewergesture.h"			// for triggering gestures
50#include "llviewermessage.h"
51#include "llviewerparceloverlay.h"
52#include "llviewerregion.h"
53#include "llviewerstats.h"
54#include "lluictrlfactory.h"
55#include "llviewerwindow.h"
56#include "llworld.h"
57#include "llworldmap.h"
58#include "llfocusmgr.h"
59#include "llnearbychatbar.h"
60
61void handle_mouselook(void*)
62{
63	gAgentCamera.changeCameraToMouselook();
64}
65
66
67void handle_chat(void*)
68{
69	// give focus to chatbar if it's open but not focused
70	if (gSavedSettings.getBOOL("ChatVisible") && 
71		gFocusMgr.childHasKeyboardFocus(LLNearbyChatBar::getInstance()->getChatBox()))
72	{
73		LLNearbyChatBar::stopChat();
74	}
75	else
76	{
77		LLNearbyChatBar::startChat(NULL);
78	}
79}
80
81void handle_slash_key(void*)
82{
83	// LLBottomTray::startChat("/");
84	//
85	// Don't do this, it results in a double-slash in the input field.
86	// Another "/" will be automatically typed for us, because the WM_KEYDOWN event
87	// that generated the menu accelerator call (and hence puts focus in
88	// the chat edtior) will be followed by a "/" WM_CHAR character message,
89	// which will type the slash.  Yes, it's weird.  It only matters for
90	// menu accelerators that put input focus into a field.   And Mac works
91	// the same way.  JC
92
93	LLNearbyChatBar::startChat(NULL);
94}