Пример #1
0
LLResizeBar::LLResizeBar( const std::string& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side )
	:
	LLView( name, rect, TRUE ),
	mDragLastScreenX( 0 ),
	mDragLastScreenY( 0 ),
	mLastMouseScreenX( 0 ),
	mLastMouseScreenY( 0 ),
	mMinSize( min_size ),
	mMaxSize( max_size ),
	mSide( side ),
	mSnappingEnabled(TRUE),
	mAllowDoubleClickSnapping(TRUE),
	mResizingView(resizing_view),
	mDragCallback(NULL)
{
	// set up some generically good follow code.
	switch( side )
	{
	case LEFT:
		setFollowsLeft();
		setFollowsTop();
		setFollowsBottom();
		break;
	case TOP:
		setFollowsTop();
		setFollowsLeft();
		setFollowsRight();
		break;
	case RIGHT:
		setFollowsRight();
		setFollowsTop();
		setFollowsBottom();
		break;
	case BOTTOM:
		setFollowsBottom();
		setFollowsLeft();
		setFollowsRight();
		break;
	default:
		break;
	}
	// this is just a decorator
	setSaveToXML(FALSE);
}
Пример #2
0
LLResizeBar::LLResizeBar(const LLResizeBar::Params& p)
:	LLView(p),
	mDragLastScreenX( 0 ),
	mDragLastScreenY( 0 ),
	mLastMouseScreenX( 0 ),
	mLastMouseScreenY( 0 ),
	mMinSize( p.min_size ),
	mMaxSize( p.max_size ),
	mSide( p.side ),
	mSnappingEnabled(p.snapping_enabled),
	mAllowDoubleClickSnapping(p.allow_double_click_snapping),
	mResizingView(p.resizing_view)
{
	setFollowsNone();
	// set up some generically good follow code.
	switch( mSide )
	{
	case LEFT:
		setFollowsLeft();
		setFollowsTop();
		setFollowsBottom();
		break;
	case TOP:
		setFollowsTop();
		setFollowsLeft();
		setFollowsRight();
		break;
	case RIGHT:
		setFollowsRight();
		setFollowsTop();
		setFollowsBottom();
		break;
	case BOTTOM:
		setFollowsBottom();
		setFollowsLeft();
		setFollowsRight();
		break;
	default:
		break;
	}
}