Changeset 1684


Ignore:
Timestamp:
Mar 9, 2013, 9:17:55 PM (12 years ago)
Author:
Steven Levine
Message:

SetButtonEnables: correct enable support for newish buttons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/dll/comp.c

    r1683 r1684  
    8787  06 Jan 13 GKY Added EA compare option to compare dir Ticket 80
    8888  06 Mar 13 SHL ActionCnrThread: need to strdup pszFmtFileSize to avoid aliased pointers
     89  09 Mar 13 SHL SetButtonEnables: correct enable support for newish buttons
    8990
    9091***********************************************************************/
     
    480481  strcpy(mv.target, NewName);
    481482  rc = WinDlgBox(HWND_DESKTOP,
    482                 hwnd,
    483                 RenameProc,
    484                 FM3ModHandle, REN_FRAME, (PVOID) & mv);
     483                hwnd,
     484                RenameProc,
     485                FM3ModHandle, REN_FRAME, (PVOID) & mv);
    485486  if (!rc)
    486487    return 1;
     
    569570                       MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    570571      pciD = WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPVOID,
    571                         MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
     572                        MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    572573      fConfirmAction =  WinQueryButtonCheckstate(cmp->hwnd, COMP_CONFIRMACTION);
    573574      InitITimer(&itdSleep, 500);       // Sleep every 500 mSec
     
    598599              MB2D mb2dBut[NUM_BUT] =   //fixme to use GetPString
    599600              {
    600                 { "Yes",                     1, 0},
    601                 { "Yes don't ask again",     2, 1},
    602                 { "No",                      3, 2},
    603                 { "Cancel delete operation", 4, 3}
     601                { "Yes",                     1, 0},
     602                { "Yes don't ask again",     2, 1},
     603                { "No",                      3, 2},
     604                { "Cancel delete operation", 4, 3}
    604605              };
    605606              ULONG   ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * (NUM_BUT-1)));
    606607              pmbInfo = malloc (ulInfoSize);
    607608              if (pmbInfo) {
    608                 pmbInfo->cb         = ulInfoSize;
    609                 pmbInfo->hIcon      = 0;
    610                 pmbInfo->cButtons   = NUM_BUT;
    611                 pmbInfo->flStyle    = MB_MOVEABLE;
    612                 pmbInfo->hwndNotify = NULLHANDLE;
    613                 for (i = 0; i < NUM_BUT; i++) {
    614                   memcpy( pmbInfo->mb2d+i , mb2dBut+i , sizeof(MB2D));
    615                 } //fixme to use GetPString
    616                 sprintf(s, "Do you wish to delete %s", pciS->pszFileName);
    617                 rc = WinMessageBox2(HWND_DESKTOP, cmp->hwnd,
    618                                     s, "Confirm Delete", 1234,
    619                                     pmbInfo);
    620                 free(pmbInfo);
    621                 if (rc == 2 || rc == 3) {
    622                   if (rc == 3)
    623                     enddelete = TRUE;
    624                   break;
    625                 }
    626                 else if (rc == 1)
    627                   dontask = TRUE;
     609                pmbInfo->cb         = ulInfoSize;
     610                pmbInfo->hIcon      = 0;
     611                pmbInfo->cButtons   = NUM_BUT;
     612                pmbInfo->flStyle    = MB_MOVEABLE;
     613                pmbInfo->hwndNotify = NULLHANDLE;
     614                for (i = 0; i < NUM_BUT; i++) {
     615                  memcpy( pmbInfo->mb2d+i , mb2dBut+i , sizeof(MB2D));
     616                } //fixme to use GetPString
     617                sprintf(s, "Do you wish to delete %s", pciS->pszFileName);
     618                rc = WinMessageBox2(HWND_DESKTOP, cmp->hwnd,
     619                                    s, "Confirm Delete", 1234,
     620                                    pmbInfo);
     621                free(pmbInfo);
     622                if (rc == 2 || rc == 3) {
     623                  if (rc == 3)
     624                    enddelete = TRUE;
     625                  break;
     626                }
     627                else if (rc == 1)
     628                  dontask = TRUE;
    628629              }
    629630            }
     
    687688              }
    688689              if (fConfirmAction && pciS->flags & CNRITEM_EXISTS && !dontask) {
    689                 rc = ConfirmAction(cmp->hwnd, pciS->pszFileName, szNewName);
    690                 if (rc == 1)
    691                   break;
    692                 else if (rc == 2)
    693                   dontask = TRUE;
     690                rc = ConfirmAction(cmp->hwnd, pciS->pszFileName, szNewName);
     691                if (rc == 1)
     692                  break;
     693                else if (rc == 2)
     694                  dontask = TRUE;
    694695              }
    695696              rc = docopyf(MOVE, pciS->pszFileName, szNewName);
     
    800801              }
    801802              if (fConfirmAction && pciS->flags & CNRITEM_EXISTS && !dontask) {
    802                 rc = ConfirmAction(cmp->hwnd, pciS->pszFileName, szNewName);
    803                 if (rc == 1)
    804                   break;
    805                 else if (rc == 2)
    806                   dontask = TRUE;
     803                rc = ConfirmAction(cmp->hwnd, pciS->pszFileName, szNewName);
     804                if (rc == 1)
     805                  break;
     806                else if (rc == 2)
     807                  dontask = TRUE;
    807808              }
    808809              rc = docopyf(COPY, pciS->pszFileName, szNewName);
     
    854855                pciD->latime = pciS->latime;
    855856                pciD->crdate = pciS->crdate;
    856                 pciD->crtime = pciS->crtime;
     857                pciD->crtime = pciS->crtime;
    857858                // 2013-03-06 SHL
    858859                if (pciS->pszFmtFileSize == NullStr)
     
    11411142                  ~pciS->flags & CNRITEM_LARGER &&
    11421143                  ~pciS->flags & CNRITEM_NEWER &&
    1143                   ~pciS->flags & CNRITEM_OLDER &&
    1144                   ~pciS->flags & CNRITEM_EASDIFFER;
     1144                  ~pciS->flags & CNRITEM_OLDER &&
     1145                  ~pciS->flags & CNRITEM_EASDIFFER;
    11451146        CompSelectSetSelects(pciS, pciDa[x], matched, matched, wantAnd);
    11461147      }
     
    11571158                  ~pciS->flags & CNRITEM_SMALLER &&
    11581159                  ~pciS->flags & CNRITEM_LARGER &&
    1159                   ~pciS->flags & CNRITEM_EASDIFFER;
     1160                  ~pciS->flags & CNRITEM_EASDIFFER;
    11601161        CompSelectSetSelects(pciS, pciDa[x], matched, matched, wantAnd);
    11611162      }
     
    13331334        pciD = pciDa[x];
    13341335        CompSelectSetSelects(pciS,
    1335                              pciD,
    1336                              pciS->flags & CNRITEM_EASDIFFER,
    1337                              pciD->flags & CNRITEM_EASDIFFER,
    1338                              wantAnd);
     1336                             pciD,
     1337                             pciS->flags & CNRITEM_EASDIFFER,
     1338                             pciD->flags & CNRITEM_EASDIFFER,
     1339                             wantAnd);
    13391340      }
    13401341      SleepIfNeeded(&itdSleep, 0);
     
    16921693          strupr(cmp->rightdir);
    16931694        FillDirList(cmp->rightdir, lenr, cmp->includesubdirs,
    1694                     &filesr, &cmp->cmp->totalright, &numallocr);
     1695                    &filesr, &cmp->cmp->totalright, &numallocr);
    16951696      }
    16961697      else {
     
    17491750            while (!feof(fp)) {
    17501751              if (!xfgets_bstripcr
    1751                   (str, sizeof(str), fp, pszSrcFile, __LINE__)) {
    1752                 break;
     1752                  (str, sizeof(str), fp, pszSrcFile, __LINE__)) {
     1753                break;
    17531754              }
    17541755              p = str;
     
    17571758                if (*p && *p != '\"') {
    17581759                  p = strchr(p, '\"');
    1759                   if (p) {
     1760                  if (p) {
    17601761                    *p = 0;
    17611762                    p++;
    1762                     if (*p == ',') {
     1763                    if (*p == ',') {
    17631764                      p++;
    17641765                      if (!cmp->includesubdirs && atol(p) > lenr)
    17651766                        continue;
    17661767                      p = strchr(p, ',');
    1767                       if (p) {
     1768                      if (p) {
    17681769                        p++;
    17691770                        fb4.cbFile = atoll(p);
    17701771                        p = strchr(p, ',');
    1771                         if (p) {
    1772                           p++;
    1773                           if (ulDateFmt == 2 || ulDateFmt == 3)
    1774                             fb4.fdateLastWrite.year = atol(p) - 1980;
    1775                           else if (ulDateFmt == 1)
    1776                             fb4.fdateLastWrite.day = atol(p);
    1777                           else
    1778                             fb4.fdateLastWrite.month = atol(p);
     1772                        if (p) {
     1773                          p++;
     1774                          if (ulDateFmt == 2 || ulDateFmt == 3)
     1775                            fb4.fdateLastWrite.year = atol(p) - 1980;
     1776                          else if (ulDateFmt == 1)
     1777                            fb4.fdateLastWrite.day = atol(p);
     1778                          else
     1779                            fb4.fdateLastWrite.month = atol(p);
    17791780                          p = strchr(p, DateSeparator[0]);
    1780                           if (p) {
    1781                             p++;
    1782                             if (ulDateFmt == 2 || ulDateFmt == 3)
    1783                               fb4.fdateLastWrite.month = atol(p);
    1784                             else
    1785                               fb4.fdateLastWrite.day = atol(p);
     1781                          if (p) {
     1782                            p++;
     1783                            if (ulDateFmt == 2 || ulDateFmt == 3)
     1784                              fb4.fdateLastWrite.month = atol(p);
     1785                            else
     1786                              fb4.fdateLastWrite.day = atol(p);
    17861787                            p = strchr(p, DateSeparator[0]);
    1787                             if (p) {
    1788                               p++;
    1789                               if (ulDateFmt == 2)
    1790                                 fb4.fdateLastWrite.day = atol(p);
    1791                               else if (ulDateFmt == 3)
    1792                                 fb4.fdateLastWrite.month = atol(p);
    1793                               else
    1794                                 fb4.fdateLastWrite.year = atol(p) - 1980;
     1788                            if (p) {
     1789                              p++;
     1790                              if (ulDateFmt == 2)
     1791                                fb4.fdateLastWrite.day = atol(p);
     1792                              else if (ulDateFmt == 3)
     1793                                fb4.fdateLastWrite.month = atol(p);
     1794                              else
     1795                                fb4.fdateLastWrite.year = atol(p) - 1980;
    17951796                              p = strchr(p, ',');
    1796                               if (p) {
     1797                              if (p) {
    17971798                                p++;
    17981799                                fb4.ftimeLastWrite.hours = atol(p);
    1799                                 p = strchr(p, TimeSeparator[0]);
    1800                                 if (p) {
     1800                                p = strchr(p, TimeSeparator[0]);
     1801                                if (p) {
    18011802                                  p++;
    18021803                                  fb4.ftimeLastWrite.minutes = atol(p);
    18031804                                  p = strchr(p, TimeSeparator[0]);
    1804                                   if (p) {
     1805                                  if (p) {
    18051806                                    p++;
    18061807                                    fb4.ftimeLastWrite.twosecs = atol(p);
    18071808                                    p = strchr(p, ',');
    1808                                     if (p) {
     1809                                    if (p) {
    18091810                                      p++;
    18101811                                      fb4.attrFile = atol(p);
    18111812                                      p = strchr(p, ',');
    1812                                       if (p) {
     1813                                      if (p) {
    18131814                                        p++;
    18141815                                        fb4.cbList = atol(p) * 2;
     
    18161817                                          strupr(str + 1);
    18171818                                        else if (fForceLower)
    1818                                           strlwr(str + 1);
     1819                                          strlwr(str + 1);
    18191820                                        if (AddToFileList((str + 1) + lenr,
    18201821                                                          &fb4,
     
    23072308  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTONE), fEnable);
    23082309  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTNEWER), fEnable);
     2310  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTEAS), fEnable);  // 2013-03-09 SHL
    23092311  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTOLDER), fEnable);
    23102312  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTBIGGER), fEnable);
     
    23132315  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTONE), fEnable);
    23142316  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTNEWER), fEnable);
     2317  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTEAS), fEnable); // 2013-03-09 SHL
    23152318  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTOLDER), fEnable);
    23162319  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTBIGGER), fEnable);
     
    23332336  WinEnableWindow(WinWindowFromID(hwnd, COMP_INCLUDESUBDIRS), fEnable);
    23342337  WinEnableWindow(WinWindowFromID(hwnd, COMP_HIDENOTSELECTED), fEnable);
     2338  WinEnableWindow(WinWindowFromID(hwnd, COMP_CONFIRMACTION), fEnable); // 2013-03-09 SHL
    23352339}
    23362340
     
    23902394      {
    23912395        USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT,
    2392                         COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
    2393                         COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
    2394                         COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
    2395                         COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
    2396                         COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
    2397                         COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
     2396                        COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
     2397                        COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
     2398                        COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
     2399                        COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
     2400                        COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
     2401                        COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
    23982402        UINT x;
    23992403        CHAR s[24];
     
    28592863                          CA_DETAILSVIEWTITLES | CA_OWNERDRAW;
    28602864      WinSendDlgItemMsg(hwnd, COMP_LEFTDIR, CM_SETCNRINFO, MPFROMP(&cnri),
    2861                         MPFROMLONG(CMA_CNRTITLE | CMA_FLWINDOWATTR));
     2865                        MPFROMLONG(CMA_CNRTITLE | CMA_FLWINDOWATTR));
    28622866      WinSetDlgItemText(hwnd, COMP_LISTLOADED, "");
    28632867      cnri.pszCnrTitle = cmp->rightdir;
     
    32473251            strcpy(fullname, PCSZ_STARDOTPMD);
    32483252            if (insert_filename(HWND_DESKTOP, fullname, TRUE, FALSE) &&
    3249                 *fullname && !strchr(fullname, '*') && !strchr(fullname, '?'))
     3253                *fullname && !strchr(fullname, '*') && !strchr(fullname, '?'))
    32503254              strcpy(cmp->rightlist, fullname);
    32513255          }
     
    33153319        ULONG size = sizeof(SWP);
    33163320        USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT,
    3317                         COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
    3318                         COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
    3319                         COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
    3320                         COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
    3321                         COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
    3322                         COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
     3321                        COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
     3322                        COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
     3323                        COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
     3324                        COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
     3325                        COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
     3326                        COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
    33233327        UINT x;
    33243328        CHAR s[24];
    33253329        WinQueryWindowPos(hwnd, &swp);
    33263330        PrfWriteProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp,
    3327                             size);
     3331                            size);
    33283332        for (x = 0; ids[x]; x++) {
    33293333          sprintf(s, "CompDir%i", ids[x]);
Note: See TracChangeset for help on using the changeset viewer.