Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: cgarcia109 on May 12, 2010, 06:14:51 pm

Title: Drop files into editor svn6218
Post by: cgarcia109 on May 12, 2010, 06:14:51 pm
in src/src/main.cpp

Code
--- main.cpp	(revision 6218)
+++ main.cpp (working copy)
@@ -1624,6 +1624,7 @@
     cbEditor* ed = Manager::Get()->GetEditorManager()->Open(filename);
     if (ed)
     {
+        ed->GetControl()->SetDropTarget(new wxMyFileDropTarget(this));
         if (addToHistory)
             AddToRecentFilesHistory(ed->GetFilename());
         return true;
@@ -2361,6 +2362,7 @@
     if (ed)
     {
         // initially start change-collection if configured on empty files
+        ed->GetControl()->SetDropTarget(new wxMyFileDropTarget(this));
         ed->GetControl()->SetChangeCollection(Manager::Get()->GetConfigManager(_T("editor"))->ReadBool(_T("/margin/use_changebar"), true));
     }

edit: just noticed, theres more places where Notebook pages are created :(
SetDropTarget must be called for all cases. For cbEditor SetDropTarget must be called in the internal wxcbStyledTextControl(wxScintilla) control.
Im not sure, read somewhere in the code this is new? But doesnt works. Maybe is not the desired behavior.