virtual bool OnData( int x, int y );
/* you have to override OnDropData to get at the text */
- virtual bool OnDropText( int x, int y, const char *text ) = 0;
+ virtual bool OnDropText( int x, int y, const wxChar *text ) = 0;
};
virtual bool OnData( int x, int y );
/* you have to override OnDropData to get at the text */
- virtual bool OnDropText( int x, int y, const char *text ) = 0;
+ virtual bool OnDropText( int x, int y, const wxChar *text ) = 0;
};
public:
DnDText(wxListBox *pOwner) { m_pOwner = pOwner; }
- virtual bool OnDropText(long x, long y, const char *psz );
+ virtual bool OnDropText(int x, int y, const wxChar* psz );
private:
wxListBox *m_pOwner;
public:
DnDFile(wxListBox *pOwner) { m_pOwner = pOwner; }
- virtual bool OnDropFiles(long x, long y,
- size_t nFiles, const char * const aszFiles[] );
+ virtual bool OnDropFiles(int x, int y,
+ size_t nFiles, const wxChar* const aszFiles[] );
private:
wxListBox *m_pOwner;
// ----------------------------------------------------------------------------
// Notifications called by the base class
// ----------------------------------------------------------------------------
-bool DnDText::OnDropText(long, long, const char *psz)
+bool DnDText::OnDropText( int, int, const wxChar *psz )
{
m_pOwner->Append(psz);
return TRUE;
}
-bool DnDFile::OnDropFiles(long, long, size_t nFiles,
- const char * const aszFiles[])
+bool DnDFile::OnDropFiles( int, int, size_t nFiles,
+ const wxChar* const aszFiles[])
{
wxString str;
- str.Printf("%d files dropped", nFiles);
+ str.Printf( _T("%d files dropped"), nFiles);
m_pOwner->Append(str);
for ( size_t n = 0; n < nFiles; n++ ) {
m_pOwner->Append(aszFiles[n]);
void wxTextDataObject::WriteString( const wxString &str, void *dest ) const
{
- memcpy( dest, m_data.c_str(), GetSize() );
+ memcpy( dest, m_data.mbc_str(), GetSize() );
}
// ----------------------------------------------------------------------------
void wxFileDataObject::WriteData( void *dest ) const
{
- memcpy( dest, m_files.c_str(), GetSize() );
+ memcpy( dest, m_files.mbc_str(), GetSize() );
}
size_t wxFileDataObject::GetSize() const
wxTextDataObject data;
if (!GetData( &data )) return FALSE;
- OnDropText( x, y, data.GetText().mbc_str() );
+ OnDropText( x, y, data.GetText() );
return TRUE;
}
if (data_object->GetFormat().GetAtom() == selection_data->target)
{
size_t data_size = data_object->GetSize();
+
if (data_size > 0)
{
guchar *buffer = new guchar[data_size];
void wxTextDataObject::WriteString( const wxString &str, void *dest ) const
{
- memcpy( dest, m_data.c_str(), GetSize() );
+ memcpy( dest, m_data.mbc_str(), GetSize() );
}
// ----------------------------------------------------------------------------
void wxFileDataObject::WriteData( void *dest ) const
{
- memcpy( dest, m_files.c_str(), GetSize() );
+ memcpy( dest, m_files.mbc_str(), GetSize() );
}
size_t wxFileDataObject::GetSize() const
wxTextDataObject data;
if (!GetData( &data )) return FALSE;
- OnDropText( x, y, data.GetText().mbc_str() );
+ OnDropText( x, y, data.GetText() );
return TRUE;
}
if (data_object->GetFormat().GetAtom() == selection_data->target)
{
size_t data_size = data_object->GetSize();
+
if (data_size > 0)
{
guchar *buffer = new guchar[data_size];