Esempio n. 1
0
void OpDragBox::DragPointerMove(DocCoord dcMousePos, ClickModifiers cmods, Spread* pSpread, BOOL bSolidDrag)
{
	// If the mouse has moved to another spread than translate its position into the
	// new spread's coordinate system.
	if (pSpread != m_pStartSpread && pSpread != NULL)
	{
		dcMousePos = MakeRelativeToSpread(m_pStartSpread, pSpread, dcMousePos);
	}

	// Calculate the new drag rectangle.
	DocRect drNewDragBox = CalcDragBox(m_dcStartPos, dcMousePos);
	ERROR3IF(!drNewDragBox.IsValid(), "Invalid drag box in OpDragBox::DragPointerMove");

	// Call the appropriate update function, according to whether we are drawing solid
	// drag boxes or unfilled drag boxes.
	if (m_fDoSolidDragBoxes)
	{
		UpdateSolidDragBox(drNewDragBox);
	}
	else
	{
		UpdateUnfilledDragBox(drNewDragBox);
	}
	
	// Update our record of the last drag box and call the derived class.
	if (!OnPointerMoved(m_pStartSpread, m_drLastDragBox = drNewDragBox, cmods))
	{
		// Cancel the drag and operation.
		EndDrag();
		End();
	}
}
Esempio n. 2
0
//----------------------------------------------------------
//Pinch controll
//----------------------------------------------------------
void TapCamera::BeginPinch( const Vec2& v1, const Vec2& v2 )
{
    if( dragging_ )
        EndDrag();

    if( pinching_ )
        EndPinch();

    BeginDrag( Vec2() );

    vec_pinch_start_center_ = (v1 + v2) / 2.f;

    Vec2 vec = v1 - v2;
    float x_diff;
    float y_diff;
    vec.Value( x_diff, y_diff );

    pinch_start_distance_SQ_ = x_diff * x_diff + y_diff * y_diff;
    camera_rotation_start_ = atan2f( y_diff, x_diff );
    camera_rotation_now_ = 0;

    pinching_ = true;
    momentum_ = false;

    //Init momentum factors
    vec_offset_delta_ = Vec3();
}
Esempio n. 3
0
void OpDragBox::DragFinished(DocCoord dcMousePos, ClickModifiers cmods,
							 Spread* pSpread, BOOL fOK, BOOL bSolidDrag)
{
	// Remove the last drag box.
	RenderDragBlobs(m_drLastDragBox, m_pStartSpread, bSolidDrag);

	// It's possible that the mouse is in a different position to where it was on the last
	// call to DragPointerMove, so recalculate the drag box (but don't draw it, of course).
	// Here, check for a change in the spread containing the mouse.
	if (pSpread != m_pStartSpread && pSpread != NULL)
	{
		dcMousePos = MakeRelativeToSpread(m_pStartSpread, pSpread, dcMousePos);
	}

	// Recalculate the drag box.
	m_drLastDragBox = CalcDragBox(m_dcStartPos, dcMousePos);

	// Call the derived class handler, passing the drag box and the success code.
	if (!OnDragEnded(m_pStartSpread, m_drLastDragBox, cmods, EndDrag() && fOK))
	{
		FailAndExecute();
	}

	// Finally, end the operation.
	End();
}
Esempio n. 4
0
BOOL CDockContext::Track()
/************************/
{
    ASSERT( m_pBar != NULL );
    m_pBar->SetCapture();
    while( CWnd::GetCapture() == m_pBar ) {
        MSG msg;
        if( !::GetMessage( &msg, NULL, 0, 0 ) ) {
            ::PostQuitMessage( msg.wParam );
            ::ReleaseCapture();
            break;
        }
        if( msg.message == WM_MOUSEMOVE ) {
            Move( msg.pt );
        } else if( msg.message == WM_LBUTTONUP ) {
            EndDrag();
            ::ReleaseCapture();
            return( TRUE );
        } else if( msg.message == WM_KEYDOWN ) {
            OnKey( msg.wParam, TRUE );
        } else if( msg.message == WM_KEYUP ) {
            OnKey( msg.wParam, FALSE );
        }
    }
    return( FALSE );
}
/**
 * Mouse event handler
 */
void MouseCallback(int button, int state, int x, int y)
{
    // If in trampoline mode, begin or end drag as appropriate
    if(trampoline) {
      if(button == GLUT_LEFT_BUTTON) {
        if(state == GLUT_DOWN) BeginDrag(x,y);
        else if(dragging && state == GLUT_UP) EndDrag();
        return;
      }
    }
    
    if (button == GLUT_LEFT_BUTTON || button == GLUT_RIGHT_BUTTON)
    {
        gMouseButton = button;
    } else
    {
        gMouseButton = -1;
    }
    
    if (state == GLUT_UP)
    {
        gPreviousMouseX = -1;
        gPreviousMouseY = -1;
    }
}
Esempio n. 6
0
STDMETHODIMP UDropTarget::DragLeave()
{
    LLOG("DragLeave");
    EndDrag();
    FreeData();
    return NOERROR;
}
Esempio n. 7
0
STDMETHODIMP UDropTarget::Drop(LPDATAOBJECT, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
{
    LLOG("Drop");
    if(Ctrl::GetDragAndDropSource())
        Ctrl::OverrideCursor(Null);
    DnD(pt, true, pdwEffect, grfKeyState);
    EndDrag();
    FreeData();
    return NOERROR;
}
TabEditorSplitter::~TabEditorSplitter()
{
    EndDrag(wyFalse);

    if(m_hwnd)
	{	
		DestroyWindow(m_hwnd);
		m_hwnd = NULL;
	}
}
Esempio n. 9
0
/**< destroy image */
bool ImagePanel::ReleaseImg()
{
	// stop drag and mouse func
	EndDrag(false);

	// destroy image
	if (m_img.IsOk())
		m_img.Destroy();
	// update ui
	Refresh(false);

	return true;
}
Esempio n. 10
0
void TapCamera::EndPinch()
{
    pinching_ = false;
    momentum_ = true;
    momemtum_steps_ = 1.f;
    vec_offset_ += vec_offset_now_;
    camera_rotation_ += camera_rotation_now_;
    vec_offset_now_ = Vec3();

    camera_rotation_now_ = 0;

    EndDrag();
}
Esempio n. 11
0
bool
TabDisplay::OnMouseUp(PixelScalar x, PixelScalar y)
{
  if (dragging) {
    EndDrag();

    if (!drag_off_button)
      tab_bar.ClickPage(down_index);

    return true;
  } else {
    return PaintWindow::OnMouseUp(x, y);
  }
}
Esempio n. 12
0
void CMetadataTree::OnRButtonDown(UINT nFlags, CPoint point) 
{
	EndDrag();

	CTreeCtrl *pCtrl=&GetTreeCtrl();
	HTREEITEM CurItem=pCtrl->HitTest(point, 0);
	if(CurItem)
	{
		pCtrl->SetFocus();
		pCtrl->SelectItem(CurItem);
	}
	
	ShowProperty(0);

	//CTreeView::OnRButtonDown(nFlags, point);
}
void TrackballManipulator::OnMouseButtonReleased(const Mouse::Button& pButton)
{
    if(pButton != Mouse::Button_Left || !HasFocus())
        return;

    EndDrag();

    // #TODO: Fix for no command
    /*
    if(mEntityProperties->GetOrientation() != mOldObjectOrientation)
    {
        RotateCommand* rotateCommand = new RotateCommand(mEntityProperties, 
                                                         mOldObjectOrientation);
        mEditor->GetCommandManager().PerformCommand(rotateCommand);
    }*/
}
Esempio n. 14
0
//----------------------------------------------------------
//Drag control
//----------------------------------------------------------
void TapCamera::BeginDrag( const Vec2& v )
{
    if( dragging_ )
        EndDrag();

    if( pinching_ )
        EndPinch();

    Vec2 vec = v * vec_flip_;
    vec_ball_now_ = vec;
    vec_ball_down_ = vec_ball_now_;

    dragging_ = true;
    momentum_ = false;
    vec_last_input_ = vec;
    vec_drag_delta_ = Vec2();
}
Esempio n. 15
0
void OpPush::DragFinished( DocCoord PointerPos, ClickModifiers ClickMods, Spread *, BOOL Success, BOOL bSolidDrag)
{
	// Put up the hourglass as we have to
	BeginSlowJob();

	// End the Drag
	EndDrag();
	
	// If the drag failed, then fail the operation
	if (!Success) FailAndExecute();

	// End the operation
	End();

	// Send a message saying that the screen has changed, so that the brush tool can update
	BROADCAST_TO_ALL(ScreenChangeMsg());

}
Esempio n. 16
0
bool
TabDisplay::OnMouseUp(PixelScalar x, PixelScalar y)
{
    if (dragging) {
        EndDrag();

        int i = GetButtonIndexAt({ x, y });
        if (i == down_index)
            tab_bar.ClickPage(i);

        if (down_index > -1)
            Invalidate();
        down_index = -1;
        return true;
    } else {
        return PaintWindow::OnMouseUp(x, y);
    }
}
Esempio n. 17
0
bool
TabDisplay::OnMouseDown(PixelScalar x, PixelScalar y)
{
    EndDrag();

    // If possible -> Give focus to the Control
    SetFocus();

    int i = GetButtonIndexAt({ x, y });
    if (i >= 0) {
        dragging = true;
        down_index = i;
        SetCapture();
        Invalidate();
        return true;
    }

    return PaintWindow::OnMouseDown(x, y);
}
Esempio n. 18
0
void TapCamera::Update()
{
    if( momentum_ )
    {
        float momenttum_steps = momemtum_steps_;

        //Momentum rotation
        Vec2 v = vec_drag_delta_;
        BeginDrag( Vec2() ); //NOTE:This call reset _VDragDelta
        Drag( v * vec_flip_ );

        //Momentum shift
        vec_offset_ += vec_offset_delta_;

        BallUpdate();
        EndDrag();

        //Decrease deltas
        vec_drag_delta_ = v * MOMENTUM_FACTOR_DECREASE;
        vec_offset_delta_ = vec_offset_delta_ * MOMENTUM_FACTOR_DECREASE_SHIFT;

        //Count steps
        momemtum_steps_ = momenttum_steps * MOMENTUM_FACTOR_DECREASE;
        if( momemtum_steps_ < MOMENTUM_FACTOR_THRESHOLD )
        {
            momentum_ = false;
        }
    }
    else
    {
        vec_drag_delta_ *= MOMENTUM_FACTOR;
        vec_offset_delta_ = vec_offset_delta_ * MOMENTUM_FACTOR;
        BallUpdate();
    }

    Vec3 vec = vec_offset_ + vec_offset_now_;
    Vec3 vec_tmp( TRANSFORM_FACTOR, -TRANSFORM_FACTOR, TRANSFORM_FACTORZ );

    vec *= vec_tmp * vec_pinch_transform_factor_;

    mat_transform_ = Mat4::Translation( vec );
}
Esempio n. 19
0
void myDragImage::OnEndDrag(wxMouseEvent& event)
{
    Hide();
    EndDrag();
    editor->SetCursor(oldcursor);
    editor->Disconnect(wxEVT_MOTION, wxMouseEventHandler(myDragImage::OnMotion), NULL, this);
    editor->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(myDragImage::OnEndDrag), NULL, this);

    // If the cursor is within spitting distance of the bp margin, assume it's a genuine drop
    wxPoint pt = event.GetPosition();
    if ((pt.x < 0) || ((pt.x - m_startx) > 10)) {
        return;
    }
    // Find the desired new line, and check it's different from the previous
    long pos = editor->PositionFromPoint(pt);
    int newline = editor->LineFromPosition(pos);
    if ((newline+1) != m_bp.lineno) {
        ManagerST::Get()->GetBreakpointsMgr()->DropBreakpoint(m_bp, newline);
    }
}
Esempio n. 20
0
BOOL CPaletteBar::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult)
{
	if (message == WM_NOTIFY)
	{
		NMHDR *pNMHDR = (NMHDR *) lParam;
		switch (pNMHDR->code)
		{
		case TBN_BEGINADJUST :
			return BeginAdjust(wParam,  lParam,  pLResult);

		case TBN_BEGINDRAG:
			return BeginDrag(wParam,  lParam,  pLResult);

		case TBN_CUSTHELP:
			return CustomizeHelp(wParam,  lParam,  pLResult);

		case TBN_ENDADJUST:
			return EndAdjust(wParam,  lParam,  pLResult);

		case TBN_ENDDRAG:
			return EndDrag(wParam,  lParam,  pLResult);

		case TBN_GETBUTTONINFO:
			return GetButtonInfo(wParam,  lParam,  pLResult);

		case TBN_QUERYDELETE:
			return QueryDelete(wParam,  lParam,  pLResult);

		case TBN_QUERYINSERT:
			return QueryInsert(wParam,  lParam,  pLResult);

		case TBN_RESET:
			return Reset(wParam, lParam,  pLResult);

		case TBN_TOOLBARCHANGE:
			return ToolBarChange(wParam, lParam, pLResult);
		}
	}

	return CToolBarCtrl::OnChildNotify(message, wParam, lParam, pLResult);
}
Esempio n. 21
0
void OpDragBox::DragPointerIdle(DocCoord dcMousePos, ClickModifiers cmods, Spread* pSpread, BOOL bSolidDrag)
{
	// If the mouse has moved to another spread than translate its position into the
	// new spread's coordinate system.
	if (pSpread != m_pStartSpread && pSpread != NULL)
	{
		dcMousePos = MakeRelativeToSpread(m_pStartSpread, pSpread, dcMousePos);
	}

	// Calculate the new drag rectangle.  Note that as the mouse is supposed to be
	// stationary we do NOT redraw the drag box or update our records of it.
	DocRect drNewDragBox = CalcDragBox(m_dcStartPos, dcMousePos);
	
	// Call the derived class, optionally cancelling the drag.
	if (!OnPointerIdle(m_pStartSpread, drNewDragBox, cmods))
	{
		// Cancel the drag and operation.
		EndDrag();
		End();
	}
}
Esempio n. 22
0
BOOL CDockContext::Track()
{
	// don't handle if capture already set
	if (::GetCapture() != NULL)
		return FALSE;

	// set capture to the window which received this message
	m_pBar->SetCapture();
	ASSERT(m_pBar == CWnd::GetCapture());

#ifndef _MAC
	// get messages until capture lost or cancelled/accepted
	while (CWnd::GetCapture() == m_pBar)
	{
		MSG msg;
		if (!::GetMessage(&msg, NULL, 0, 0))
		{
			AfxPostQuitMessage(msg.wParam);
			break;
		}

		switch (msg.message)
		{
		case WM_LBUTTONUP:
			if (m_bDragging)
				EndDrag();
			else
				EndResize();
			return TRUE;
		case WM_MOUSEMOVE:
			if (m_bDragging)
				Move(msg.pt);
			else
				Stretch(msg.pt);
			break;
		case WM_KEYUP:
			if (m_bDragging)
				OnKey((int)msg.wParam, FALSE);
			break;
		case WM_KEYDOWN:
			if (m_bDragging)
				OnKey((int)msg.wParam, TRUE);
			if (msg.wParam == VK_ESCAPE)
			{
				CancelLoop();
				return FALSE;
			}
			break;
		case WM_RBUTTONDOWN:
			CancelLoop();
			return FALSE;

		// just dispatch rest of the messages
		default:
			DispatchMessage(&msg);
			break;
		}
	}
#else
	Point   ptCur = {0};

	// get messages until capture lost or cancelled/accepted
	while (CWnd::GetCapture() == m_pBar)
	{
		EventRecord     er;

		if (OSEventAvail(everyEvent, &er))
		{
			GetNextEvent(everyEvent, &er);
			switch (er.what)
			{
			case mouseUp:
				if (m_bDragging)
					EndDrag();
				else
					EndResize();
				return TRUE;

			case keyDown:
			case keyUp:
			case autoKey:
			case app2Evt:
			{
				MSG     msg;

				if (WrapEvent(&er, &msg, PM_REMOVE))
				{
					if (m_bDragging)
						OnKey((int)msg.wParam, msg.message == WM_KEYDOWN);
					if (msg.message == WM_KEYUP && msg.wParam == VK_ESCAPE)
					{
						CancelLoop();
						return FALSE;
					}
				}
				break;
			}

			default:
				break;
			}
		}
		else
		{
			if (!EqualPt(er.where, ptCur))
			{
				POINT pt = {er.where.h, er.where.v};
				if (m_bDragging)
					Move(pt);
				else
					Stretch(pt);
			}
		}
	}
#endif
	CancelLoop();

	return FALSE;
}
Esempio n. 23
0
BOOL CDockContext::Track()
{
	// don't handle if capture already set
	if (::GetCapture() != NULL)
		return FALSE;

	// set capture to the window which received this message
	m_pBar->SetCapture();
	ASSERT(m_pBar == CWnd::GetCapture());

	// get messages until capture lost or cancelled/accepted
	while (CWnd::GetCapture() == m_pBar)
	{
		MSG msg;
		if (!::GetMessage(&msg, NULL, 0, 0))
		{
			AfxPostQuitMessage(msg.wParam);
			break;
		}

		switch (msg.message)
		{
		case WM_LBUTTONUP:
			if (m_bDragging)
				EndDrag();
			else
				EndResize();
			return TRUE;
		case WM_MOUSEMOVE:
			if (m_bDragging)
				Move(msg.pt);
			else
				Stretch(msg.pt);
			break;
		case WM_KEYUP:
			if (m_bDragging)
				OnKey((int)msg.wParam, FALSE);
			break;
		case WM_KEYDOWN:
			if (m_bDragging)
				OnKey((int)msg.wParam, TRUE);
			if (msg.wParam == VK_ESCAPE)
			{
				CancelLoop();
				return FALSE;
			}
			break;
		case WM_RBUTTONDOWN:
			CancelLoop();
			return FALSE;

		// just dispatch rest of the messages
		default:
			DispatchMessage(&msg);
			break;
		}
	}

	CancelLoop();

	return FALSE;
}
Esempio n. 24
0
void CmEscapeCurrentTool( void )				// abort tool operation when press escape key
{
	switch ( CurrentTool )
		{
		case ZOOM_TOOL:							// return to view position at start of drag
			if ( LToolActive )
				if ( BlendView ) BlendView->Pan( appDC, 0, 0 );
				else FrontView->Pan( appDC, 0, 0 );
			if ( RToolActive )
				if ( BlendView ) BlendView->Zoom( appDC, 1.0, 0, 0 );
				else FrontView->Zoom( appDC, 1.0, 0, 0 );
			EndDrag();							// release DC and cursor captured by BeginDrag()
			LToolActive = false;
			RToolActive = false;
			break;

		case DOMAIN_TOOL:						// just undo shift, no R2_NOT lines on screen
			if ( LToolActive && DomainView ) DomainView->Pan( appDC, 0, 0 );
			LToolActive = false;
			EndDrag();							// release DC and cursor
			break;

		case PENCIL_TOOL:
			if ( LToolActive )
				{
				EndDrag();						// release DC and cursor
				LToolActive = false;
				if ( ToolContour ) delete ToolContour;
				ToolContour = NULL;
				InvalidateRect( appWnd, NULL, FALSE );	// cleanup ROP2_NOT drawing
				}
			if ( RToolActive )
				{
				EndDrag();
				RToolActive = false;
				}
			break;

		case GRID_TOOL:
		case POINT_TOOL:
			if ( RToolActive )
				{
				EndDrag();
				RToolActive = false;
				}
			break;

		case ELLIPSE_TOOL:
			if ( LToolActive )					// erase temporary ellipse drag drawing
				{
				if ( !ScrollOccurred )
					Ellipse( appDC, LToolRect.left, LToolRect.top, LToolRect.right, LToolRect.bottom );	// erase
				EndDrag();						// release DC and cursor
				LToolActive = false;
				}
			break;

		case LINE_TOOL:
			if ( LToolActive )					// erase temporary drag line drawing if active
				{
				if ( !ScrollOccurred )
					{
					MoveToEx( appDC, LToolRect.left, LToolRect.top, NULL );
					LineTo( appDC, LToolRect.right, LToolRect.bottom );
					}
				EndDrag();						// release DC and cursor
				LToolActive = false;
				}
			break;

		case ZLINE_TOOL:
		case MULTILINE_TOOL:
		case CULTILINE_TOOL:
			if ( LToolActive )					// erase temporary drawing if active
				{
				EndDrag();								// release DC and cursor
				if ( EditContour ) delete EditContour;
				EditContour = NULL;						// stop editing contour
				FrontView->needsDrawing = true;			// erase EditContour
				if ( BackView )
					BackView->needsDrawing = true;		// erase back trace which may exist
				InvalidateRect( appWnd, NULL, FALSE );	// cleanup drawing
				LToolActive = false;
				}
			break;

		case ARROW_TOOL:
		case MAGNIFY_TOOL:
		case RECTANGLE_TOOL:					// both tools need drag rectangle erase
			if ( LToolActive )
				{
				if ( !ScrollOccurred )
					Rectangle( appDC, LToolRect.left, LToolRect.top, LToolRect.right, LToolRect.bottom );
				EndDrag();						// release DC and cursor
				LToolActive = false;
				}
			break;

		case WILDFIRE_TOOL:
			if ( RToolActive )					// cleanup fire break contour
				{
				if ( ToolContour ) delete ToolContour;
				ToolContour = NULL;
				}
			EndDrag();								// release DC and cursor
			RToolActive = false;
			LToolActive = false;
			InvalidateRect( appWnd, NULL, FALSE );	// cleanup any ROP2_NOT drawing
			break;

		case SCALPEL_TOOL:
			if ( LToolActive )					// if using tool left button, abort drag+draw
				{
				EndDrag();						// release DC and cursor
				LToolActive = false;
				if ( ToolContour ) delete ToolContour;
				ToolContour = NULL;
				InvalidateRect( appWnd, NULL, FALSE );	// cleanup ROP2_NOT drawing
				}
			if ( RToolActive )
				{
				EndDrag();
				RToolActive = false;			// if right button, just inactivate
				}
			break;

		default:								// other tools have nothing to cleanup!
			break;
		}
		
	KillTimer( appWnd, SCROLL_TIMER );			// in case section is scrolling, stop it
	Scrolling = false;
}
Esempio n. 25
0
void
TabDisplay::OnCancelMode()
{
  PaintWindow::OnCancelMode();
  EndDrag();
}
Esempio n. 26
0
void iArmyListEx::OnMouseUp(const iPoint& pos)
{
	if (m_pDragItem) {
		EndDrag();
	}
}
Esempio n. 27
0
INT_PTR MappingDlg::_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_SHOWWINDOW:
	{
		if (wParam == TRUE) {
			load();
		}
		else {
			save();
		}
		break;
	}
	case WM_SIZE: {
		::MoveWindow(m_hList, 0, 0, LOWORD(lParam), HIWORD(lParam), FALSE);
		break;
	}
	case WM_NOTIFY: {
		switch (((LPNMHDR)lParam)->idFrom) {
		case IDC_MAPPING_LIST:
			switch (((LPNMLISTVIEW)lParam)->hdr.code) {
			case LVN_BEGINDRAG:
				BeginDrag(((LPNMLISTVIEW)lParam)->iItem);
				SetFocus(m_hList);
				break;
			case NM_RCLICK: {
				POINT pt;
				GetCursorPos(&pt);
				TrackPopupMenu((HMENU)GetSubMenu(m_hMenu, 0), TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, m_hDlg, NULL);
				break;
			}
			case NM_DBLCLK:
				editMappingDataDlg();
				break;
			case LVN_ITEMCHANGED:
				if (m_active) {
					DWORD newstate = (((LPNMLISTVIEW)lParam)->uNewState & LVIS_STATEIMAGEMASK);
					if (newstate != (((LPNMLISTVIEW)lParam)->uOldState & LVIS_STATEIMAGEMASK)) {
						Mapping * btn = (Mapping *) ((LPNMLISTVIEW)lParam)->lParam;
						if (btn != 0) {
							btn->Enable = newstate == INDEXTOSTATEIMAGEMASK(2);
							m_change =true;
						}
					}
					break;
				}
			}
			break;
		default:
			return FALSE;
		}
		break;
	}
	case WM_MOUSEMOVE:
		if ( m_dragflag && GetCapture() == hWnd) {
			DragMove(LOWORD(lParam), HIWORD(lParam));
		}
		break;

	case WM_LBUTTONUP:
		if ( m_dragflag && GetCapture() == hWnd){
			EndDrag(LOWORD(lParam), HIWORD(lParam));
			InvalidateRect(hWnd, NULL, FALSE);
		}
		break;
	case WM_COMMAND:
		switch (LOWORD(wParam)) {
		case ID_MENU_MAPPING_ADD:
			addMappingDataDlg();
			break;
		case ID_MENU_MAPPING_DEL:
			deleteMappingData();
			break;
		case ID_MENU_MAPPING_EDIT:
			editMappingDataDlg();
			break;
		}
		break;
	default:
		return FALSE;
	}
	return TRUE;
}
void TouchDragComponent::OnInput( VariantList *pVList )
{
	//0 = message type, 1 = parent coordinate offset
	CL_Vec2f pt = pVList->Get(1).GetVector2();
	uint32 fingerID = 0;
	if (pVList->Get(2).GetType() == Variant::TYPE_UINT32)
	{
		fingerID = pVList->Get(2).GetUINT32();
	}

	//LogMsg("Detected finger %d at %s", fingerID, PrintVector2(pt).c_str());
	switch (eMessageType( int(pVList->Get(0).GetFloat())))
	{
	case MESSAGE_TYPE_GUI_CLICK_START:
		//first, determine if the click is on our area
		{

			if (*m_pDisabled != 0) return;

			CL_Rectf r(*m_pPos2d, CL_Sizef(m_pSize2d->x, m_pSize2d->y));

			ApplyPadding(&r, *m_pTouchPadding);
		
			if (r.contains(pt))
			{
						
				if (m_activeFingerID != -1)
				{
					//LogMsg("Ignoring new finger..");
					return;
				}
		
				TouchTrackInfo *pTouch = BaseApp::GetBaseApp()->GetTouch(pVList->Get(2).GetUINT32());
				if (pTouch->WasHandled()) return;
				pTouch->SetWasHandled(true);
                VariantList vList(pt, GetParent(), uint32(fingerID));
                
				GetParent()->GetFunction("OnOverStart")->m_sig_function(&vList);

				m_lastPos = pt;
				m_activeFingerID = fingerID;
			}
		}
		break;

	case MESSAGE_TYPE_GUI_CLICK_END:
		
		EndDrag(fingerID, pt);
	
		break;
	
	case MESSAGE_TYPE_GUI_CLICK_MOVE:
		

		if (*m_pDisabled != 0)
		{
			EndDrag(fingerID, pt);
			return;
		}

		if (m_activeFingerID == fingerID)
		{
			SetPosition(pt);
		}
	
		break;
        default: ;
	}	

}
Esempio n. 29
0
void BaseTabStrip::OnMouseCaptureLost()
{
    EndDrag(true);
}
Esempio n. 30
0
void BaseTabStrip::OnMouseReleased(const view::MouseEvent& event)
{
    EndDrag(false);
}