News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Drop files into editor svn6218

Started by cgarcia109, May 12, 2010, 06:14:51 PM

Previous topic - Next topic

cgarcia109

in src/src/main.cpp

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