Drag and drop is not working on mac

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Yogesh191
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Feb 26, 2006 4:30 am
Location: India
Contact:

Drag and drop is not working on mac

Post by Yogesh191 »

Hi,
I am working on cross platform application and implement a drag and drop functionality in code. My implementation is working fine with Linux and Window plateform but on mac platform it do not do anything and return wxDragNone to me.

I am using a control class that derived with wxControl and implement code just like sample :

Set target:
SetDropTarget(new DragnDropText(this)); // in constructor

On Mouse down:

Code: Select all

          wxString strText = _("Dummy data");  // only to satisfy virtual function
            // start drag operation
            wxTextDataObject textData(strText);
            wxDropSource* source = new wxDropSource(textData, this);
            int flags = 0;
            flags |=  wxDrag_AllowMove;
            wxDragResult result = source->DoDragDrop(flags);
            Refresh();
            switch ( result )
            {
                case wxDragCancel:  //When user cancle the drag using escape key
                {
                    if(HasCapture())
                    ReleaseMouse();
                }
                break;
             case : wxDragNone:
                wxMessageBox(_("none"))
                break
                default:
                break;
            }
        }
and on drop simple :

Code: Select all

bool ueDragnDropText::OnDropText(wxCoord x, wxCoord y, const wxString& text)
{
   m_ctrl->SetValue( );
}
After delving code i come to know that code line:
result = NSDragOperationToWxDragResult([delegate code]); give me wxDragNone
Sample code for drag and drop is working fine on mac , but in my case my target and source is same control and functionality is just drag text on text editor.

But this is not working on mac machine what wrong i am doing, do't know , please suggest?

I am using wxWidgrts-2.9.2

Yogesh
Yogesh Chaturvedi
OS : Windows, Linux, Mac
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: Drag and drop is not working on mac

Post by Auria »

Hi, this seems a very specific and technical issue, so I would suggest posting to the mailing list ( http://wxwidgets.org/support/maillst2.htm ) or perhaps even to the bug tracker (trac.wxwidgets.org), because it works on other systems so looks like a bug
"Keyboard not detected. Press F1 to continue"
-- Windows
Yogesh191
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Feb 26, 2006 4:30 am
Location: India
Contact:

Re: Drag and drop is not working on mac

Post by Yogesh191 »

Hi,
Thanks for suggestion , i will put mail on mailing list link.
Yogesh
Yogesh Chaturvedi
OS : Windows, Linux, Mac
cozmotion
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Oct 22, 2009 10:37 pm

Re: Drag and drop is not working on mac

Post by cozmotion »

Did you ever get this fixed? I am seeing the same thing with cocoa and 2.9.4. I need to drag/drop between controls in my app. The app is to be cross-platform - my DnD code works on windows. And on the Mac, I can drag my (text string object) from my app to a text editor fine, so it really looks like a bug in 2.9.4 Any ideas?
bcteh
Experienced Solver
Experienced Solver
Posts: 72
Joined: Mon Nov 27, 2006 9:56 am

Re: Drag and drop is not working on mac

Post by bcteh »

Any new about this ?
I can't find the issue in mailing list and trac.wxwidgets.org .
bcteh
Experienced Solver
Experienced Solver
Posts: 72
Joined: Mon Nov 27, 2006 9:56 am

Re: Drag and drop is not working on mac

Post by bcteh »

Found this issue http://trac.wxwidgets.org/changeset/72108
After apply the patch the bug fix. =D>
Post Reply