/indra/newview/lltoolselectrect.h
C++ Header | 64 lines | 27 code | 12 blank | 25 comment | 0 complexity | dfc67bfe308ede40572fcac3d1492e2f MD5 | raw file
Possible License(s): LGPL-2.1
1/** 2 * @file lltoolselectrect.h 3 * @brief A tool to select multiple objects with a screen-space rectangle. 4 * 5 * $LicenseInfo:firstyear=2001&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#ifndef LL_LLTOOLSELECTRECT_H 28#define LL_LLTOOLSELECTRECT_H 29 30#include "lltool.h" 31#include "lltoolselect.h" 32 33class LLToolSelectRect 34: public LLToolSelect 35{ 36public: 37 LLToolSelectRect( LLToolComposite* composite ); 38 39 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); 40 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); 41 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 42 virtual void draw(); // draw the select rectangle 43 44 void handlePick(const LLPickInfo& pick); 45 46protected: 47 void handleRectangleSelection(S32 x, S32 y, MASK mask); // true if you selected one 48 BOOL outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y); 49 50protected: 51 S32 mDragStartX; // screen coords, from left 52 S32 mDragStartY; // screen coords, from bottom 53 54 S32 mDragEndX; 55 S32 mDragEndY; 56 57 S32 mDragLastWidth; 58 S32 mDragLastHeight; 59 60 BOOL mMouseOutsideSlop; // has mouse ever gone outside slop region? 61}; 62 63 64#endif