m_strText("wxWindows drag & drop works :-)")
{
+
+#ifdef __WXMSW__
// frame icon and status bar
SetIcon(wxIcon("mondrian"));
+#endif
+
const int widths[] = { -1 };
CreateStatusBar();
m_ctrlFile = new wxListBox(this, -1, pos, size, 1, &strFile, wxLB_HSCROLL);
m_ctrlText = new wxListBox(this, -1, pos, size, 1, &strText, wxLB_HSCROLL);
+
m_ctrlLog = new wxTextCtrl(this, -1, "", pos, size,
wxTE_MULTILINE | wxTE_READONLY |
wxSUNKEN_BORDER| wxHSCROLL);
m_pLogPrev = wxLog::SetActiveTarget(m_pLog);
// associate drop targets with 2 text controls
- m_ctrlFile->SetDropTarget(new DnDFile(m_ctrlFile));
- m_ctrlText->SetDropTarget(new DnDText(m_ctrlText));
+// m_ctrlFile->SetDropTarget(new DnDFile(m_ctrlFile));
+ m_ctrlText->SetDropTarget(new DnDText(m_ctrlText));
- wxLayoutConstraints *c;
+ wxLayoutConstraints *c;
// Top-left listbox
c = new wxLayoutConstraints;
dialog.ShowModal();
}
-void DnDFrame::OnLogClear(wxCommandEvent& event)
+void DnDFrame::OnLogClear(wxCommandEvent& /* event */ )
{
m_ctrlLog->Clear();
}
return TRUE;
}
-void DnDFrame::OnMouseBtnDown(wxMouseEvent& event)
+void DnDFrame::OnMouseBtnDown(wxMouseEvent& /* event */ )
{
if ( !m_strText.IsEmpty() ) {
// start drag operation
wxTextDataObject data(m_strText);
- wxDropSource dragSource(data);
+ wxDropSource dragSource(data, this);
const char *pc;
switch ( dragSource.DoDragDrop(TRUE) ) {