Dialog Message(): BFM_DRAGRECEIVE [SOLVED]



  • On 17/04/2016 at 19:53, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R14 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Hi Folks,

    I'm using the BFM_DRAGRECEIVE in my dialog's Message() function, to receive incoming drags from the object manager. I can get the object etc in the message, but I'm not able to get the drag release. I've tried all sorts of setups, from getting the mouse button status, to varying versions of the following:

      
    LONG My_Dialog::Message(const BaseContainer &msg;,BaseContainer &result;)   
    {   
       switch(msg.GetId())   
       {   
          case BFM_DRAGRECEIVE:   
          {   
            if(msg.GetData(BFM_DRAG_FINISHED).GetBool() == TRUE)   
            {   
                GePrint("Drag released over dialog.."); // NOT CALLED   
            }   
      
            break;   
          }   
       }   
            
       return GeDialog::Message(msg,result);   
    }   
    

    But nothing is doing it for me. What I want to do, is know when the drag is 'dropped' in my dialog. Is there a way to do this? What's the correct procedure?

    WP.



  • On 18/04/2016 at 02:30, xxxxxxxx wrote:

    Hello,

    you are only informed about the end of a Drag operations when you tell Cinema that your dialog actually cares about that drag operation. So you have to react to the BFM_DRAGRECEIVE message during the drag and not only at the end. This is typically done by returning the value of SetDragDestination().

      
    if (msg.GetInt32(BFM_DRAG_FINISHED))  
    {  
      GePrint("Drag released over dialog.."); // NOT CALLED  
    }  
    else  
    {  
      return SetDragDestination(MOUSE_POINT_HAND);  
    }  
    break;  
    

    See also the Async Dialog example.

    Best wishes,
    Sebastian



  • On 18/04/2016 at 03:42, xxxxxxxx wrote:

    Thanks Sebastian!

    Setting the drag destination was what I was missing. Cheers!

    WP.


Log in to reply