Changeset 1675 for trunk/dll/mainwnd.c


Ignore:
Timestamp:
Dec 31, 2012, 12:15:44 AM (13 years ago)
Author:
Gregg Young
Message:

Enhance traget directory drop to give the option of changing the directory or carrying out an operation to the current target; Added an error message for target=None; Added parameter to SetTargetDir. Ticket 373

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/mainwnd.c

    r1673 r1675  
    18241824      SetPresParams(hwnd,
    18251825                    &RGBGREY, &rgb, &RGBGREY, FNT_8HELVETICA);
    1826       SetTargetDir(hwnd, TRUE);
     1826      SetTargetDir(hwnd, TRUE, NULL);
    18271827    }
    18281828    return 0;
     
    18991899
    19001900  case DM_DROP:
    1901     if (targetdir) {
     1901    if (targetdir && strlen(targetdir) > 2) {
    19021902      CNRDRAGINFO cnd;
    19031903      LISTINFO *li;
    1904       ULONG action = UM_ACTION;
     1904      ULONG action = UM_ACTION, ret;
    19051905
    19061906      if (emphasized) {
     
    19161916      CheckPmDrgLimit(cnd.pDragInfo);
    19171917      if (li) {
     1918        if (!li->list[1] && !IsFile(li->list[0])) {
     1919          ret = saymsg(MB_YESNO,
     1920                   HWND_DESKTOP,
     1921                       NullStr,
     1922                       GetPString(IDS_DROPSETSTARGET));
     1923          if (ret == MBID_YES) {
     1924            SetTargetDir(hwnd, TRUE, li->list[0]);
     1925            break;
     1926          }
     1927        }
    19181928        strcpy(li->targetpath, targetdir);
    19191929        strcat(li->targetpath, PCSZ_BACKSLASH);
     
    20332043          FreeListInfo(li);
    20342044        else
    2035           WinSendMsg(hwndTree, UM_ACTION, MPFROMP(li), MPFROMLONG(action));
    2036       }
    2037       break;
     2045          WinSendMsg(hwndTree, UM_ACTION, MPFROMP(li), MPFROMLONG(action));
     2046    }
     2047    else {
     2048      CNRDRAGINFO cnd;
     2049      LISTINFO *li;
     2050
     2051      if (emphasized) {
     2052        emphasized = FALSE;
     2053        DrawTargetEmphasis(hwnd, emphasized);
     2054      }
     2055      memset(&cnd, 0, sizeof(cnd));
     2056      cnd.pDragInfo = (PDRAGINFO) mp1;
     2057      cnd.pRecord = NULL;
     2058      li = DoFileDrop(hwnd,
     2059                      NULL,
     2060                      TRUE, MPFROM2SHORT(TREE_CNR, CN_DROP), MPFROMP(&cnd));
     2061      CheckPmDrgLimit(cnd.pDragInfo);
     2062      if (li && !li->list[1] && !IsFile(li->list[0]))
     2063        SetTargetDir(hwnd, TRUE, li->list[0]);
     2064      else
     2065        saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,
     2066               GetPString(IDS_WARNINGTEXT),
     2067               GetPString(IDS_NOTARGETSET));
     2068    }
     2069    break;
    20382070
    20392071  case WM_CHAR:
     
    34383470    PrfQueryProfileString(fmprof, FM3Str, szKey, NULL, targetdir, sizeof(targetdir));
    34393471    PrfWriteProfileString(fmprof, FM3Str, "TargetDir", targetdir);
    3440     SetTargetDir(NULLHANDLE, TRUE);
     3472    SetTargetDir(NULLHANDLE, TRUE, NULL);
    34413473  }
    34423474  size = sizeof(SWP);
     
    47254757
    47264758  case IDM_SETTARGET:
    4727     SetTargetDir(hwnd, FALSE);
     4759    SetTargetDir(hwnd, FALSE, NULL);
    47284760    break;
    47294761
Note: See TracChangeset for help on using the changeset viewer.