Allow to put URLs into "<>" and allow spaces and other chars there (as the RichEdit...
[TortoiseGit.git] / src / Utils / MiscUI / FileDropEdit.cpp
blobfeee4b98f105572cdbb667ea29d3ec62cf4a04a8
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2006, 2009, 2013 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "stdafx.h"
20 #include "FileDropEdit.h"
23 // CFileDropEdit
25 IMPLEMENT_DYNAMIC(CFileDropEdit, CEdit)
26 CFileDropEdit::CFileDropEdit()
30 CFileDropEdit::~CFileDropEdit()
35 BEGIN_MESSAGE_MAP(CFileDropEdit, CEdit)
36 END_MESSAGE_MAP()
40 // CFileDropEdit message handlers
42 void CFileDropEdit::PreSubclassWindow()
44 m_pDropTarget.reset (new CFileDropTarget (m_hWnd));
45 RegisterDragDrop(m_hWnd, m_pDropTarget.get());
46 // create the supported formats:
47 FORMATETC ftetc={0};
48 ftetc.cfFormat = CF_TEXT;
49 ftetc.dwAspect = DVASPECT_CONTENT;
50 ftetc.lindex = -1;
51 ftetc.tymed = TYMED_HGLOBAL;
52 m_pDropTarget->AddSuportedFormat(ftetc);
53 ftetc.cfFormat=CF_HDROP;
54 m_pDropTarget->AddSuportedFormat(ftetc);
56 CEdit::PreSubclassWindow();