Ejemplo n.º 1
0
void Splitter::MouseDown(int x, int y, MouseButton theButton)
{
	Container::MouseDown(x,y,theButton);
	if(theButton!=MouseButton_Left || mMouseChild==NULL)
		return;

	mLeftRightDrag = mUpDownDrag = false;
	mDragX = x - mMouseChild->Left();
	mDragY = y - mMouseChild->Top();

	Component *aGrandChild = mMouseChild->GetMouseChild();
	if(aGrandChild==NULL)
	{
		if(!mMouseChild->ComponentFlagSet(ComponentFlag_ParentDrag))
			return;
	}
	else if(!aGrandChild->ComponentFlagSet(ComponentFlag_ParentDrag))
		return;

	SplitterList::iterator anItr = mSplitterList.begin();
	while(anItr!=mSplitterList.end())
	{
		SplitterParam &aParam = *anItr;
		if(aParam.mComponent==mMouseChild)
		{
			if(aParam.mType & Splitter_UpDown)
				mUpDownDrag = true;

			if(aParam.mType & Splitter_LeftRight)
				mLeftRightDrag = true;

			break;
		}

		++anItr;
	}
}