- Timestamp:
- Aug 5, 2012, 10:50:48 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/dll/mainwnd.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/mainwnd.c
r1635 r1667 111 111 03 Oct 11 SHL Add needTile to ensure containers opened on command line render correctly 112 112 03 Oct 11 SHL Minor code cleanup 113 05 Aug 12 GKY Make the Target Directory (DriveBar) a drop target. 113 114 114 115 ***********************************************************************/ … … 1814 1815 MRESULT EXPENTRY DriveBackProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 1815 1816 { 1817 static BOOL emphasized = FALSE; 1818 1816 1819 switch (msg) { 1817 1820 case WM_CREATE: … … 1850 1853 PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_SETTARGET, 0), MPVOID); 1851 1854 return 0; 1855 1856 case DM_DRAGOVER: 1857 if (!emphasized) { 1858 emphasized = TRUE; 1859 DrawTargetEmphasis(hwnd, emphasized); 1860 } 1861 if (AcceptOneDrop(hwnd, mp1, mp2)) 1862 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 1863 return MRFROM2SHORT(DOR_NEVERDROP, 0); 1864 1865 case DM_DRAGLEAVE: 1866 if (emphasized) { 1867 emphasized = FALSE; 1868 DrawTargetEmphasis(hwnd, emphasized); 1869 } 1870 break; 1871 1872 case DM_DROPHELP: 1873 if (mp1) { 1874 1875 CNRDRAGINFO cnd; 1876 ULONG numitems; 1877 USHORT usOperation; 1878 1879 cnd.pDragInfo = (PDRAGINFO) mp1; 1880 if (!DrgAccessDraginfo((PDRAGINFO) cnd.pDragInfo)) { 1881 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, 1882 PCSZ_DRGACCESSDRAGINFO); 1883 return 0; 1884 } 1885 numitems = DrgQueryDragitemCount((PDRAGINFO) cnd.pDragInfo); 1886 usOperation = cnd.pDragInfo->usOperation; 1887 if (usOperation == DO_DEFAULT) 1888 usOperation = fCopyDefault ? DO_COPY : DO_MOVE; 1889 saymsg(MB_ENTER | MB_ICONASTERISK, 1890 hwnd, 1891 GetPString(IDS_DROPHELPHDRTEXT), 1892 GetPString(IDS_DROPHELPTEXT), 1893 numitems, 1894 &"s"[numitems == 1L], 1895 NullStr, 1896 NullStr, 1897 targetdir, 1898 " ", 1899 GetPString((usOperation == DO_MOVE) ? 1900 IDS_MOVETEXT : 1901 (usOperation == DO_LINK) ? 1902 IDS_LINKTEXT : IDS_COPYTEXT)); 1903 } 1904 return 0; 1905 1906 1907 case DM_DROP: 1908 if (targetdir) { 1909 CNRDRAGINFO cnd; 1910 LISTINFO *li; 1911 ULONG action = UM_ACTION; 1912 1913 if (emphasized) { 1914 emphasized = FALSE; 1915 DrawTargetEmphasis(hwnd, emphasized); 1916 } 1917 memset(&cnd, 0, sizeof(cnd)); 1918 cnd.pDragInfo = (PDRAGINFO) mp1; 1919 cnd.pRecord = NULL; 1920 li = DoFileDrop(hwnd, 1921 NULL, 1922 TRUE, MPFROM2SHORT(TREE_CNR, CN_DROP), MPFROMP(&cnd)); 1923 CheckPmDrgLimit(cnd.pDragInfo); 1924 if (li) { 1925 strcpy(li->targetpath, targetdir); 1926 strcat(li->targetpath, PCSZ_BACKSLASH); 1927 if (li->list && li->list[0] && IsRoot(li->list[0])) 1928 li->type = DO_LINK; 1929 else if (fDragndropDlg && (!*li->arcname || !li->info)) { 1930 1931 CHECKLIST cl; 1932 1933 memset(&cl, 0, sizeof(cl)); 1934 cl.size = sizeof(cl); 1935 cl.flags = li->type; 1936 cl.list = li->list; 1937 cl.cmd = li->type; 1938 cl.prompt = li->targetpath; 1939 li->type = WinDlgBox(HWND_DESKTOP, 1940 hwndMain, 1941 DropListProc, 1942 FM3ModHandle, DND_FRAME, MPFROMP(&cl)); 1943 if (li->type == DID_ERROR) 1944 Win_Error(DND_FRAME, HWND_DESKTOP, pszSrcFile, __LINE__, 1945 GetPString(IDS_DRAGDROPDIALOGTEXT)); 1946 if (!li->type) { 1947 FreeListInfo(li); 1948 return 0; 1949 } 1950 li->list = cl.list; 1951 if (!li->list || !li->list[0]) { 1952 FreeListInfo(li); 1953 return 0; 1954 } 1955 } 1956 else { 1957 FreeListInfo(li); 1958 return 0; 1959 } 1960 } 1961 switch (li->type) { 1962 case DND_LAUNCH: 1963 strcat(li->targetpath, " %a"); 1964 ExecOnList(hwndMain, 1965 li->targetpath, PROMPT | WINDOWED, NULL, NULL, li->list, NULL, 1966 pszSrcFile, __LINE__); 1967 FreeList(li->list); 1968 li->list = NULL; 1969 break; 1970 case DO_LINK: 1971 if (fLinkSetsIcon) { 1972 li->type = IDM_SETICON; 1973 action = UM_MASSACTION; 1974 } 1975 else 1976 li->type = IDM_COMPARE; 1977 break; 1978 case DND_EXTRACT: 1979 if (*li->targetpath && !IsFile(li->targetpath)) 1980 li->type = IDM_EXTRACT; 1981 break; 1982 case DND_MOVE: 1983 li->type = IDM_MOVE; 1984 if (*li->targetpath && IsFile(li->targetpath) == 1) { 1985 action = UM_MASSACTION; 1986 li->type = IDM_ARCHIVEM; 1987 } 1988 break; 1989 case DND_WILDMOVE: 1990 li->type = IDM_WILDMOVE; 1991 if (*li->targetpath && IsFile(li->targetpath) == 1) { 1992 action = UM_MASSACTION; 1993 li->type = IDM_ARCHIVEM; 1994 } 1995 break; 1996 case DND_OBJECT: 1997 li->type = IDM_OBJECT; 1998 action = UM_MASSACTION; 1999 break; 2000 case DND_SHADOW: 2001 li->type = IDM_SHADOW; 2002 action = UM_MASSACTION; 2003 break; 2004 case DND_COMPARE: 2005 li->type = IDM_COMPARE; 2006 break; 2007 case DND_SETICON: 2008 action = UM_MASSACTION; 2009 li->type = IDM_SETICON; 2010 break; 2011 case DND_COPY: 2012 li->type = IDM_COPY; 2013 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2014 action = UM_MASSACTION; 2015 li->type = IDM_ARCHIVE; 2016 } 2017 break; 2018 case DND_WILDCOPY: 2019 li->type = IDM_WILDCOPY; 2020 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2021 action = UM_MASSACTION; 2022 li->type = IDM_ARCHIVE; 2023 } 2024 break; 2025 default: 2026 if (*li->arcname && li->info) { 2027 action = UM_MASSACTION; 2028 li->type = (li->type == DO_MOVE) ? IDM_FAKEEXTRACTM : 2029 IDM_FAKEEXTRACT; 2030 } 2031 else if (*li->targetpath && IsFile(li->targetpath) == 1) { 2032 action = UM_MASSACTION; 2033 li->type = (li->type == DO_MOVE) ? IDM_ARCHIVEM : IDM_ARCHIVE; 2034 } 2035 else 2036 li->type = (li->type == DO_MOVE) ? IDM_MOVE : IDM_COPY; 2037 break; 2038 } 2039 if (!li->list || !li->list[0]) 2040 FreeListInfo(li); 2041 else 2042 WinSendMsg(hwndTree, UM_ACTION, MPFROMP(li), MPFROMLONG(action)); 2043 } 2044 break; 1852 2045 1853 2046 case WM_CHAR:
Note:
See TracChangeset
for help on using the changeset viewer.
