#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
void OnLeftDown(wxMouseEvent& event);
void OnRightDown(wxMouseEvent& event);
- bool OnClose();
-
DECLARE_EVENT_TABLE()
private:
GetClientSize( &w, &h );
wxPaintDC dc(this);
- dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL ) );
+ dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL, FALSE, "charter" ) );
dc.DrawText( "Drag text from here!", 20, h-22 );
}
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) )