From 90e586840b79c936751bf8305ea4f51c6c283791 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 28 Apr 1999 17:05:45 +0000 Subject: [PATCH] Added configure patch for DEC Tried to find a DnD bug. Corrected a tree ctrl bug. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 103 ++++++++++++++++++++++---------------- configure.in | 3 ++ samples/image/image.cpp | 6 +-- samples/splitter/test.cpp | 10 ++-- src/generic/treectrl.cpp | 19 ++++--- src/gtk/dataobj.cpp | 2 +- src/gtk/dnd.cpp | 16 +++++- src/gtk1/dataobj.cpp | 2 +- src/gtk1/dnd.cpp | 16 +++++- 9 files changed, 111 insertions(+), 66 deletions(-) diff --git a/configure b/configure index dbccca5dde..5a130486a2 100755 --- a/configure +++ b/configure @@ -5651,7 +5651,7 @@ DEFAULT_wxUSE_TIMEDATE=1 DEFAULT_wxUSE_INTL=1 DEFAULT_wxUSE_CONFIG=1 DEFAULT_wxUSE_STREAMS=1 -DEFAULT_wxUSE_SOCKETS=1 +DEFAULT_wxUSE_SOCKETS=0 DEFAULT_wxUSE_SERIAL=1 DEFAULT_wxUSE_DYNLIB_CLASS=1 @@ -7659,17 +7659,25 @@ fi if test "$wxUSE_SOCKETS" = "1"; then + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + echo $ac_n "checking the type of the third argument of getsockname""... $ac_c" 1>&6 -echo "configure:7664: checking the type of the third argument of getsockname" >&5 +echo "configure:7672: checking the type of the third argument of getsockname" >&5 cat > conftest.$ac_ext < int main() { socklen_t len; getsockname(0, NULL, &len); ; return 0; } EOF -if { (eval echo configure:7673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define SOCKLEN_T socklen_t @@ -7680,14 +7688,14 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < int main() { size_t len; getsockname(0, NULL, &len); ; return 0; } EOF -if { (eval echo configure:7691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define SOCKLEN_T size_t @@ -7698,14 +7706,14 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < int main() { int len; getsockname(0, NULL, &len); ; return 0; } EOF -if { (eval echo configure:7709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define SOCKLEN_T int @@ -7725,6 +7733,13 @@ rm -f conftest* fi rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + fi @@ -7733,12 +7748,12 @@ if test "$wxUSE_DYNLIB_CLASS" = "1"; then for ac_func in dlopen do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7737: checking for $ac_func" >&5 +echo "configure:7752: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7787,7 +7802,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:7791: checking for dlopen in -ldl" >&5 +echo "configure:7806: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7795,7 +7810,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7835,12 +7850,12 @@ done for ac_func in shl_load do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7839: checking for $ac_func" >&5 +echo "configure:7854: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8048,7 +8063,7 @@ UNIX_THREAD="" if test "$wxUSE_THREADS" = "1"; then echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:8052: checking for pthread_create in -lpthread" >&5 +echo "configure:8067: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8056,7 +8071,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8090,7 +8105,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:8094: checking for pthread_create in -lc_r" >&5 +echo "configure:8109: checking for pthread_create in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8098,7 +8113,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8133,17 +8148,17 @@ else ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/prctl.h""... $ac_c" 1>&6 -echo "configure:8137: checking for sys/prctl.h" >&5 +echo "configure:8152: checking for sys/prctl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8193,17 +8208,17 @@ if test "$wxUSE_THREADS" = "1"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8197: checking for $ac_hdr" >&5 +echo "configure:8212: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8231,7 +8246,7 @@ done echo $ac_n "checking for sched_yield in -l$THREADS_LINK""... $ac_c" 1>&6 -echo "configure:8235: checking for sched_yield in -l$THREADS_LINK" >&5 +echo "configure:8250: checking for sched_yield in -l$THREADS_LINK" >&5 ac_lib_var=`echo $THREADS_LINK'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8239,7 +8254,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$THREADS_LINK $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8272,7 +8287,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -l"posix4"""... $ac_c" 1>&6 -echo "configure:8276: checking for sched_yield in -l"posix4"" >&5 +echo "configure:8291: checking for sched_yield in -l"posix4"" >&5 ac_lib_var=`echo "posix4"'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8280,7 +8295,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l"posix4" $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8321,7 +8336,7 @@ fi echo $ac_n "checking for pthread_attr_getschedpolicy in -l$THREADS_LINK""... $ac_c" 1>&6 -echo "configure:8325: checking for pthread_attr_getschedpolicy in -l$THREADS_LINK" >&5 +echo "configure:8340: checking for pthread_attr_getschedpolicy in -l$THREADS_LINK" >&5 ac_lib_var=`echo $THREADS_LINK'_'pthread_attr_getschedpolicy | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8329,7 +8344,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$THREADS_LINK $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8362,7 +8377,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_attr_getschedpolicy in -l"posix4"""... $ac_c" 1>&6 -echo "configure:8366: checking for pthread_attr_getschedpolicy in -l"posix4"" >&5 +echo "configure:8381: checking for pthread_attr_getschedpolicy in -l"posix4"" >&5 ac_lib_var=`echo "posix4"'_'pthread_attr_getschedpolicy | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8370,7 +8385,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l"posix4" $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8411,7 +8426,7 @@ fi echo $ac_n "checking for pthread_cancel in -l$THREADS_LINK""... $ac_c" 1>&6 -echo "configure:8415: checking for pthread_cancel in -l$THREADS_LINK" >&5 +echo "configure:8430: checking for pthread_cancel in -l$THREADS_LINK" >&5 ac_lib_var=`echo $THREADS_LINK'_'pthread_cancel | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8419,7 +8434,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$THREADS_LINK $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else diff --git a/configure.in b/configure.in index 97c118eaa2..cd51d6aeb4 100644 --- a/configure.in +++ b/configure.in @@ -1370,6 +1370,8 @@ dnl wxSocket dnl ------------------------------------------------------------------------ if test "$wxUSE_SOCKETS" = "1"; then + AC_LANG_SAVE + AC_LANG_CPLUSPLUS dnl determine the type of third argument for getsockname AC_MSG_CHECKING(the type of the third argument of getsockname) AC_TRY_COMPILE( @@ -1388,6 +1390,7 @@ if test "$wxUSE_SOCKETS" = "1"; then ) ) ) + AC_LANG_RESTORE fi dnl ------------------------------------------------------------------------ diff --git a/samples/image/image.cpp b/samples/image/image.cpp index 2b923cb1fb..466618e351 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -226,11 +226,11 @@ MyFrame::MyFrame() wxPoint(20,20), wxSize(470,360) ) { wxMenu *file_menu = new wxMenu(); - file_menu->Append( ID_ABOUT, "About.."); - file_menu->Append( ID_QUIT, "Exit"); + file_menu->Append( ID_ABOUT, "&About.."); + file_menu->Append( ID_QUIT, "E&xit"); wxMenuBar *menu_bar = new wxMenuBar(); - menu_bar->Append(file_menu, "File"); + menu_bar->Append(file_menu, "&File"); SetMenuBar( menu_bar ); diff --git a/samples/splitter/test.cpp b/samples/splitter/test.cpp index 3073e17f3c..c44103a332 100644 --- a/samples/splitter/test.cpp +++ b/samples/splitter/test.cpp @@ -89,7 +89,7 @@ DECLARE_EVENT_TABLE() class MyCanvas: public wxScrolledWindow { public: - MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h); + MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h, const wxString &name); virtual ~MyCanvas(); virtual void OnDraw(wxDC& dc); @@ -166,12 +166,12 @@ MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, cons m_splitter = new MySplitterWindow(this, SPLITTER_WINDOW); - m_leftCanvas = new MyCanvas(m_splitter, CANVAS1, 0, 0, 400, 400); + m_leftCanvas = new MyCanvas(m_splitter, CANVAS1, 0, 0, 400, 400, "Test1" ); m_leftCanvas->SetBackgroundColour(*wxRED); m_leftCanvas->SetScrollbars(20, 20, 50, 50); m_leftCanvas->SetCursor(wxCursor(wxCURSOR_MAGNIFIER)); - m_rightCanvas = new MyCanvas(m_splitter, CANVAS2, 0, 0, 400, 400); + m_rightCanvas = new MyCanvas(m_splitter, CANVAS2, 0, 0, 400, 400, "Test2" ); m_rightCanvas->SetBackgroundColour(*wxCYAN); m_rightCanvas->SetScrollbars(20, 20, 50, 50); m_rightCanvas->Show(FALSE); @@ -252,8 +252,8 @@ void MyFrame::UpdatePosition() SetStatusText(str); } -MyCanvas::MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h) : - wxScrolledWindow(parent, id, wxPoint(x, y), wxSize(w, h)) +MyCanvas::MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h, const wxString &name ) : + wxScrolledWindow(parent, id, wxPoint(x, y), wxSize(w, h), 0, name ) { } diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index c69ea64098..2494432374 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -1327,14 +1327,17 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event ) if (!prev) { prev = GetParent( m_current ); - long cockie = 0; - wxTreeItemId current = m_current; - if (current == GetFirstChild( prev, cockie )) - { - // otherwise we return to where we came from - SelectItem( prev ); - EnsureVisible( prev ); - break; + if (prev) + { + long cockie = 0; + wxTreeItemId current = m_current; + if (current == GetFirstChild( prev, cockie )) + { + // otherwise we return to where we came from + SelectItem( prev ); + EnsureVisible( prev ); + break; + } } } if (prev) diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index c36564b559..cbcce96e5f 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -341,7 +341,7 @@ size_t wxTextDataObject::GetSize() const void wxTextDataObject::WriteString( const wxString &str, void *dest ) const { - memcpy( dest, m_data.mbc_str(), GetSize() ); + memcpy( dest, str.mb_str(), str.Len()+1 ); } // ---------------------------------------------------------------------------- diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index ae53201b1b..0bfbbc7bde 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -273,6 +273,8 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget), qualifies for junk */ gtk_drag_finish (context, FALSE, FALSE, time); +// printf( "no data.\n" ); + return; } @@ -340,6 +342,12 @@ bool wxDropTarget::RequestData( wxDataFormat format ) if (!m_dragContext) return FALSE; if (!m_dragWidget) return FALSE; +/* + wxPrintf( _T("format: %s.\n"), format.GetId().c_str() ); + if (format.GetType() == wxDF_PRIVATE) wxPrintf( _T("private data.\n") ); + if (format.GetType() == wxDF_TEXT) wxPrintf( _T("text data.\n") ); +*/ + /* this should trigger an "drag_data_received" event */ gtk_drag_get_data( m_dragWidget, m_dragContext, @@ -581,6 +589,8 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), guint WXUNUSED(time), wxDropSource *drop_source ) { +// printf( "Provide data!\n" ); + // char *name = gdk_atom_name( selection_data->target ); // if (name) printf( "Format requested: %s.\n", name ); @@ -590,10 +600,14 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), wxDataObject *data_object = (wxDataObject*) node->Data(); if (data_object->GetFormat().GetAtom() == selection_data->target) { +// printf( "format found.\n" ); + size_t data_size = data_object->GetSize(); if (data_size > 0) { +// printf( "data size: %d.\n", (int)data_size ); + guchar *buffer = new guchar[data_size]; data_object->WriteData( buffer ); @@ -802,8 +816,6 @@ wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) 0, 0 ); - gdk_flush(); - while (m_waiting) wxYield(); } diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index c36564b559..cbcce96e5f 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -341,7 +341,7 @@ size_t wxTextDataObject::GetSize() const void wxTextDataObject::WriteString( const wxString &str, void *dest ) const { - memcpy( dest, m_data.mbc_str(), GetSize() ); + memcpy( dest, str.mb_str(), str.Len()+1 ); } // ---------------------------------------------------------------------------- diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index ae53201b1b..0bfbbc7bde 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -273,6 +273,8 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget), qualifies for junk */ gtk_drag_finish (context, FALSE, FALSE, time); +// printf( "no data.\n" ); + return; } @@ -340,6 +342,12 @@ bool wxDropTarget::RequestData( wxDataFormat format ) if (!m_dragContext) return FALSE; if (!m_dragWidget) return FALSE; +/* + wxPrintf( _T("format: %s.\n"), format.GetId().c_str() ); + if (format.GetType() == wxDF_PRIVATE) wxPrintf( _T("private data.\n") ); + if (format.GetType() == wxDF_TEXT) wxPrintf( _T("text data.\n") ); +*/ + /* this should trigger an "drag_data_received" event */ gtk_drag_get_data( m_dragWidget, m_dragContext, @@ -581,6 +589,8 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), guint WXUNUSED(time), wxDropSource *drop_source ) { +// printf( "Provide data!\n" ); + // char *name = gdk_atom_name( selection_data->target ); // if (name) printf( "Format requested: %s.\n", name ); @@ -590,10 +600,14 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), wxDataObject *data_object = (wxDataObject*) node->Data(); if (data_object->GetFormat().GetAtom() == selection_data->target) { +// printf( "format found.\n" ); + size_t data_size = data_object->GetSize(); if (data_size > 0) { +// printf( "data size: %d.\n", (int)data_size ); + guchar *buffer = new guchar[data_size]; data_object->WriteData( buffer ); @@ -802,8 +816,6 @@ wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) 0, 0 ); - gdk_flush(); - while (m_waiting) wxYield(); } -- 2.45.2