X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36b3b54ad8431bca0fa53fa8acae5ba6d4c3e9c7..7e84f02dfda7d5e3cf2cef1aa85169c55e8d4461:/samples/dnd/dnd.cpp?ds=sidebyside diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 9de516c481..f0f0469acf 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -24,7 +24,11 @@ #include "wx/dnd.h" -#ifdef __WXGTK__ +#ifdef __WXMOTIF__ +#error Sorry, drag and drop is not yet implemented on wxMotif. +#endif + +#if defined(__WXGTK__) || defined(__WXMOTIF__) #include "mondrian.xpm" #endif @@ -87,8 +91,6 @@ public: void OnLeftDown(wxMouseEvent& event); void OnRightDown(wxMouseEvent& event); - bool OnClose(); - DECLARE_EVENT_TABLE() private: @@ -298,18 +300,17 @@ void DnDFrame::OnLogClear(wxCommandEvent& /* event */ ) m_ctrlLog->Clear(); } -bool DnDFrame::OnClose() -{ - return TRUE; -} - void DnDFrame::OnLeftDown(wxMouseEvent &WXUNUSED(event) ) { if ( !m_strText.IsEmpty() ) { // start drag operation - - wxDropSource dragSource( new wxTextDataObject (m_strText), this ); +#ifdef __WXMSW__ + wxTextDataObject textData(m_strText); + wxDropSource dragSource( textData, this ); +#else + wxDropSource dragSource( new wxTextDataObject (m_strText), this, wxIcon(mondrian_xpm) ); +#endif const char *pc; switch ( dragSource.DoDragDrop(TRUE) )