예제 #1
0
파일: ColorBox.cpp 프로젝트: vidarn/color4d
Bool ColorBox::InputEvent(const BaseContainer &msg)
{
	if(msg.GetInt32(BFM_INPUT_DEVICE) == BFM_INPUT_MOUSE){
		if(msg.GetInt32(BFM_INPUT_CHANNEL) == BFM_INPUT_MOUSELEFT){
			m_mouseX = msg.GetInt32(BFM_INPUT_X);
			m_mouseY = msg.GetInt32(BFM_INPUT_Y);
			m_mouseDown = TRUE;
			Global2Local(&m_mouseX, &m_mouseY);
			MouseDragStart(BFM_INPUT_MOUSELEFT,m_mouseX, m_mouseY,MOUSEDRAGFLAGS_0);
			MouseUpdate();
		}
	}
	Float x, y;
	BaseContainer channels;
	while (MouseDrag(&x, &y, &channels) == MOUSEDRAGRESULT_CONTINUE)
	{
		m_mouseX -= x;
		m_mouseY -= y;
		//Global2Local(&m_mouseX, &m_mouseY);
		MouseUpdate();
	}
	BaseContainer res;
	if(GetInputState(BFM_INPUT_MOUSE,BFM_INPUT_MOUSELEFT,res) && res.GetInt32(BFM_INPUT_VALUE) == 0){
		if(m_mouseDown){
			MouseDragEnd();
			m_mouseDown = FALSE;
		}
	}

	return FALSE;
}
예제 #2
0
파일: glList.cpp 프로젝트: Gepard/spring
void CglList::MouseMove(int x, int y, int dx,int dy, int button)
{
	if (button != SDL_BUTTON_LEFT || !activeMousePress)
		return;

	MouseUpdate(x, y);
}
예제 #3
0
void CInput::OnFrame			(void)
{
	Device.Statistic->Input.Begin			();
	dwCurTime		= Device.TimerAsync_MMT	();
	if (pKeyboard)	KeyUpdate				();
	if (pMouse)		MouseUpdate				();
	Device.Statistic->Input.End				();
}
예제 #4
0
파일: glList.cpp 프로젝트: Gepard/spring
bool CglList::MousePress(int x, int y, int button)
{
	if (button != SDL_BUTTON_LEFT || !IsAbove(x, y))
		return false;

	activeMousePress = true;
	MouseUpdate(x, y); // make sure place is up to date
	return true;
}
예제 #5
0
파일: glList.cpp 프로젝트: Gepard/spring
void CglList::MouseRelease(int x, int y, int button)
{
	if (button != SDL_BUTTON_LEFT || !activeMousePress)
		return;

	activeMousePress = false;
	if (!MouseUpdate(x, y) && cancelPlace >= 0) { // make sure place is up to date
		place = cancelPlace;
	}
	Select(); // watch out, the callback may delete this
}
예제 #6
0
//-------------------------------------------------------
void CInput::iCapture(IInputReceiver *p)
{
	VERIFY(p);
	if (pMouse) 	MouseUpdate();
    if (pKeyboard) 	KeyUpdate();

    // change focus
	if (!cbStack.empty())
		cbStack.back()->IR_OnDeactivate();
	cbStack.push_back(p);
	cbStack.back()->IR_OnActivate();

	// prepare for _new_ controller
	ZeroMemory			( timeStamp,	sizeof(timeStamp) );
	ZeroMemory			( timeSave,		sizeof(timeStamp) );
	ZeroMemory			( offs,			sizeof(offs) );
}
예제 #7
0
파일: List.cpp 프로젝트: AlexDiede/spring
bool List::MousePress(int x, int y, int button)
{
	switch (button)
	{
		case SDL_BUTTON_LEFT:
		{
			activeMousePress = true;
			MouseUpdate(x, y); // make sure place is up to date
			break;
		}
		case SDL_BUTTON_WHEELDOWN:
			ScrollDownOne();
			break;
			
		case SDL_BUTTON_WHEELUP:
			ScrollUpOne();
			break;
	}
	return false;
}
예제 #8
0
파일: MOUSE.C 프로젝트: fabioandrec/fivedos
CLIPPER MUpdate()    { SysRefresh(); MouseUpdate(); }