Changeset 1394 for trunk/dll/treecnr.c


Ignore:
Timestamp:
Feb 5, 2009, 5:17:25 AM (17 years ago)
Author:
Steven Levine
Message:

Ticket 340: Convert GetPString to use STRINGTABLE.

Drop fm3dll.str and mkstr.exe from makefiles and wpi builders

Convert many functions to expect PCSZ arguments.
Correct walk, compare and dirsizes dialog setups to ignore saved dialog size
Drop copyright.c logic from makefile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/treecnr.c

    r1391 r1394  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2008 Steven H. Levine
     9  Copyright (c) 2001, 2009 Steven H. Levine
    1010
    1111  16 Oct 02 SHL Handle large partitions
     
    5656  27 Dec 08 GKY Add refresh removable media to tree container menus
    5757  28 Dec 08 GKY Rework partition submenu to gray out unavailable items (check for existence of files)
    58                 and have no default choice.
     58                and have no default choice.
    5959  01 Jan 09 GKY Add Seek and Scan to drives & directory context menus pass drive/dir as search root
    6060  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     
    248248                   MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
    249249  if (pci && (INT) pci != -1 && !stricmp(pci->pszFileName, dirname)) {
    250     // DbgMsg(pszSrcFile, __LINE__, "already at %s collapse %u maketop %u", dirname, collapsefirst, maketop);   // 14 Aug 07 SHL fixme
    251250    quickbail = TRUE;                   // Bypass repositioning
    252251    goto MakeTop;
    253252  }
    254253  WinEnableWindowUpdate(hwndCnr, FALSE);
    255   // DbgMsg(pszSrcFile, __LINE__, "finding %s collapse %u maketop %u", dirname, collapsefirst, maketop);        // 14 Aug 07 SHL fixme
    256254  pci = FindCnrRecord(hwndCnr, dirname, NULL, TRUE, FALSE, TRUE);
    257255  if (!pci || (INT) pci == -1) {
     
    285283    pci = FindCnrRecord(hwndCnr, dirname, NULL, TRUE, FALSE, TRUE);
    286284  }
    287   // DbgMsg(pszSrcFile, __LINE__, "found");     // 14 Aug 07 SHL fixme
    288285  if (pci && (INT) pci != -1) {
    289286    if (~pci->rc.flRecordAttr & CRA_CURSORED) {
    290287      if (collapsefirst) {
    291         // DbgMsg(pszSrcFile, __LINE__, "collapsing");  // 14 Aug 07 SHL fixme
    292288        pciP = WinSendMsg(hwndCnr,
    293289                          CM_QUERYRECORD,
    294290                          MPVOID, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    295291        while (pciP && (INT) pciP != -1) {
    296 #if 1 // // 05 Jan 08 SHL fixme to be sure this is correct code
     292#if 1 // 05 Jan 08 SHL fixme to be sure this is correct code
    297293          if (pciP->rc.flRecordAttr & CRA_EXPANDED) {
    298294            // collapse top level of all branches
     
    317313      }
    318314      /* expand all parent branches */
    319       // DbgMsg(pszSrcFile, __LINE__, "expanding parents");     // 14 Aug 07 SHL fixme
    320315      pciToSelect = pci;
    321316      for (;;) {
     
    336331    /* make record visible */
    337332  MakeTop:
    338     // DbgMsg(pszSrcFile, __LINE__, "moving into view");        // 14 Aug 07 SHL fixme
    339333    pciToSelect = pci;
    340334    if (pciToSelect && (INT) pciToSelect != -1) {
     
    343337      }
    344338      if (fSwitchTreeExpand && ~pciToSelect->rc.flRecordAttr & CRA_EXPANDED) {
    345         // DbgMsg(pszSrcFile, __LINE__, "expanding current");   // 14 Aug 07 SHL fixme
    346339        WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID);
    347         // DbgMsg(pszSrcFile, __LINE__, "expanded");    // 14 Aug 07 SHL fixme
    348340      }
    349341      if (!quickbail) {
     
    355347    }
    356348  }
    357   // DbgMsg(pszSrcFile, __LINE__, "done");      // 14 Aug 07 SHL fixme
    358349  WinEnableWindowUpdate(hwndCnr, TRUE);
    359350  // DosSleep(1);                       // Let GUI update
     
    540531                                   MPARAM mp2)
    541532{
    542 
    543533  switch (msg) {
    544534  case UM_CONTAINERHWND:
     
    623613
    624614  switch (msg) {
    625   case WM_CREATE:
    626     DbgMsg(pszSrcFile, __LINE__, "WM_CREATE mp1 %p mp2 %p", mp1, mp2);  // 18 Jul 08 SHL fixme
    627     break;
    628 
    629615  case UM_SHOWME:
    630     // DbgMsg(pszSrcFile, __LINE__, "UM_SHOWME mp1 %p mp2 %p", mp1, mp2);       // 14 Aug 07 SHL fixme
    631616    if (mp1) {
    632617#     ifdef FORTIFY
     
    634619#     endif
    635620      dcd = INSTDATA(hwnd);
    636       // DbgMsg(pszSrcFile, __LINE__, "UM_SHOWME dcd %p", dcd); // 14 Aug 07 SHL fixme
    637621      if (dcd) {
    638622        BOOL tempsusp, tempfollow, temptop;
     
    706690      while (list[numentries])
    707691        numentries++;
    708       if (numentries) {
    709         //DbgMsg(pszSrcFile, __LINE__, "UM_UPDATERECORD %s", *list);
    710         UpdateCnrList(dcd->hwndCnr, list, numentries, TRUE, dcd);
    711       }
     692      if (numentries)
     693        UpdateCnrList(dcd->hwndCnr, list, numentries, TRUE, dcd);
    712694    }
    713695    return 0;
     
    981963
    982964  switch (msg) {
    983   case WM_CREATE:
    984     DbgMsg(pszSrcFile, __LINE__, "WM_CREATE mp1 %p mp2 %p", mp1, mp2);  // 18 Jul 08 SHL fixme
    985     break;
    986 
    987965  case DM_PRINTOBJECT:
    988966    return MRFROMLONG(DRR_TARGET);
     
    11901168  case UM_UPDATERECORD:
    11911169    if (dcd && mp1) {
    1192 
    11931170      CHAR *filename;
    1194 
    11951171      filename = mp1;
    11961172      if (filename) {
    1197         //DbgMsg(pszSrcFile, __LINE__, "UM_UPDATERECORD %s", filename);
    1198         UpdateCnrRecord(hwnd, filename, TRUE, dcd);
     1173        UpdateCnrRecord(hwnd, filename, TRUE, dcd);
    11991174      }
    12001175    }
     
    13301305        cnri.flWindowAttr &= (~(CA_MIXEDTARGETEMPH | CA_ORDEREDTARGETEMPH));
    13311306        cnri.flWindowAttr |= CV_FLOW;
    1332         dcd->flWindowAttr = cnri.flWindowAttr;
     1307        dcd->flWindowAttr = cnri.flWindowAttr;
    13331308        WinSendMsg(hwnd,
    13341309                   CM_SETCNRINFO,
    13351310                   MPFROMP(&cnri),
    13361311                   MPFROMLONG(CMA_FLWINDOWATTR | CMA_LINESPACING |
    1337                               CMA_CXTREEINDENT | CMA_PSORTRECORD));
     1312                              CMA_CXTREEINDENT | CMA_PSORTRECORD));
    13381313        if (xbeginthread(MakeObjWin,
    13391314                         327680,
     
    14311406          DrgFreeDraginfo(pDInfo);
    14321407        }
    1433         return 0;
     1408        return 0;
    14341409
    14351410      case CN_DROPHELP:
     
    14491424          else {
    14501425            numitems = DrgQueryDragitemCount(pDInfo);
    1451             usOperation = pDInfo->usOperation;
    1452             if (usOperation == DO_DEFAULT)
    1453               usOperation = fCopyDefault ? DO_COPY : DO_MOVE;
     1426            usOperation = pDInfo->usOperation;
     1427            if (usOperation == DO_DEFAULT)
     1428              usOperation = fCopyDefault ? DO_COPY : DO_MOVE;
    14541429            FreeDragInfoData(hwnd, pDInfo);
    14551430            saymsg(MB_ENTER | MB_ICONASTERISK,
     
    18651840              }
    18661841            }
    1867             else if (SHORT2FROMMP(mp1) == CN_EXPANDTREE) {
     1842            else if (SHORT2FROMMP(mp1) == CN_EXPANDTREE) {
    18681843              if (Flesh(hwnd, pci) && !dcd->suspendview && fTopDir)
    18691844                PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID);
     
    19961971                                DRIVE_NOLOADICONS | DRIVE_NOLOADSUBJS |
    19971972                                DRIVE_NOLOADLONGS | DRIVE_INCLUDEFILES |
    1998                                 DRIVE_SLOW | DRIVE_NOSTATS |
    1999                                 DRIVE_WRITEVERIFYOFF);
     1973                                DRIVE_SLOW | DRIVE_NOSTATS |
     1974                                DRIVE_WRITEVERIFYOFF);
    20001975
    20011976              if (removable == 1)
     
    20262001                  strcmp(FileSystem, FAT32) &&
    20272002                  strcmp(FileSystem, NDFS32) &&
    2028                   strcmp(FileSystem, NTFS) &&
     2003                  strcmp(FileSystem, NTFS) &&
    20292004                  strcmp(FileSystem, HPFS386)) {
    20302005                driveflags[x] |= DRIVE_NOLONGNAMES;
    2031               }
     2006              }
    20322007              SelectDriveIcon(pciP);
    20332008              WinSendMsg(hwnd,
     
    22342209            writeable = rdy
    22352210              && !(driveflags[chDrvU - 'A'] & DRIVE_NOTWRITEABLE);
    2236             local = rdy && (!(driveflags[chDrvU - 'A'] & (DRIVE_REMOTE | DRIVE_VIRTUAL)));
     2211            local = rdy && (!(driveflags[chDrvU - 'A'] & (DRIVE_REMOTE | DRIVE_VIRTUAL)));
    22372212            underenv = (pci->flags & RECFLAGS_UNDERENV) != 0;
    22382213
     
    22602235            WinEnableMenuItem((HWND) mp2, IDM_FORMAT, writeable && local);
    22612236            WinEnableMenuItem((HWND) mp2, IDM_OPTIMIZE, writeable && local);
    2262             WinEnableMenuItem((HWND) mp2, IDM_PARTITIONSMENU, local);
    2263             WinEnableMenuItem((HWND) mp2, IDM_PARTITION, fMiniLVM);
    2264             WinEnableMenuItem((HWND) mp2, IDM_PARTITIONDF, fDFSee);
    2265             WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui);
    2266             WinEnableMenuItem((HWND) mp2, IDM_PARTITIONFD, fFDisk);
     2237            WinEnableMenuItem((HWND) mp2, IDM_PARTITIONSMENU, local);
     2238            WinEnableMenuItem((HWND) mp2, IDM_PARTITION, fMiniLVM);
     2239            WinEnableMenuItem((HWND) mp2, IDM_PARTITIONDF, fDFSee);
     2240            WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui);
     2241            WinEnableMenuItem((HWND) mp2, IDM_PARTITIONFD, fFDisk);
    22672242
    22682243            WinEnableMenuItem((HWND) mp2, IDM_DETACH, !local);
     
    22912266        CopyPresParams((HWND) mp2, hwndMainMenu);
    22922267        WinEnableMenuItem((HWND) mp2, IDM_RESELECT, FALSE);
    2293         WinEnableMenuItem((HWND) mp2, IDM_PARTITION, fMiniLVM);
    2294         WinEnableMenuItem((HWND) mp2, IDM_PARTITIONDF, fDFSee);
    2295         WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui);
    2296         WinEnableMenuItem((HWND) mp2, IDM_PARTITIONFD, fFDisk);
     2268        WinEnableMenuItem((HWND) mp2, IDM_PARTITION, fMiniLVM);
     2269        WinEnableMenuItem((HWND) mp2, IDM_PARTITIONDF, fDFSee);
     2270        WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui);
     2271        WinEnableMenuItem((HWND) mp2, IDM_PARTITIONFD, fFDisk);
    22972272        break;
    22982273
     
    24522427            pgd.progt.progc = PROG_WINDOWABLEVIO;
    24532428            pgd.progt.fbVisible = SHE_VISIBLE;
    2454             pgd.pszTitle = GetPString(IDS_DETACHREQUESTTEXT);
     2429            pgd.pszTitle = (PSZ)GetPString(IDS_DETACHREQUESTTEXT);
    24552430            pgd.pszExecutable = p;
    24562431            pgd.pszParameters = params;
     
    26422617
    26432618      case IDM_REFRESHREMOVABLES:
    2644         runemf2(SEPARATE | WINDOWED | BACKGROUND | MINIMIZED | WAIT,
    2645                 HWND_DESKTOP, pszSrcFile, __LINE__, NULL, NULL,
    2646                 "%s", "LVM.EXE /RediscoverPRM");
    2647         PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
     2619        runemf2(SEPARATE | WINDOWED | BACKGROUND | MINIMIZED | WAIT,
     2620                HWND_DESKTOP, pszSrcFile, __LINE__, NULL, NULL,
     2621                "%s", "LVM.EXE /RediscoverPRM");
     2622        PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
    26482623        break;
    26492624
     
    27502725        else
    27512726          StartCollector(dcd->hwndParent, 4);
    2752         if (SHORT1FROMMP(mp1) == IDM_GREP) {
    2753           PCNRITEM pci = NULL;
    2754 
    2755           pci = WinSendMsg(hwnd,
    2756                            CM_QUERYRECORDEMPHASIS,
    2757                            MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
    2758           if (pci && (INT) pci != -1)
    2759             PostMsg(Collector, WM_COMMAND,
    2760                     MPFROM2SHORT(IDM_GREP, 0), MPFROMP(pci->pszFileName));
    2761           else
    2762             PostMsg(Collector, WM_COMMAND,
    2763                     MPFROM2SHORT(IDM_GREP, 0), MPVOID);
    2764         }
    2765         else
     2727        if (SHORT1FROMMP(mp1) == IDM_GREP) {
     2728          PCNRITEM pci = NULL;
     2729
     2730          pci = WinSendMsg(hwnd,
     2731                           CM_QUERYRECORDEMPHASIS,
     2732                           MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
     2733          if (pci && (INT) pci != -1)
     2734            PostMsg(Collector, WM_COMMAND,
     2735                    MPFROM2SHORT(IDM_GREP, 0), MPFROMP(pci->pszFileName));
     2736          else
     2737            PostMsg(Collector, WM_COMMAND,
     2738                    MPFROM2SHORT(IDM_GREP, 0), MPVOID);
     2739        }
     2740        else
    27662741        PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_COLLECTOR, 0), MPVOID);
    27672742        break;
     
    28182793                driveflags[toupper(*pci->pszFileName) - 'A'] &=
    28192794                  (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
    2820                    DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS | DRIVE_NOSTATS |
    2821                    DRIVE_WRITEVERIFYOFF);
     2795                   DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS | DRIVE_NOSTATS |
     2796                   DRIVE_WRITEVERIFYOFF);
    28222797                DriveFlagsOne(toupper(*pci->pszFileName) - 'A');
    28232798                driveflag = driveflags[toupper(*pci->pszFileName) - 'A'];
     
    31183093      /* kill object window */
    31193094      if (WinIsWindow((HAB) 0, dcd->hwndObject)) {
    3120         if (!PostMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID))
    3121           WinSendMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID);
     3095        if (!PostMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID))
     3096          WinSendMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID);
    31223097      }
    31233098    }
     
    33023277        }
    33033278        dcd->oldproc = WinSubclassWindow(dcd->hwndCnr, TreeCnrWndProc);
    3304         // DbgMsg(pszSrcFile, __LINE__, "oldproc subclass %X", dcd->oldproc);   // 05 Jul 07 SHL
    33053279        // fixme to document 01 test?
    33063280        if (dcd->oldproc == 0)
Note: See TracChangeset for help on using the changeset viewer.