示例#1
0
void Background::MouseLGrabInside(aui_MouseEvent *data)
{
	if (IsDisabled()) return;

	if (GetWhichSeesMouse() && GetWhichSeesMouse() != this) return;
	SetWhichSeesMouse(this);

	Assert(g_tiledMap != NULL);
	if (g_tiledMap == NULL) return;

	data->position.x -= X();
	data->position.y -= Y();

	SavedMouseEvent *ev = new SavedMouseEvent;
	memcpy(&ev->event, data, sizeof(aui_MouseEvent));
	ev->type = SEV_LGRAB;
	s_savedEvents.AddTail(ev);


    m_lbutton_isdown = TRUE;










	data->position.x += X();
	data->position.y += Y();
}
示例#2
0
void Background::MouseLDoubleClickInside(aui_MouseEvent *data)
{
	if (IsDisabled()) return;

	if (GetWhichSeesMouse() && GetWhichSeesMouse() != this) return;
	SetWhichSeesMouse(this);

	Assert(g_tiledMap != NULL);
	if (g_tiledMap == NULL) return;

	data->position.x -= X();
	data->position.y -= Y();

	if (s_savedEvents.GetCount() > 0) {
		SavedMouseEvent *ev = s_savedEvents.GetTail();
		if(ev->type == SEV_LGRAB) {
			ev->type = SEV_LDOUBLE;
			memcpy(&ev->event, data, sizeof(aui_MouseEvent));
		} else {
			ev = new SavedMouseEvent;
			memcpy(&ev->event, data, sizeof(aui_MouseEvent));
			ev->type = SEV_LDOUBLE;
			s_savedEvents.AddTail(ev);
		}
	} else {
		g_tiledMap->Click(data, TRUE);
	}

    m_lbutton_isdown = TRUE;

}
示例#3
0
void Background::MouseLDropInside(aui_MouseEvent *data)
{
	if (IsDisabled()) return;

	if (GetWhichSeesMouse() && GetWhichSeesMouse() != this) return;
	SetWhichSeesMouse(this);

	data->position.x -= X();
	data->position.y -= Y();

	SavedMouseEvent *ev = new SavedMouseEvent;
	memcpy(&ev->event, data, sizeof(aui_MouseEvent));
	ev->type = SEV_LDROP;
	s_savedEvents.AddTail(ev);


    m_lbutton_isdown = FALSE;


	data->position.x += X();
	data->position.y += Y();
}
示例#4
0
void Background::MouseLDragInside( aui_MouseEvent *data )
{
	if ( IsDisabled() ) return;
	if (GetWhichSeesMouse() && GetWhichSeesMouse() != this) return;
	if ( !GetWhichSeesMouse() ) SetWhichSeesMouse( this );

	MapPoint tmp;

	data->position.x -= X();
	data->position.y -= Y();

    if (g_tiledMap && g_tiledMap->GetMouseTilePos(tmp)){
		if (m_current_mouse_tile != tmp) {
			SavedMouseEvent *ev = new SavedMouseEvent;
			memcpy(&ev->event, data, sizeof(aui_MouseEvent));
			ev->type = SEV_LDRAG;
			s_savedEvents.AddTail(ev);


		}
        m_current_mouse_tile = tmp;
    }

    if (data->movecount==0) {
        ProcessLastMouseMoveThisFrame(data);
    }

	if (g_tiledMap != NULL) {
		g_tiledMap->SetHiliteMouseTile(m_current_mouse_tile);
		g_tiledMap->DrawHilite( TRUE );
	}


	data->position.x += X();
	data->position.y += Y();
}
示例#5
0
void keypress_RegisterHandler(KeyboardHandler *handler)
{
	g_keyboardHandlers.AddTail(handler);
}