Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Dialog Message(): BFM_DRAGRECEIVE [SOLVED]

    SDK Help
    0
    3
    239
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

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

          Thanks Sebastian!

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

          WP.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post