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
This commit is contained in:
Robert Roebling 1999-04-28 17:05:45 +00:00
parent d38ceae8b9
commit 90e586840b
9 changed files with 111 additions and 66 deletions

103
configure vendored
View File

@ -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 <<EOF
#line 7666 "configure"
#line 7674 "configure"
#include "confdefs.h"
#include <sys/socket.h>
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 <<EOF
#line 7684 "configure"
#line 7692 "configure"
#include "confdefs.h"
#include <sys/socket.h>
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 <<EOF
#line 7702 "configure"
#line 7710 "configure"
#include "confdefs.h"
#include <sys/socket.h>
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 <<EOF
#line 7742 "configure"
#line 7757 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -7762,7 +7777,7 @@ f = $ac_func;
; return 0; }
EOF
if { (eval echo configure:7766: \"$ac_link\") 1>&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 <<EOF
#line 7799 "configure"
#line 7814 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -7806,7 +7821,7 @@ int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:7810: \"$ac_link\") 1>&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 <<EOF
#line 7844 "configure"
#line 7859 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -7864,7 +7879,7 @@ f = $ac_func;
; return 0; }
EOF
if { (eval echo configure:7868: \"$ac_link\") 1>&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 <<EOF
#line 8060 "configure"
#line 8075 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -8067,7 +8082,7 @@ int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:8071: \"$ac_link\") 1>&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 <<EOF
#line 8102 "configure"
#line 8117 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -8109,7 +8124,7 @@ int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:8113: \"$ac_link\") 1>&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
#line 8142 "configure"
#line 8157 "configure"
#include "confdefs.h"
#include <sys/prctl.h>
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
#line 8202 "configure"
#line 8217 "configure"
#include "confdefs.h"
#include <$ac_hdr>
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 <<EOF
#line 8243 "configure"
#line 8258 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -8250,7 +8265,7 @@ int main() {
sched_yield()
; return 0; }
EOF
if { (eval echo configure:8254: \"$ac_link\") 1>&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 <<EOF
#line 8284 "configure"
#line 8299 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -8291,7 +8306,7 @@ int main() {
sched_yield()
; return 0; }
EOF
if { (eval echo configure:8295: \"$ac_link\") 1>&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 <<EOF
#line 8333 "configure"
#line 8348 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -8340,7 +8355,7 @@ int main() {
pthread_attr_getschedpolicy()
; return 0; }
EOF
if { (eval echo configure:8344: \"$ac_link\") 1>&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 <<EOF
#line 8374 "configure"
#line 8389 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -8381,7 +8396,7 @@ int main() {
pthread_attr_getschedpolicy()
; return 0; }
EOF
if { (eval echo configure:8385: \"$ac_link\") 1>&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 <<EOF
#line 8423 "configure"
#line 8438 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -8430,7 +8445,7 @@ int main() {
pthread_cancel()
; return 0; }
EOF
if { (eval echo configure:8434: \"$ac_link\") 1>&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

View File

@ -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 ------------------------------------------------------------------------

View File

@ -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 );

View File

@ -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 )
{
}

View File

@ -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)

View File

@ -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 );
}
// ----------------------------------------------------------------------------

View File

@ -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();
}

View File

@ -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 );
}
// ----------------------------------------------------------------------------

View File

@ -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();
}