[123] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: select.c 748 2007-08-02 05:09:27Z stevenhl $
|
---|
| 5 |
|
---|
[362] | 6 | Container item selection support routines
|
---|
| 7 |
|
---|
[123] | 8 | Copyright (c) 1993-98 M. Kimes
|
---|
[672] | 9 | Copyright (c) 2004, 2007 Steven H. Levine
|
---|
[123] | 10 |
|
---|
[158] | 11 | 01 Aug 04 SHL Rework lstrip/rstrip usage
|
---|
| 12 | 25 May 05 SHL Rework for ULONGLONG
|
---|
[204] | 13 | 06 Jun 05 SHL Drop unused code
|
---|
[317] | 14 | 06 Jul 06 SHL Support compare content (IDM_SELECTSAMECONTENT)
|
---|
[362] | 15 | 13 Jul 06 SHL Use Runtime_Error
|
---|
[406] | 16 | 29 Jul 06 SHL Use xfgets_bstripcr
|
---|
[442] | 17 | 15 Aug 06 SHL Rework SetMask args and logic
|
---|
[603] | 18 | 06 Apr 07 GKY Work around PM DragInfo and DrgFreeDISH limits
|
---|
[618] | 19 | 19 Apr 07 SHL Sync with NumItemsToUnhilite mods
|
---|
[672] | 20 | 12 May 07 SHL Use dcd->ulItemsToUnHilite
|
---|
[690] | 21 | 14 Jun 07 SHL SelectAll: make odd expression go away
|
---|
[748] | 22 | 01 Aug 07 SHL Clean up while auditing for CNRITEM sync
|
---|
[123] | 23 |
|
---|
| 24 | ***********************************************************************/
|
---|
| 25 |
|
---|
[2] | 26 | #define INCL_DOS
|
---|
| 27 | #define INCL_WIN
|
---|
[158] | 28 | #define INCL_LONGLONG
|
---|
| 29 | #include <os2.h>
|
---|
[2] | 30 |
|
---|
| 31 | #include <stdio.h>
|
---|
| 32 | #include <stdlib.h>
|
---|
| 33 | #include <string.h>
|
---|
| 34 | #include <share.h>
|
---|
[317] | 35 | #include <io.h>
|
---|
[158] | 36 |
|
---|
[2] | 37 | #include "fm3dll.h"
|
---|
| 38 | #include "fm3str.h"
|
---|
| 39 |
|
---|
| 40 | #pragma alloc_text(SELECT,UnHilite,SelectAll,DeselectAll,MarkAll,SetMask)
|
---|
| 41 | #pragma alloc_text(SELECT,SelectList)
|
---|
| 42 | #pragma alloc_text(SELECT1,Deselect,HideAll,RemoveAll,ExpandAll,InvertAll)
|
---|
| 43 |
|
---|
[362] | 44 | static PSZ pszSrcFile = __FILE__;
|
---|
| 45 |
|
---|
[672] | 46 | VOID UnHilite(HWND hwndCnr, BOOL all, CHAR *** list, ULONG ulItemsToUnHilite)
|
---|
[317] | 47 | {
|
---|
[2] | 48 | PCNRITEM pci;
|
---|
[603] | 49 | INT numfiles = 0, numalloc = 0, x = 0;
|
---|
[551] | 50 | INT attribute = CRA_CURSORED;
|
---|
[2] | 51 |
|
---|
[362] | 52 | if (all && list && *list) {
|
---|
[2] | 53 | FreeList(*list);
|
---|
| 54 | *list = NULL;
|
---|
| 55 | }
|
---|
[551] | 56 | pci = (PCNRITEM) CurrentRecord(hwndCnr);
|
---|
[748] | 57 | if (pci && (INT)pci != -1) {
|
---|
[362] | 58 | if (pci->rc.flRecordAttr & CRA_SELECTED) {
|
---|
[2] | 59 | attribute = CRA_SELECTED;
|
---|
[551] | 60 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
| 61 | MPFROMSHORT(attribute));
|
---|
[2] | 62 | }
|
---|
[748] | 63 | while (pci && (INT)pci != -1) {
|
---|
[551] | 64 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 65 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[362] | 66 | if (!all)
|
---|
[690] | 67 | break;
|
---|
[618] | 68 | // Count is one extra to ensure non-zero elsewhere
|
---|
[672] | 69 | // x is 0 based index
|
---|
| 70 | if (x + 2 == ulItemsToUnHilite)
|
---|
[690] | 71 | break;
|
---|
[362] | 72 | if (list)
|
---|
[730] | 73 | AddToList(pci->pszFileName, list, &numfiles, &numalloc);
|
---|
[551] | 74 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
|
---|
| 75 | MPFROMP(pci), MPFROMSHORT(CRA_SELECTED));
|
---|
[603] | 76 | x++;
|
---|
[2] | 77 | }
|
---|
| 78 | }
|
---|
| 79 | }
|
---|
| 80 |
|
---|
[551] | 81 | VOID SelectList(HWND hwndCnr, BOOL partial, BOOL deselect, BOOL clearfirst,
|
---|
[748] | 82 | PCNRITEM pciParent, PSZ filename, CHAR ** list)
|
---|
[362] | 83 | {
|
---|
[2] | 84 |
|
---|
[551] | 85 | PCNRITEM pci;
|
---|
[2] | 86 | register INT x;
|
---|
[551] | 87 | BOOL foundone = FALSE;
|
---|
| 88 | ULONG errs = 0L;
|
---|
[2] | 89 |
|
---|
[362] | 90 | if (clearfirst && !deselect)
|
---|
[672] | 91 | UnHilite(hwndCnr, TRUE, NULL, 0);
|
---|
[362] | 92 | if (list && list[0]) {
|
---|
[551] | 93 | for (x = 0; list[x]; x++) {
|
---|
[2] | 94 | pci = FindCnrRecord(hwndCnr,
|
---|
[551] | 95 | list[x], pciParent, partial, partial, TRUE);
|
---|
[362] | 96 | if (pci) {
|
---|
[551] | 97 | WinSendMsg(hwndCnr,
|
---|
| 98 | CM_SETRECORDEMPHASIS,
|
---|
| 99 | MPFROMP(pci),
|
---|
| 100 | MPFROM2SHORT((SHORT) ((deselect) ? FALSE : TRUE),
|
---|
| 101 | CRA_SELECTED));
|
---|
| 102 | foundone = TRUE;
|
---|
[2] | 103 | }
|
---|
| 104 | }
|
---|
[362] | 105 | if (!foundone)
|
---|
| 106 | Runtime_Error(pszSrcFile, __LINE__, "select failed");
|
---|
[2] | 107 | }
|
---|
[362] | 108 | else if (filename && *filename) {
|
---|
[2] | 109 |
|
---|
| 110 | FILE *fp;
|
---|
[551] | 111 | CHAR input[1024], *p;
|
---|
[2] | 112 |
|
---|
[551] | 113 | fp = _fsopen(filename, "r", SH_DENYNO);
|
---|
[362] | 114 | if (fp) {
|
---|
| 115 | while (!feof(fp)) {
|
---|
[551] | 116 | if (!xfgets_bstripcr(input, sizeof(input), fp, pszSrcFile, __LINE__))
|
---|
| 117 | break;
|
---|
| 118 | if (*input == '\"') {
|
---|
| 119 | memmove(input, input + 1, strlen(input) + 1);
|
---|
| 120 | lstrip(input);
|
---|
| 121 | p = strchr(input, '\"');
|
---|
| 122 | if (p)
|
---|
| 123 | *p = 0;
|
---|
| 124 | rstrip(input);
|
---|
| 125 | }
|
---|
| 126 | else {
|
---|
| 127 | p = strchr(input, ' ');
|
---|
| 128 | if (p)
|
---|
| 129 | *p = 0;
|
---|
| 130 | }
|
---|
| 131 | /* input now contains name of file to select */
|
---|
| 132 | pci = FindCnrRecord(hwndCnr,
|
---|
| 133 | input, pciParent, partial, partial, TRUE);
|
---|
| 134 | if (pci) /* found it? */
|
---|
| 135 | WinSendMsg(hwndCnr,
|
---|
| 136 | CM_SETRECORDEMPHASIS,
|
---|
| 137 | MPFROMP(pci),
|
---|
| 138 | MPFROM2SHORT((SHORT) ((deselect) ? FALSE : TRUE),
|
---|
| 139 | CRA_SELECTED));
|
---|
| 140 | else
|
---|
| 141 | errs++;
|
---|
| 142 | if (errs > 50L) { /* prevent runaway on bad file */
|
---|
[2] | 143 |
|
---|
[551] | 144 | APIRET ret;
|
---|
[2] | 145 |
|
---|
[551] | 146 | ret = saymsg(MB_YESNO,
|
---|
| 147 | hwndCnr,
|
---|
| 148 | GetPString(IDS_POSSIBLEERRORTEXT),
|
---|
| 149 | GetPString(IDS_MAYNOTBELISTTEXT), filename);
|
---|
| 150 | if (ret == MBID_NO)
|
---|
| 151 | break;
|
---|
| 152 | errs = 0L;
|
---|
| 153 | }
|
---|
[2] | 154 | }
|
---|
| 155 | fclose(fp);
|
---|
| 156 | }
|
---|
| 157 | }
|
---|
| 158 | }
|
---|
| 159 |
|
---|
[748] | 160 | VOID SelectAll(HWND hwndCnr, BOOL files, BOOL dirs, PSZ maskstr,
|
---|
| 161 | PSZ text, BOOL is_arc)
|
---|
[362] | 162 | {
|
---|
[2] | 163 |
|
---|
[551] | 164 | PCNRITEM pci;
|
---|
| 165 | BOOL markit;
|
---|
[748] | 166 | PSZ file;
|
---|
| 167 | PSZ pszToMatch;
|
---|
[551] | 168 | MASK Mask;
|
---|
[748] | 169 | INT x;
|
---|
[551] | 170 | ULONG textlen = 0;
|
---|
[2] | 171 |
|
---|
[362] | 172 | if (text)
|
---|
[2] | 173 | textlen = strlen(text);
|
---|
[551] | 174 | memset(&Mask, 0, sizeof(Mask));
|
---|
[442] | 175 | if (maskstr)
|
---|
[551] | 176 | SetMask(maskstr, &Mask);
|
---|
| 177 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
|
---|
| 178 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[748] | 179 | while (pci && (INT)pci != -1) {
|
---|
| 180 |
|
---|
[2] | 181 | markit = FALSE;
|
---|
[748] | 182 |
|
---|
| 183 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
[362] | 184 | if (!is_arc) {
|
---|
[748] | 185 | if (files && ~pci->attrFile & FILE_DIRECTORY)
|
---|
[551] | 186 | markit = TRUE;
|
---|
[748] | 187 | if (dirs && pci->attrFile & FILE_DIRECTORY)
|
---|
[551] | 188 | markit = TRUE;
|
---|
[2] | 189 | }
|
---|
| 190 | else
|
---|
[551] | 191 | markit = TRUE;
|
---|
[442] | 192 | if (maskstr && *maskstr && markit) {
|
---|
[551] | 193 | markit = FALSE;
|
---|
[748] | 194 | // Point a filename part
|
---|
[730] | 195 | file = strrchr(pci->pszFileName, '\\');
|
---|
[551] | 196 | if (!file)
|
---|
[730] | 197 | file = strrchr(pci->pszFileName, ':');
|
---|
[551] | 198 | if (file)
|
---|
| 199 | file++;
|
---|
| 200 | else
|
---|
[730] | 201 | file = pci->pszFileName;
|
---|
[551] | 202 | for (x = 0; Mask.pszMasks[x]; x++) {
|
---|
| 203 | if (*Mask.pszMasks[x]) {
|
---|
[748] | 204 | if ((strchr(Mask.pszMasks[x], '\\') ||
|
---|
| 205 | strchr(Mask.pszMasks[x], ':')))
|
---|
| 206 | pszToMatch = pci->pszFileName;
|
---|
| 207 | else
|
---|
| 208 | pszToMatch = file;
|
---|
[551] | 209 | if (*Mask.pszMasks[x] != '/') {
|
---|
[748] | 210 | if (wildcard(pszToMatch, Mask.pszMasks[x], FALSE)) {
|
---|
[551] | 211 | markit = TRUE;
|
---|
[690] | 212 | }
|
---|
[551] | 213 | }
|
---|
| 214 | else {
|
---|
[748] | 215 | if (wildcard(pszToMatch, Mask.pszMasks[x] + 1, FALSE)) {
|
---|
[551] | 216 | markit = FALSE;
|
---|
| 217 | break;
|
---|
| 218 | }
|
---|
| 219 | }
|
---|
| 220 | }
|
---|
[690] | 221 | } // for
|
---|
[2] | 222 | }
|
---|
| 223 | }
|
---|
| 224 |
|
---|
[748] | 225 | if (markit && text && *text) {
|
---|
| 226 | if (~pci->attrFile & FILE_DIRECTORY) {
|
---|
| 227 | PSZ input;
|
---|
| 228 | markit = FALSE;
|
---|
| 229 | input = xmalloc(65537, pszSrcFile, __LINE__);
|
---|
| 230 | if (input) {
|
---|
| 231 | ULONG pos;
|
---|
| 232 | LONG len;
|
---|
| 233 | FILE *inputFile;
|
---|
[2] | 234 |
|
---|
[748] | 235 | if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
|
---|
| 236 | pos = ftell(inputFile);
|
---|
| 237 | while (!feof(inputFile)) {
|
---|
| 238 | if (pos)
|
---|
| 239 | fseek(inputFile, pos - 256, SEEK_SET);
|
---|
| 240 | len = fread(input, 1, 65536, inputFile);
|
---|
| 241 | if (len >= 0) {
|
---|
| 242 | if (findstring(text, textlen, input, len, FALSE)) {
|
---|
| 243 | markit = TRUE;
|
---|
| 244 | break;
|
---|
| 245 | }
|
---|
| 246 | }
|
---|
| 247 | else
|
---|
[551] | 248 | break;
|
---|
| 249 | }
|
---|
[748] | 250 | fclose(inputFile);
|
---|
[551] | 251 | }
|
---|
[748] | 252 | free(input);
|
---|
| 253 | DosSleep(1L);
|
---|
[551] | 254 | }
|
---|
[2] | 255 | }
|
---|
[748] | 256 | else
|
---|
| 257 | markit = FALSE;
|
---|
[2] | 258 | }
|
---|
[748] | 259 |
|
---|
[362] | 260 | if (markit)
|
---|
[551] | 261 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 262 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 263 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
| 264 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
| 265 | } // while
|
---|
[2] | 266 | }
|
---|
| 267 |
|
---|
[748] | 268 | VOID DeselectAll(HWND hwndCnr, BOOL files, BOOL dirs, PSZ maskstr,
|
---|
| 269 | PSZ text, BOOL is_arc)
|
---|
[362] | 270 | {
|
---|
[551] | 271 | PCNRITEM pci;
|
---|
| 272 | BOOL unmarkit;
|
---|
[748] | 273 | PSZ file;
|
---|
| 274 | PSZ pszToMatch;
|
---|
[551] | 275 | MASK Mask;
|
---|
| 276 | register INT x;
|
---|
| 277 | ULONG textlen = 0;
|
---|
[2] | 278 |
|
---|
[362] | 279 | if (text)
|
---|
[2] | 280 | textlen = strlen(text);
|
---|
[551] | 281 | memset(&Mask, 0, sizeof(Mask));
|
---|
[442] | 282 | if (maskstr && *maskstr)
|
---|
[551] | 283 | SetMask(maskstr, &Mask);
|
---|
| 284 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
|
---|
| 285 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[748] | 286 | while (pci && (INT)pci != -1) {
|
---|
[2] | 287 | unmarkit = FALSE;
|
---|
[748] | 288 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
[362] | 289 | if (!is_arc) {
|
---|
[748] | 290 | if (files && ~pci->attrFile & FILE_DIRECTORY)
|
---|
[551] | 291 | unmarkit = TRUE;
|
---|
| 292 | if (dirs && (pci->attrFile & FILE_DIRECTORY))
|
---|
| 293 | unmarkit = TRUE;
|
---|
[2] | 294 | }
|
---|
| 295 | else
|
---|
[551] | 296 | unmarkit = TRUE;
|
---|
[442] | 297 | if (maskstr && *maskstr && unmarkit) {
|
---|
[551] | 298 | unmarkit = FALSE;
|
---|
[730] | 299 | file = strrchr(pci->pszFileName, '\\');
|
---|
[551] | 300 | if (!file)
|
---|
[730] | 301 | file = strrchr(pci->pszFileName, ':');
|
---|
[551] | 302 | if (file)
|
---|
| 303 | file++;
|
---|
| 304 | else
|
---|
[730] | 305 | file = pci->pszFileName;
|
---|
[551] | 306 | for (x = 0; Mask.pszMasks[x]; x++) {
|
---|
| 307 | if (*Mask.pszMasks[x]) {
|
---|
[748] | 308 | if (strchr(Mask.pszMasks[x], '\\') ||
|
---|
| 309 | strchr(Mask.pszMasks[x], ':'))
|
---|
| 310 | pszToMatch = pci->pszFileName;
|
---|
| 311 | else
|
---|
| 312 | pszToMatch = file;
|
---|
[551] | 313 | if (*Mask.pszMasks[x] != '/') {
|
---|
[748] | 314 | if (wildcard(pszToMatch, Mask.pszMasks[x], FALSE))
|
---|
[551] | 315 | unmarkit = TRUE;
|
---|
| 316 | }
|
---|
| 317 | else {
|
---|
[748] | 318 | if (wildcard(pszToMatch, Mask.pszMasks[x] + 1, FALSE)) {
|
---|
[551] | 319 | unmarkit = FALSE;
|
---|
| 320 | break;
|
---|
| 321 | }
|
---|
| 322 | }
|
---|
| 323 | }
|
---|
| 324 | }
|
---|
[2] | 325 | }
|
---|
| 326 | }
|
---|
| 327 |
|
---|
[748] | 328 | if (unmarkit && text && *text) {
|
---|
| 329 | if (~pci->attrFile & FILE_DIRECTORY) {
|
---|
| 330 | PSZ input;
|
---|
| 331 | unmarkit = FALSE;
|
---|
| 332 | input = xmalloc(65537, pszSrcFile, __LINE__);
|
---|
| 333 | if (input) {
|
---|
| 334 | ULONG pos;
|
---|
| 335 | LONG len;
|
---|
| 336 | FILE *inputFile;
|
---|
[2] | 337 |
|
---|
[748] | 338 | if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
|
---|
| 339 | pos = ftell(inputFile);
|
---|
| 340 | while (!feof(inputFile)) {
|
---|
| 341 | if (pos)
|
---|
| 342 | fseek(inputFile, pos - 256, SEEK_SET);
|
---|
| 343 | len = fread(input, 1, 65536, inputFile);
|
---|
| 344 | if (len >= 0) {
|
---|
| 345 | if (findstring(text, textlen, input, len, FALSE)) {
|
---|
| 346 | unmarkit = TRUE;
|
---|
| 347 | break;
|
---|
| 348 | }
|
---|
| 349 | }
|
---|
| 350 | else
|
---|
[551] | 351 | break;
|
---|
| 352 | }
|
---|
[748] | 353 | fclose(inputFile);
|
---|
[551] | 354 | }
|
---|
[748] | 355 | free(input);
|
---|
| 356 | DosSleep(1L);
|
---|
[551] | 357 | }
|
---|
[2] | 358 | }
|
---|
[748] | 359 | else
|
---|
| 360 | unmarkit = FALSE;
|
---|
[2] | 361 | }
|
---|
[748] | 362 |
|
---|
[362] | 363 | if (unmarkit)
|
---|
[551] | 364 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, pci,
|
---|
| 365 | MPFROM2SHORT(FALSE, CRA_SELECTED | CRA_CURSORED |
|
---|
| 366 | CRA_INUSE | CRA_SOURCE));
|
---|
| 367 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
| 368 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[2] | 369 | }
|
---|
| 370 | }
|
---|
| 371 |
|
---|
[551] | 372 | VOID Deselect(HWND hwndCnr)
|
---|
[317] | 373 | {
|
---|
[2] | 374 | PCNRITEM pcil;
|
---|
| 375 |
|
---|
[551] | 376 | pcil = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
|
---|
| 377 | MPFROMLONG(CMA_FIRST),
|
---|
| 378 | MPFROMSHORT(CRA_SELECTED));
|
---|
[748] | 379 | while (pcil && (INT)pcil != -1) {
|
---|
[551] | 380 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pcil),
|
---|
| 381 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 382 | pcil = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pcil),
|
---|
| 383 | MPFROMSHORT(CRA_SELECTED));
|
---|
[2] | 384 | }
|
---|
| 385 | }
|
---|
| 386 |
|
---|
[317] | 387 | //=== HideAll() Hide all selected records ===
|
---|
[2] | 388 |
|
---|
[551] | 389 | VOID HideAll(HWND hwndCnr)
|
---|
[317] | 390 | {
|
---|
[551] | 391 | PCNRITEM pci, pciH;
|
---|
| 392 | INT attribute = CRA_CURSORED;
|
---|
| 393 | CNRINFO cnri;
|
---|
| 394 | BOOL didone = FALSE;
|
---|
[2] | 395 |
|
---|
[551] | 396 | memset(&cnri, 0, sizeof(CNRINFO));
|
---|
[2] | 397 | cnri.cb = sizeof(CNRINFO);
|
---|
[551] | 398 | WinSendMsg(hwndCnr, CM_QUERYCNRINFO, MPFROMP(&cnri),
|
---|
| 399 | MPFROMLONG(sizeof(CNRINFO)));
|
---|
| 400 | pci = (PCNRITEM) CurrentRecord(hwndCnr);
|
---|
[748] | 401 | if (pci && (INT)pci != -1) {
|
---|
[362] | 402 | if (pci->rc.flRecordAttr & CRA_SELECTED) {
|
---|
[2] | 403 | attribute = CRA_SELECTED;
|
---|
[551] | 404 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
| 405 | MPFROMSHORT(attribute));
|
---|
[2] | 406 | }
|
---|
| 407 | }
|
---|
[748] | 408 | while (pci && (INT)pci != -1) {
|
---|
[551] | 409 | pciH = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 410 | MPFROMSHORT(attribute));
|
---|
| 411 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 412 | MPFROM2SHORT(FALSE, CRA_CURSORED | CRA_SELECTED |
|
---|
| 413 | CRA_INUSE | CRA_SOURCE));
|
---|
[2] | 414 | pci->rc.flRecordAttr |= CRA_FILTERED;
|
---|
| 415 | didone = TRUE;
|
---|
[362] | 416 | if (fSyncUpdates) {
|
---|
| 417 | if (cnri.flWindowAttr & CV_DETAIL)
|
---|
[551] | 418 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
|
---|
| 419 | MPFROM2SHORT(0, CMA_REPOSITION | CMA_ERASE));
|
---|
[2] | 420 | else
|
---|
[551] | 421 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPFROMP(&pci),
|
---|
| 422 | MPFROM2SHORT(1, CMA_REPOSITION | CMA_ERASE));
|
---|
[2] | 423 | }
|
---|
| 424 | pci = pciH;
|
---|
| 425 | }
|
---|
[362] | 426 | if (didone && !fSyncUpdates)
|
---|
[551] | 427 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
|
---|
| 428 | MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION));
|
---|
[2] | 429 | }
|
---|
| 430 |
|
---|
[551] | 431 | VOID MarkAll(HWND hwndCnr, BOOL quitit, BOOL target, BOOL source)
|
---|
[317] | 432 | {
|
---|
[2] | 433 | PCNRITEM pci;
|
---|
[551] | 434 | INT attribute = CRA_CURSORED;
|
---|
[2] | 435 |
|
---|
[362] | 436 | if (quitit)
|
---|
[618] | 437 | attribute = target ? CRA_TARGET : source ? CRA_SOURCE : CRA_INUSE;
|
---|
[551] | 438 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
|
---|
| 439 | MPFROMLONG(CMA_FIRST), MPFROMSHORT(attribute));
|
---|
[748] | 440 | if (pci && (INT)pci != -1) {
|
---|
[362] | 441 | if (attribute == CRA_CURSORED) {
|
---|
| 442 | if (pci->rc.flRecordAttr & CRA_SELECTED) {
|
---|
[551] | 443 | attribute = CRA_SELECTED;
|
---|
| 444 | pci =
|
---|
| 445 | WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
| 446 | MPFROMSHORT(attribute));
|
---|
[2] | 447 | }
|
---|
| 448 | }
|
---|
| 449 | }
|
---|
[748] | 450 | while (pci && (INT)pci != -1) {
|
---|
[551] | 451 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 452 | MPFROM2SHORT(!quitit,
|
---|
[618] | 453 | target ? CRA_TARGET : source ? CRA_SOURCE :
|
---|
| 454 | CRA_INUSE));
|
---|
[551] | 455 | pci =
|
---|
| 456 | WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 457 | MPFROMSHORT(attribute));
|
---|
[2] | 458 | }
|
---|
| 459 | }
|
---|
| 460 |
|
---|
[551] | 461 | VOID RemoveAll(HWND hwndCnr, ULONGLONG * pullTotalBytes,
|
---|
| 462 | ULONG * pulTotalFiles)
|
---|
[317] | 463 | {
|
---|
[2] | 464 | PCNRITEM pci;
|
---|
[551] | 465 | INT attribute = CRA_CURSORED;
|
---|
| 466 | BOOL didone = FALSE;
|
---|
[2] | 467 |
|
---|
[551] | 468 | pci = (PCNRITEM) CurrentRecord(hwndCnr);
|
---|
[748] | 469 | if (pci && (INT)pci != -1) {
|
---|
[362] | 470 | if (pci->rc.flRecordAttr & CRA_SELECTED) {
|
---|
[2] | 471 | attribute = CRA_SELECTED;
|
---|
[551] | 472 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
| 473 | MPFROMSHORT(attribute));
|
---|
[2] | 474 | }
|
---|
| 475 | }
|
---|
[748] | 476 | while (pci && (INT)pci != -1) {
|
---|
| 477 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
[2] | 478 | didone = TRUE;
|
---|
[158] | 479 | if (pulTotalFiles)
|
---|
[689] | 480 | *pulTotalFiles -= 1;
|
---|
[158] | 481 | if (pullTotalBytes)
|
---|
[551] | 482 | *pullTotalBytes -= (pci->cbFile + pci->easize);
|
---|
| 483 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 484 | MPFROM2SHORT(0, CRA_SELECTED));
|
---|
[362] | 485 | if (fSyncUpdates)
|
---|
[551] | 486 | WinSendMsg(hwndCnr, CM_REMOVERECORD, MPFROMP(&pci),
|
---|
| 487 | MPFROM2SHORT(1, CMA_FREE | CMA_INVALIDATE));
|
---|
[2] | 488 | else
|
---|
[551] | 489 | WinSendMsg(hwndCnr, CM_REMOVERECORD, MPFROMP(&pci),
|
---|
| 490 | MPFROM2SHORT(1, CMA_FREE));
|
---|
[362] | 491 | if (attribute == CRA_CURSORED)
|
---|
[551] | 492 | break;
|
---|
| 493 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
| 494 | MPFROMSHORT(attribute));
|
---|
[2] | 495 | }
|
---|
| 496 | else
|
---|
[551] | 497 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 498 | MPFROMSHORT(attribute));
|
---|
[2] | 499 | }
|
---|
[362] | 500 | if (didone && !fSyncUpdates)
|
---|
[551] | 501 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
|
---|
| 502 | MPFROM2SHORT(0, CMA_REPOSITION));
|
---|
[2] | 503 | }
|
---|
| 504 |
|
---|
[442] | 505 | //== SetMask() Convert mask string to array of pointers to masks ==
|
---|
| 506 |
|
---|
[551] | 507 | VOID SetMask(PSZ maskstr, MASK * mask)
|
---|
[317] | 508 | {
|
---|
[442] | 509 | UINT x;
|
---|
| 510 | PSZ p;
|
---|
[2] | 511 |
|
---|
[442] | 512 | if (maskstr)
|
---|
[551] | 513 | strcpy(mask->szMask, maskstr); // Got new mask string
|
---|
[442] | 514 | // Build array of pointers
|
---|
| 515 | p = mask->szMaskCopy;
|
---|
[551] | 516 | strcpy(p, mask->szMask);
|
---|
[442] | 517 | // Allow up to 25 masks - ignore extras
|
---|
| 518 | for (x = 0; *p && x < 25; x++) {
|
---|
| 519 | mask->pszMasks[x] = p;
|
---|
[362] | 520 | while (*p && *p != ';')
|
---|
[442] | 521 | p++; // Find separator
|
---|
[362] | 522 | if (*p) {
|
---|
[442] | 523 | *p = 0; // Replace ;
|
---|
[2] | 524 | p++;
|
---|
| 525 | }
|
---|
[551] | 526 | } // for
|
---|
[442] | 527 | mask->pszMasks[x] = NULL; // Mark end
|
---|
[2] | 528 | }
|
---|
| 529 |
|
---|
[551] | 530 | VOID ExpandAll(HWND hwndCnr, BOOL expand, PCNRITEM pciParent)
|
---|
[317] | 531 | {
|
---|
[2] | 532 | PCNRITEM pci;
|
---|
| 533 |
|
---|
[362] | 534 | if (!pciParent)
|
---|
[551] | 535 | pciParent = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(NULL),
|
---|
| 536 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[362] | 537 | if (pciParent) {
|
---|
[748] | 538 | if (expand && ~pciParent->rc.flRecordAttr & CRA_EXPANDED)
|
---|
[551] | 539 | WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciParent), MPVOID);
|
---|
[362] | 540 | else if (!expand && (pciParent->rc.flRecordAttr & CRA_EXPANDED))
|
---|
[551] | 541 | WinSendMsg(hwndCnr, CM_COLLAPSETREE, MPFROMP(pciParent), MPVOID);
|
---|
| 542 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pciParent),
|
---|
| 543 | MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
|
---|
[362] | 544 | if (pci)
|
---|
[2] | 545 | DosSleep(1L);
|
---|
[748] | 546 | while (pci && (INT)pci != -1) {
|
---|
[551] | 547 | ExpandAll(hwndCnr, expand, pci);
|
---|
| 548 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
| 549 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[2] | 550 | }
|
---|
| 551 | }
|
---|
[748] | 552 | DosSleep(1);
|
---|
[2] | 553 | }
|
---|
| 554 |
|
---|
[551] | 555 | VOID InvertAll(HWND hwndCnr)
|
---|
[317] | 556 | {
|
---|
[2] | 557 | PCNRITEM pci;
|
---|
| 558 |
|
---|
[551] | 559 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
|
---|
| 560 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[748] | 561 | while (pci && (INT)pci != -1) {
|
---|
| 562 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
| 563 | if (~pci->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 564 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 565 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 566 | else
|
---|
[551] | 567 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 568 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 569 | }
|
---|
[551] | 570 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
| 571 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[2] | 572 | }
|
---|
| 573 | }
|
---|
| 574 |
|
---|
[204] | 575 | #pragma alloc_text (SELECT3,SpecialSelect)
|
---|
[2] | 576 | #pragma alloc_text(SELECT4,FreeCnrs,SpecialSelect2,CompSSNames,CompSSNamesB)
|
---|
| 577 |
|
---|
[551] | 578 | VOID SpecialSelect(HWND hwndCnrS, HWND hwndCnrD, INT action, BOOL reset)
|
---|
[317] | 579 | {
|
---|
[551] | 580 | PCNRITEM pciS, pciD, *pciSa = NULL, *pciDa = NULL;
|
---|
| 581 | CNRINFO cnri;
|
---|
| 582 | BOOL slow = FALSE;
|
---|
| 583 | register INT x, numD, numS;
|
---|
[2] | 584 |
|
---|
[606] | 585 |
|
---|
[362] | 586 | if (!hwndCnrS || !hwndCnrD)
|
---|
[2] | 587 | return;
|
---|
| 588 |
|
---|
[551] | 589 | memset(&cnri, 0, sizeof(CNRINFO));
|
---|
[2] | 590 | cnri.cb = sizeof(CNRINFO);
|
---|
[551] | 591 | WinSendMsg(hwndCnrD, CM_QUERYCNRINFO, MPFROMP(&cnri),
|
---|
| 592 | MPFROMLONG(sizeof(CNRINFO)));
|
---|
| 593 | numD = (INT) cnri.cRecords;
|
---|
| 594 | memset(&cnri, 0, sizeof(CNRINFO));
|
---|
[2] | 595 | cnri.cb = sizeof(CNRINFO);
|
---|
[551] | 596 | WinSendMsg(hwndCnrS, CM_QUERYCNRINFO, MPFROMP(&cnri),
|
---|
| 597 | MPFROMLONG(sizeof(CNRINFO)));
|
---|
| 598 | numS = (INT) cnri.cRecords;
|
---|
[362] | 599 | if (!numD || numS != numD) {
|
---|
[2] | 600 | saymsg(MB_ENTER,
|
---|
[551] | 601 | HWND_DESKTOP,
|
---|
| 602 | DEBUG_STRING, "numD (%lu) != numS (%lu)", numD, numS);
|
---|
[2] | 603 | return;
|
---|
| 604 | }
|
---|
[551] | 605 | pciDa = xmalloc(sizeof(PCNRITEM) * numD, pszSrcFile, __LINE__);
|
---|
[362] | 606 | if (!pciDa)
|
---|
[2] | 607 | return;
|
---|
| 608 |
|
---|
[551] | 609 | pciSa = xmalloc(sizeof(PCNRITEM) * numS, pszSrcFile, __LINE__);
|
---|
[362] | 610 | if (!pciSa) {
|
---|
| 611 | free(pciDa);
|
---|
[2] | 612 | return;
|
---|
| 613 | }
|
---|
| 614 |
|
---|
| 615 | Restart:
|
---|
| 616 |
|
---|
[551] | 617 | memset(pciDa, 0, sizeof(PCNRITEM) * numD);
|
---|
| 618 | memset(pciSa, 0, sizeof(PCNRITEM) * numS);
|
---|
[2] | 619 |
|
---|
[551] | 620 | pciD = (PCNRITEM) WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPVOID,
|
---|
| 621 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[2] | 622 | x = 0;
|
---|
[748] | 623 | while (pciD && (INT)pciD != -1 && x < numD) {
|
---|
[362] | 624 | if (reset)
|
---|
[2] | 625 | pciD->flags = 0;
|
---|
| 626 | pciDa[x] = pciD;
|
---|
| 627 | x++;
|
---|
[362] | 628 | if (!slow)
|
---|
[551] | 629 | pciD = (PCNRITEM) pciD->rc.preccNextRecord;
|
---|
[2] | 630 | else
|
---|
[551] | 631 | pciD = (PCNRITEM) WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPFROMP(pciD),
|
---|
| 632 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[362] | 633 | if (!(x % 500))
|
---|
[2] | 634 | DosSleep(1L);
|
---|
[362] | 635 | else if (!(x % 50))
|
---|
[748] | 636 | DosSleep(1);
|
---|
[2] | 637 | }
|
---|
[362] | 638 | if (numD != x) {
|
---|
| 639 | if (!slow) {
|
---|
[2] | 640 | slow = TRUE;
|
---|
| 641 | goto Restart;
|
---|
| 642 | }
|
---|
| 643 | free(pciDa);
|
---|
| 644 | free(pciSa);
|
---|
| 645 | saymsg(MB_ENTER,
|
---|
[551] | 646 | HWND_DESKTOP, DEBUG_STRING, "numD (%lu) != x (%lu)", numD, x);
|
---|
[2] | 647 | return;
|
---|
| 648 | }
|
---|
| 649 |
|
---|
[551] | 650 | pciS = (PCNRITEM) WinSendMsg(hwndCnrS, CM_QUERYRECORD, MPVOID,
|
---|
| 651 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[2] | 652 | x = 0;
|
---|
[748] | 653 | while (pciS && (INT)pciS != -1 && x < numS) {
|
---|
[362] | 654 | if (reset)
|
---|
[2] | 655 | pciS->flags = 0;
|
---|
| 656 | pciSa[x] = pciS;
|
---|
| 657 | x++;
|
---|
[362] | 658 | if (!slow)
|
---|
[551] | 659 | pciS = (PCNRITEM) pciS->rc.preccNextRecord;
|
---|
[2] | 660 | else
|
---|
[551] | 661 | pciS = (PCNRITEM) WinSendMsg(hwndCnrS, CM_QUERYRECORD, MPFROMP(pciS),
|
---|
| 662 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[362] | 663 | if (!(x % 500))
|
---|
[2] | 664 | DosSleep(1L);
|
---|
[362] | 665 | else if (!(x % 50))
|
---|
[748] | 666 | DosSleep(1);
|
---|
[2] | 667 | }
|
---|
[362] | 668 | if (numS != x) {
|
---|
| 669 | if (!slow) {
|
---|
[2] | 670 | slow = TRUE;
|
---|
| 671 | goto Restart;
|
---|
| 672 | }
|
---|
| 673 | free(pciSa);
|
---|
| 674 | free(pciDa);
|
---|
[551] | 675 | Runtime_Error(pszSrcFile, __LINE__, "numS (%lu) != x (%lu)", numS, x);
|
---|
[2] | 676 | return;
|
---|
| 677 | }
|
---|
| 678 |
|
---|
[362] | 679 | if (reset) {
|
---|
[551] | 680 | for (x = 0; x < numS; x++) {
|
---|
[748] | 681 |
|
---|
[730] | 682 | if (!*pciSa[x]->pszFileName || !*pciDa[x]->pszFileName)
|
---|
[551] | 683 | continue;
|
---|
[748] | 684 |
|
---|
[2] | 685 | pciSa[x]->flags |= CNRITEM_EXISTS;
|
---|
| 686 | pciDa[x]->flags |= CNRITEM_EXISTS;
|
---|
[362] | 687 | if (pciSa[x]->cbFile + pciSa[x]->easize >
|
---|
[551] | 688 | pciDa[x]->cbFile + pciDa[x]->easize) {
|
---|
| 689 | pciSa[x]->flags |= CNRITEM_LARGER;
|
---|
| 690 | pciDa[x]->flags |= CNRITEM_SMALLER;
|
---|
[2] | 691 | }
|
---|
[362] | 692 | else if (pciSa[x]->cbFile + pciSa[x]->easize <
|
---|
[551] | 693 | pciDa[x]->cbFile + pciDa[x]->easize) {
|
---|
| 694 | pciSa[x]->flags |= CNRITEM_SMALLER;
|
---|
| 695 | pciDa[x]->flags |= CNRITEM_LARGER;
|
---|
[2] | 696 | }
|
---|
[362] | 697 | if ((pciSa[x]->date.year > pciDa[x]->date.year) ? TRUE :
|
---|
[551] | 698 | (pciSa[x]->date.year < pciDa[x]->date.year) ? FALSE :
|
---|
| 699 | (pciSa[x]->date.month > pciDa[x]->date.month) ? TRUE :
|
---|
| 700 | (pciSa[x]->date.month < pciDa[x]->date.month) ? FALSE :
|
---|
| 701 | (pciSa[x]->date.day > pciDa[x]->date.day) ? TRUE :
|
---|
| 702 | (pciSa[x]->date.day < pciDa[x]->date.day) ? FALSE :
|
---|
| 703 | (pciSa[x]->time.hours > pciDa[x]->time.hours) ? TRUE :
|
---|
| 704 | (pciSa[x]->time.hours < pciDa[x]->time.hours) ? FALSE :
|
---|
| 705 | (pciSa[x]->time.minutes > pciDa[x]->time.minutes) ? TRUE :
|
---|
| 706 | (pciSa[x]->time.minutes < pciDa[x]->time.minutes) ? FALSE :
|
---|
| 707 | (pciSa[x]->time.seconds > pciDa[x]->time.seconds) ? TRUE :
|
---|
| 708 | (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? FALSE : FALSE) {
|
---|
| 709 | pciSa[x]->flags |= CNRITEM_NEWER;
|
---|
| 710 | pciDa[x]->flags |= CNRITEM_OLDER;
|
---|
[2] | 711 | }
|
---|
[362] | 712 | else if ((pciSa[x]->date.year < pciDa[x]->date.year) ? TRUE :
|
---|
[551] | 713 | (pciSa[x]->date.year > pciDa[x]->date.year) ? FALSE :
|
---|
| 714 | (pciSa[x]->date.month < pciDa[x]->date.month) ? TRUE :
|
---|
| 715 | (pciSa[x]->date.month > pciDa[x]->date.month) ? FALSE :
|
---|
| 716 | (pciSa[x]->date.day < pciDa[x]->date.day) ? TRUE :
|
---|
| 717 | (pciSa[x]->date.day > pciDa[x]->date.day) ? FALSE :
|
---|
| 718 | (pciSa[x]->time.hours < pciDa[x]->time.hours) ? TRUE :
|
---|
| 719 | (pciSa[x]->time.hours > pciDa[x]->time.hours) ? FALSE :
|
---|
| 720 | (pciSa[x]->time.minutes < pciDa[x]->time.minutes) ? TRUE :
|
---|
| 721 | (pciSa[x]->time.minutes > pciDa[x]->time.minutes) ? FALSE :
|
---|
| 722 | (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? TRUE :
|
---|
| 723 | (pciSa[x]->time.seconds > pciDa[x]->time.seconds) ? FALSE :
|
---|
| 724 | FALSE) {
|
---|
| 725 | pciSa[x]->flags |= CNRITEM_OLDER;
|
---|
| 726 | pciDa[x]->flags |= CNRITEM_NEWER;
|
---|
[2] | 727 | }
|
---|
[362] | 728 | if (!(x % 500))
|
---|
[551] | 729 | DosSleep(1L);
|
---|
[362] | 730 | else if (!(x % 50))
|
---|
[748] | 731 | DosSleep(1);
|
---|
[2] | 732 | }
|
---|
| 733 | }
|
---|
| 734 |
|
---|
[551] | 735 | switch (action) {
|
---|
| 736 | case IDM_SELECTIDENTICAL:
|
---|
| 737 | for (x = 0; x < numS; x++) {
|
---|
[748] | 738 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
|
---|
[730] | 739 | if (*pciSa[x]->pszFileName &&
|
---|
[748] | 740 | pciSa[x]->flags & CNRITEM_EXISTS &&
|
---|
| 741 | ~pciSa[x]->flags & CNRITEM_SMALLER &&
|
---|
| 742 | ~pciSa[x]->flags & CNRITEM_LARGER &&
|
---|
| 743 | ~pciSa[x]->flags & CNRITEM_NEWER &&
|
---|
| 744 | ~pciSa[x]->flags & CNRITEM_OLDER) {
|
---|
| 745 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 746 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 747 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[748] | 748 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 749 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 750 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 751 | }
|
---|
| 752 | if (!(x % 500))
|
---|
| 753 | DosSleep(1L);
|
---|
| 754 | else if (!(x % 50))
|
---|
[748] | 755 | DosSleep(1);
|
---|
[2] | 756 | }
|
---|
[551] | 757 | }
|
---|
| 758 | break;
|
---|
[2] | 759 |
|
---|
[551] | 760 | case IDM_SELECTSAME:
|
---|
| 761 | for (x = 0; x < numS; x++) {
|
---|
[748] | 762 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
[730] | 763 | *pciSa[x]->pszFileName &&
|
---|
[748] | 764 | pciSa[x]->flags & CNRITEM_EXISTS &&
|
---|
| 765 | ~pciSa[x]->flags & CNRITEM_SMALLER &&
|
---|
| 766 | ~pciSa[x]->flags & CNRITEM_LARGER) {
|
---|
| 767 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 768 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 769 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[748] | 770 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 771 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 772 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 773 | }
|
---|
[551] | 774 | if (!(x % 500))
|
---|
| 775 | DosSleep(1L);
|
---|
| 776 | else if (!(x % 50))
|
---|
[748] | 777 | DosSleep(1);
|
---|
[551] | 778 | }
|
---|
| 779 | break;
|
---|
[2] | 780 |
|
---|
[551] | 781 | case IDM_SELECTSAMECONTENT:
|
---|
[690] | 782 | // fixme why?
|
---|
[551] | 783 | for (x = 0; x < numS; x++) {
|
---|
| 784 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
[730] | 785 | *pciSa[x]->pszFileName &&
|
---|
| 786 | *pciDa[x]->pszFileName &&
|
---|
[551] | 787 | pciSa[x]->flags & CNRITEM_EXISTS &&
|
---|
[748] | 788 | pciDa[x]->flags & CNRITEM_EXISTS)
|
---|
| 789 | {
|
---|
[551] | 790 | FILE *fp1 = NULL;
|
---|
| 791 | FILE *fp2 = NULL;
|
---|
| 792 | BOOL gotMatch = FALSE;
|
---|
| 793 | UINT errLineNo = 0;
|
---|
| 794 | UINT compErrno = 0;
|
---|
| 795 | CHAR buf1[1024];
|
---|
| 796 | CHAR buf2[1024];
|
---|
| 797 | HAB hab = WinQueryAnchorBlock(hwndCnrS);
|
---|
[317] | 798 |
|
---|
[730] | 799 | fp1 = _fsopen(pciSa[x]->pszFileName, "rb", SH_DENYNO);
|
---|
[551] | 800 | if (!fp1) {
|
---|
| 801 | errLineNo = __LINE__;
|
---|
| 802 | compErrno = errno;
|
---|
| 803 | }
|
---|
| 804 | else {
|
---|
[730] | 805 | fp2 = _fsopen(pciDa[x]->pszFileName, "rb", SH_DENYNO);
|
---|
[551] | 806 | if (!fp2) {
|
---|
[362] | 807 | errLineNo = __LINE__;
|
---|
| 808 | compErrno = errno;
|
---|
[317] | 809 | }
|
---|
| 810 | else {
|
---|
[551] | 811 | size_t len1 = filelength(fileno(fp1));
|
---|
| 812 | size_t len2 = filelength(fileno(fp2));
|
---|
| 813 |
|
---|
| 814 | if (len1 == len2) {
|
---|
| 815 | setbuf(fp1, NULL);
|
---|
| 816 | setbuf(fp2, NULL);
|
---|
| 817 | while (WinIsWindow(hab, hwndCnrS)) {
|
---|
| 818 | size_t numread1 = fread(buf1, 1, 1024, fp1);
|
---|
| 819 | size_t numread2 = fread(buf2, 1, 1024, fp2);
|
---|
| 820 |
|
---|
| 821 | if (!numread1 || !numread2 || numread1 != numread2) {
|
---|
| 822 | if (ferror(fp1) || ferror(fp2)) {
|
---|
| 823 | errLineNo = __LINE__;
|
---|
| 824 | compErrno = errno;
|
---|
[317] | 825 | }
|
---|
[551] | 826 | else if (feof(fp1) && feof(fp2))
|
---|
| 827 | gotMatch = TRUE;
|
---|
| 828 | break;
|
---|
| 829 | }
|
---|
| 830 | else if (memcmp(buf1, buf2, numread1))
|
---|
| 831 | break;
|
---|
[690] | 832 | } // while
|
---|
| 833 | } // same len
|
---|
[551] | 834 | }
|
---|
| 835 | }
|
---|
[317] | 836 |
|
---|
[551] | 837 | if (fp1)
|
---|
| 838 | fclose(fp1);
|
---|
[317] | 839 |
|
---|
[551] | 840 | if (fp2)
|
---|
| 841 | fclose(fp2);
|
---|
[317] | 842 |
|
---|
[551] | 843 | if (errLineNo) {
|
---|
| 844 | Runtime_Error(pszSrcFile, errLineNo,
|
---|
| 845 | "error %d while comparing", compErrno);
|
---|
| 846 | }
|
---|
| 847 | if (gotMatch) {
|
---|
[748] | 848 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 849 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 850 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[748] | 851 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 852 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 853 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 854 | }
|
---|
| 855 | }
|
---|
| 856 | if (!(x % 500))
|
---|
| 857 | DosSleep(1L);
|
---|
| 858 | else if (!(x % 50))
|
---|
[748] | 859 | DosSleep(1);
|
---|
[551] | 860 | } // for records
|
---|
| 861 | break;
|
---|
[317] | 862 |
|
---|
[551] | 863 | case IDM_SELECTBOTH:
|
---|
| 864 | for (x = 0; x < numS; x++) {
|
---|
[748] | 865 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 866 | *pciSa[x]->pszFileName &&
|
---|
| 867 | pciSa[x]->flags & CNRITEM_EXISTS) {
|
---|
| 868 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 869 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 870 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[748] | 871 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 872 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 873 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 874 | }
|
---|
[551] | 875 | if (!(x % 500))
|
---|
| 876 | DosSleep(1L);
|
---|
| 877 | else if (!(x % 50))
|
---|
[748] | 878 | DosSleep(1);
|
---|
[551] | 879 | }
|
---|
| 880 | break;
|
---|
[2] | 881 |
|
---|
[551] | 882 | case IDM_SELECTONE:
|
---|
| 883 | for (x = 0; x < numS; x++) {
|
---|
[748] | 884 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 885 | *pciSa[x]->pszFileName &&
|
---|
| 886 | ~pciSa[x]->flags & CNRITEM_EXISTS)
|
---|
| 887 | {
|
---|
| 888 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 889 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 890 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 891 | }
|
---|
[748] | 892 | else if (*pciDa[x]->pszFileName &&
|
---|
| 893 | ~pciDa[x]->flags & CNRITEM_EXISTS) {
|
---|
| 894 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 895 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 896 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 897 | }
|
---|
| 898 | if (!(x % 500))
|
---|
| 899 | DosSleep(1L);
|
---|
| 900 | else if (!(x % 50))
|
---|
[748] | 901 | DosSleep(1);
|
---|
[551] | 902 | }
|
---|
| 903 | break;
|
---|
[2] | 904 |
|
---|
[551] | 905 | case IDM_SELECTBIGGER:
|
---|
| 906 | for (x = 0; x < numS; x++) {
|
---|
[748] | 907 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 908 | pciSa[x]->flags & CNRITEM_LARGER) {
|
---|
| 909 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 910 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 911 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 912 | }
|
---|
[748] | 913 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 914 | *pciDa[x]->pszFileName &&
|
---|
| 915 | pciDa[x]->flags & CNRITEM_LARGER) {
|
---|
| 916 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 917 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 918 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 919 | }
|
---|
| 920 | if (!(x % 500))
|
---|
| 921 | DosSleep(1L);
|
---|
| 922 | else if (!(x % 50))
|
---|
[748] | 923 | DosSleep(1);
|
---|
[551] | 924 | }
|
---|
| 925 | break;
|
---|
[2] | 926 |
|
---|
[551] | 927 | case IDM_SELECTSMALLER:
|
---|
| 928 | for (x = 0; x < numS; x++) {
|
---|
[748] | 929 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 930 | *pciSa[x]->pszFileName &&
|
---|
| 931 | pciSa[x]->flags & CNRITEM_SMALLER) {
|
---|
| 932 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 933 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 934 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 935 | }
|
---|
[748] | 936 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 937 | *pciDa[x]->pszFileName &&
|
---|
| 938 | pciDa[x]->flags & CNRITEM_SMALLER) {
|
---|
| 939 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 940 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 941 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 942 | }
|
---|
| 943 | if (!(x % 500))
|
---|
| 944 | DosSleep(1L);
|
---|
| 945 | else if (!(x % 50))
|
---|
[748] | 946 | DosSleep(1);
|
---|
[551] | 947 | }
|
---|
| 948 | break;
|
---|
[2] | 949 |
|
---|
[551] | 950 | case IDM_SELECTNEWER:
|
---|
| 951 | for (x = 0; x < numS; x++) {
|
---|
[748] | 952 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 953 | *pciSa[x]->pszFileName &&
|
---|
| 954 | pciSa[x]->flags & CNRITEM_NEWER) {
|
---|
| 955 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 956 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 957 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 958 | }
|
---|
[748] | 959 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 960 | *pciDa[x]->pszFileName &&
|
---|
| 961 | pciDa[x]->flags & CNRITEM_NEWER) {
|
---|
| 962 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 963 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 964 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 965 | }
|
---|
| 966 | if (!(x % 500))
|
---|
| 967 | DosSleep(1L);
|
---|
| 968 | else if (!(x % 50))
|
---|
[748] | 969 | DosSleep(1);
|
---|
[551] | 970 | }
|
---|
| 971 | break;
|
---|
[2] | 972 |
|
---|
[551] | 973 | case IDM_SELECTOLDER:
|
---|
| 974 | for (x = 0; x < numS; x++) {
|
---|
[748] | 975 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 976 | *pciSa[x]->pszFileName &&
|
---|
| 977 | pciSa[x]->flags & CNRITEM_OLDER) {
|
---|
| 978 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 979 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 980 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 981 | }
|
---|
[748] | 982 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 983 | *pciDa[x]->pszFileName &&
|
---|
| 984 | pciDa[x]->flags & CNRITEM_OLDER) {
|
---|
| 985 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 986 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 987 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 988 | }
|
---|
| 989 | if (!(x % 500))
|
---|
| 990 | DosSleep(1L);
|
---|
| 991 | else if (!(x % 50))
|
---|
[748] | 992 | DosSleep(1);
|
---|
[551] | 993 | }
|
---|
| 994 | break;
|
---|
[2] | 995 |
|
---|
[551] | 996 | case IDM_DESELECTBOTH:
|
---|
| 997 | for (x = 0; x < numS; x++) {
|
---|
[748] | 998 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 999 | *pciSa[x]->pszFileName &&
|
---|
| 1000 | pciSa[x]->flags & CNRITEM_EXISTS) {
|
---|
[551] | 1001 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1002 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1003 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1004 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1005 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1006 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1007 | }
|
---|
[551] | 1008 | if (!(x % 500))
|
---|
| 1009 | DosSleep(1L);
|
---|
| 1010 | else if (!(x % 50))
|
---|
[748] | 1011 | DosSleep(1);
|
---|
[551] | 1012 | }
|
---|
| 1013 | break;
|
---|
[2] | 1014 |
|
---|
[551] | 1015 | case IDM_DESELECTONE:
|
---|
| 1016 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1017 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1018 | *pciSa[x]->pszFileName &&
|
---|
| 1019 | ~pciSa[x]->flags & CNRITEM_EXISTS) {
|
---|
[551] | 1020 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1021 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1022 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1023 | }
|
---|
[748] | 1024 | else if (*pciDa[x]->pszFileName &&
|
---|
| 1025 | ~pciDa[x]->flags & CNRITEM_EXISTS) {
|
---|
[551] | 1026 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1027 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1028 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1029 | }
|
---|
| 1030 | if (!(x % 500))
|
---|
| 1031 | DosSleep(1L);
|
---|
| 1032 | else if (!(x % 50))
|
---|
[748] | 1033 | DosSleep(1);
|
---|
[551] | 1034 | }
|
---|
| 1035 | break;
|
---|
[2] | 1036 |
|
---|
[551] | 1037 | case IDM_DESELECTBIGGER:
|
---|
| 1038 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1039 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1040 | *pciSa[x]->pszFileName &&
|
---|
| 1041 | pciSa[x]->flags & CNRITEM_LARGER) {
|
---|
[551] | 1042 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1043 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1044 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1045 | }
|
---|
[748] | 1046 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1047 | *pciDa[x]->pszFileName &&
|
---|
| 1048 | pciDa[x]->flags & CNRITEM_LARGER) {
|
---|
[551] | 1049 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1050 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1051 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1052 | }
|
---|
| 1053 | if (!(x % 500))
|
---|
| 1054 | DosSleep(1L);
|
---|
| 1055 | else if (!(x % 50))
|
---|
[748] | 1056 | DosSleep(1);
|
---|
[551] | 1057 | }
|
---|
| 1058 | break;
|
---|
[2] | 1059 |
|
---|
[551] | 1060 | case IDM_DESELECTSMALLER:
|
---|
| 1061 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1062 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1063 | *pciSa[x]->pszFileName &&
|
---|
| 1064 | pciSa[x]->flags & CNRITEM_SMALLER) {
|
---|
[551] | 1065 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1066 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1067 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1068 | }
|
---|
[748] | 1069 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1070 | *pciDa[x]->pszFileName &&
|
---|
| 1071 | pciDa[x]->flags & CNRITEM_SMALLER) {
|
---|
[551] | 1072 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1073 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1074 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1075 | }
|
---|
| 1076 | if (!(x % 500))
|
---|
| 1077 | DosSleep(1L);
|
---|
| 1078 | else if (!(x % 50))
|
---|
[748] | 1079 | DosSleep(1);
|
---|
[551] | 1080 | }
|
---|
| 1081 | break;
|
---|
[2] | 1082 |
|
---|
[551] | 1083 | case IDM_DESELECTNEWER:
|
---|
| 1084 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1085 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1086 | *pciSa[x]->pszFileName &&
|
---|
| 1087 | pciSa[x]->flags & CNRITEM_NEWER) {
|
---|
[551] | 1088 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1089 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1090 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1091 | }
|
---|
[748] | 1092 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1093 | *pciDa[x]->pszFileName &&
|
---|
| 1094 | pciDa[x]->flags & CNRITEM_NEWER) {
|
---|
[551] | 1095 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1096 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1097 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1098 | }
|
---|
| 1099 | if (!(x % 500))
|
---|
| 1100 | DosSleep(1L);
|
---|
| 1101 | else if (!(x % 50))
|
---|
[748] | 1102 | DosSleep(1);
|
---|
[551] | 1103 | }
|
---|
| 1104 | break;
|
---|
[2] | 1105 |
|
---|
[551] | 1106 | case IDM_DESELECTOLDER:
|
---|
| 1107 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1108 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1109 | *pciSa[x]->pszFileName &&
|
---|
| 1110 | pciSa[x]->flags & CNRITEM_OLDER) {
|
---|
[551] | 1111 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1112 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1113 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1114 | }
|
---|
[748] | 1115 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1116 | *pciDa[x]->pszFileName &&
|
---|
| 1117 | pciDa[x]->flags & CNRITEM_OLDER) {
|
---|
[551] | 1118 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1119 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1120 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1121 | }
|
---|
| 1122 | if (!(x % 500))
|
---|
| 1123 | DosSleep(1L);
|
---|
| 1124 | else if (!(x % 50))
|
---|
[748] | 1125 | DosSleep(1);
|
---|
[551] | 1126 | }
|
---|
| 1127 | break;
|
---|
[2] | 1128 |
|
---|
[551] | 1129 | default:
|
---|
| 1130 | break;
|
---|
[2] | 1131 | }
|
---|
| 1132 |
|
---|
[362] | 1133 | if (reset) {
|
---|
| 1134 | while (numS) {
|
---|
[551] | 1135 | WinSendMsg(hwndCnrS, CM_INVALIDATERECORD,
|
---|
| 1136 | MPFROMP(pciSa), MPFROM2SHORT((min(numS, 65535)), 0));
|
---|
[748] | 1137 | DosSleep(1);
|
---|
[551] | 1138 | WinSendMsg(hwndCnrD, CM_INVALIDATERECORD,
|
---|
| 1139 | MPFROMP(pciDa), MPFROM2SHORT((min(numD, 65535)), 0));
|
---|
| 1140 | numS -= min(numS, 65535);
|
---|
[362] | 1141 | if (numS)
|
---|
[748] | 1142 | DosSleep(1);
|
---|
[2] | 1143 | }
|
---|
| 1144 | }
|
---|
| 1145 |
|
---|
| 1146 | free(pciSa);
|
---|
| 1147 | free(pciDa);
|
---|
| 1148 | DosPostEventSem(CompactSem);
|
---|
| 1149 | }
|
---|
| 1150 |
|
---|
[551] | 1151 | struct SS
|
---|
| 1152 | {
|
---|
| 1153 | PCNRITEM pci;
|
---|
| 1154 | BOOL unique, all, smallest, largest, newest, oldest;
|
---|
[2] | 1155 | };
|
---|
| 1156 |
|
---|
[551] | 1157 | struct Cnr
|
---|
| 1158 | {
|
---|
| 1159 | HWND hwndCnr;
|
---|
| 1160 | ULONG numfiles;
|
---|
[2] | 1161 | struct SS *ss;
|
---|
| 1162 | };
|
---|
| 1163 |
|
---|
[551] | 1164 | static int CompSSNamesB(const void *s1, const void *s2)
|
---|
[317] | 1165 | {
|
---|
[2] | 1166 | struct SS *ss2 = (struct SS *)s2;
|
---|
| 1167 |
|
---|
[748] | 1168 | return stricmp((PSZ)s1, ss2->pci->pszFileName);
|
---|
[2] | 1169 | }
|
---|
| 1170 |
|
---|
[551] | 1171 | static int CompSSNames(const void *s1, const void *s2)
|
---|
[317] | 1172 | {
|
---|
[2] | 1173 | struct SS *ss1 = (struct SS *)s1;
|
---|
| 1174 | struct SS *ss2 = (struct SS *)s2;
|
---|
| 1175 |
|
---|
[551] | 1176 | return stricmp(ss1->pci->pszFileName, ss2->pci->pszFileName);
|
---|
[2] | 1177 | }
|
---|
| 1178 |
|
---|
[551] | 1179 | VOID FreeCnrs(struct Cnr * Cnrs, INT numw)
|
---|
[317] | 1180 | {
|
---|
[2] | 1181 | register INT z;
|
---|
| 1182 |
|
---|
[551] | 1183 | for (z = 0; z < numw; z++) {
|
---|
[362] | 1184 | if (Cnrs[z].ss)
|
---|
[2] | 1185 | free(Cnrs[z].ss);
|
---|
| 1186 | }
|
---|
| 1187 | free(Cnrs);
|
---|
| 1188 | DosPostEventSem(CompactSem);
|
---|
| 1189 | }
|
---|
| 1190 |
|
---|
[551] | 1191 | VOID SpecialSelect2(HWND hwndParent, INT action)
|
---|
[317] | 1192 | {
|
---|
[551] | 1193 | PCNRITEM pci;
|
---|
| 1194 | HENUM henum;
|
---|
| 1195 | HWND hwnd;
|
---|
| 1196 | register INT numwindows = 0, w, x, z, cmp;
|
---|
| 1197 | struct Cnr *Cnrs = NULL;
|
---|
| 1198 | struct SS *bsres;
|
---|
[2] | 1199 |
|
---|
[362] | 1200 | if (!hwndParent)
|
---|
[2] | 1201 | return;
|
---|
| 1202 |
|
---|
| 1203 | /* count directory containers, build array of hwnds */
|
---|
| 1204 | henum = WinBeginEnumWindows(hwndParent);
|
---|
[362] | 1205 | while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE) {
|
---|
[551] | 1206 | if (WinWindowFromID(WinWindowFromID(hwnd, FID_CLIENT), DIR_CNR)) {
|
---|
| 1207 | Cnrs =
|
---|
| 1208 | xrealloc(Cnrs, (numwindows + 1) * sizeof(struct Cnr), pszSrcFile,
|
---|
| 1209 | __LINE__);
|
---|
[362] | 1210 | if (!Cnrs) {
|
---|
[551] | 1211 | Notify(GetPString(IDS_OUTOFMEMORY));
|
---|
| 1212 | return;
|
---|
[2] | 1213 | }
|
---|
[551] | 1214 | memset(&Cnrs[numwindows], 0, sizeof(struct Cnr));
|
---|
[2] | 1215 | Cnrs[numwindows].hwndCnr = WinWindowFromID(WinWindowFromID(hwnd,
|
---|
[551] | 1216 | FID_CLIENT),
|
---|
| 1217 | DIR_CNR);
|
---|
[2] | 1218 | numwindows++;
|
---|
| 1219 | }
|
---|
| 1220 | }
|
---|
| 1221 | WinEndEnumWindows(henum);
|
---|
[362] | 1222 | if (numwindows < 2) {
|
---|
[551] | 1223 | FreeCnrs(Cnrs, numwindows);
|
---|
[362] | 1224 | Runtime_Error(pszSrcFile, __LINE__, "expected two windows");
|
---|
[2] | 1225 | Notify(GetPString(IDS_COMPSEL2ORMORETEXT));
|
---|
| 1226 | return;
|
---|
| 1227 | }
|
---|
[362] | 1228 | if (numwindows > 4) {
|
---|
[2] | 1229 | WinSendMsg(Cnrs[0].
|
---|
[551] | 1230 | hwndCnr,
|
---|
| 1231 | UM_NOTIFY, MPFROMP(GetPString(IDS_BUILDINGLISTSTEXT)), MPVOID);
|
---|
[748] | 1232 | DosSleep(1);
|
---|
[2] | 1233 | }
|
---|
| 1234 |
|
---|
| 1235 | /* count records, build array of pointers to records */
|
---|
[551] | 1236 | for (z = 0; z < numwindows; z++) {
|
---|
| 1237 | pci = (PCNRITEM) WinSendMsg(Cnrs[z].hwndCnr,
|
---|
| 1238 | CM_QUERYRECORD,
|
---|
| 1239 | MPVOID,
|
---|
| 1240 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[2] | 1241 | x = 0;
|
---|
[748] | 1242 | while (pci && (INT)pci != -1) {
|
---|
| 1243 | if (~pci->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1244 | ~pci->attrFile & FILE_DIRECTORY) {
|
---|
[551] | 1245 | Cnrs[z].ss =
|
---|
| 1246 | xrealloc(Cnrs[z].ss, (x + 1) * sizeof(struct SS), pszSrcFile,
|
---|
| 1247 | __LINE__);
|
---|
| 1248 | if (!Cnrs[z].ss) {
|
---|
| 1249 | FreeCnrs(Cnrs, numwindows);
|
---|
| 1250 | Notify(GetPString(IDS_OUTOFMEMORY));
|
---|
| 1251 | return;
|
---|
| 1252 | }
|
---|
| 1253 | memset(&Cnrs[z].ss[x], 0, sizeof(struct SS));
|
---|
| 1254 | Cnrs[z].ss[x].pci = pci;
|
---|
| 1255 | x++;
|
---|
[2] | 1256 | }
|
---|
[551] | 1257 | pci = (PCNRITEM) WinSendMsg(Cnrs[z].hwndCnr,
|
---|
| 1258 | CM_QUERYRECORD,
|
---|
| 1259 | MPFROMP(pci),
|
---|
| 1260 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[2] | 1261 | }
|
---|
[748] | 1262 | DosSleep(1);
|
---|
[2] | 1263 | Cnrs[z].numfiles = x;
|
---|
[362] | 1264 | if (Cnrs[z].numfiles)
|
---|
[551] | 1265 | qsort(Cnrs[z].ss, Cnrs[z].numfiles, sizeof(struct SS), CompSSNames);
|
---|
[2] | 1266 | }
|
---|
| 1267 |
|
---|
[551] | 1268 | for (z = 0; z < numwindows; z++) {
|
---|
| 1269 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
[2] | 1270 | Cnrs[z].ss[x].all = Cnrs[z].ss[x].unique = Cnrs[z].ss[x].newest =
|
---|
[551] | 1271 | Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].smallest =
|
---|
| 1272 | Cnrs[z].ss[x].largest = TRUE;
|
---|
| 1273 | for (w = 0; w < numwindows; w++) {
|
---|
| 1274 | if (w != z && Cnrs[w].numfiles) {
|
---|
| 1275 | bsres = (struct SS *)bsearch(Cnrs[z].ss[x].pci->pszFileName,
|
---|
| 1276 | Cnrs[w].ss, Cnrs[w].numfiles,
|
---|
| 1277 | sizeof(struct SS), CompSSNamesB);
|
---|
| 1278 | if (bsres) {
|
---|
| 1279 | Cnrs[z].ss[x].unique = FALSE;
|
---|
| 1280 | if (Cnrs[z].ss[x].pci->cbFile + Cnrs[z].ss[x].pci->easize >
|
---|
| 1281 | bsres->pci->cbFile + bsres->pci->easize)
|
---|
| 1282 | Cnrs[z].ss[x].smallest = FALSE;
|
---|
| 1283 | if (Cnrs[z].ss[x].pci->cbFile + Cnrs[z].ss[x].pci->easize <
|
---|
| 1284 | bsres->pci->cbFile + bsres->pci->easize)
|
---|
| 1285 | Cnrs[z].ss[x].largest = FALSE;
|
---|
| 1286 | cmp =
|
---|
| 1287 | (Cnrs[z].ss[x].pci->date.year >
|
---|
| 1288 | bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year <
|
---|
| 1289 | bsres->pci->date.
|
---|
| 1290 | year) ? FALSE : (Cnrs[z].
|
---|
| 1291 | ss[x].pci->
|
---|
| 1292 | date.month >
|
---|
| 1293 | bsres->pci->
|
---|
| 1294 | date.
|
---|
| 1295 | month) ? TRUE
|
---|
| 1296 | : (Cnrs[z].ss[x].pci->date.month <
|
---|
| 1297 | bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.
|
---|
| 1298 | day >
|
---|
| 1299 | bsres->pci->date.
|
---|
| 1300 | day) ? TRUE : (Cnrs[z].
|
---|
| 1301 | ss[x].pci->
|
---|
| 1302 | date.day <
|
---|
| 1303 | bsres->
|
---|
| 1304 | pci->date.
|
---|
| 1305 | day) ?
|
---|
| 1306 | FALSE : (Cnrs[z].ss[x].pci->time.hours >
|
---|
| 1307 | bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->
|
---|
| 1308 | time.hours <
|
---|
| 1309 | bsres->pci->time.
|
---|
| 1310 | hours) ? FALSE
|
---|
| 1311 | : (Cnrs[z].ss[x].pci->time.minutes >
|
---|
| 1312 | bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
| 1313 | minutes <
|
---|
| 1314 | bsres->pci->time.
|
---|
| 1315 | minutes) ? FALSE
|
---|
| 1316 | : (Cnrs[z].ss[x].pci->time.seconds >
|
---|
| 1317 | bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
| 1318 | seconds <
|
---|
| 1319 | bsres->pci->time.
|
---|
| 1320 | seconds) ? FALSE : FALSE;
|
---|
| 1321 | if (!cmp)
|
---|
| 1322 | Cnrs[z].ss[x].newest = FALSE;
|
---|
| 1323 | cmp =
|
---|
| 1324 | (Cnrs[z].ss[x].pci->date.year <
|
---|
| 1325 | bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year >
|
---|
| 1326 | bsres->pci->date.
|
---|
| 1327 | year) ? FALSE : (Cnrs[z].
|
---|
| 1328 | ss[x].pci->
|
---|
| 1329 | date.month <
|
---|
| 1330 | bsres->pci->
|
---|
| 1331 | date.
|
---|
| 1332 | month) ? TRUE
|
---|
| 1333 | : (Cnrs[z].ss[x].pci->date.month >
|
---|
| 1334 | bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.
|
---|
| 1335 | day <
|
---|
| 1336 | bsres->pci->date.
|
---|
| 1337 | day) ? TRUE : (Cnrs[z].
|
---|
| 1338 | ss[x].pci->
|
---|
| 1339 | date.day >
|
---|
| 1340 | bsres->
|
---|
| 1341 | pci->date.
|
---|
| 1342 | day) ?
|
---|
| 1343 | FALSE : (Cnrs[z].ss[x].pci->time.hours <
|
---|
| 1344 | bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->
|
---|
| 1345 | time.hours >
|
---|
| 1346 | bsres->pci->time.
|
---|
| 1347 | hours) ? FALSE
|
---|
| 1348 | : (Cnrs[z].ss[x].pci->time.minutes <
|
---|
| 1349 | bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
| 1350 | minutes >
|
---|
| 1351 | bsres->pci->time.
|
---|
| 1352 | minutes) ? FALSE
|
---|
| 1353 | : (Cnrs[z].ss[x].pci->time.seconds <
|
---|
| 1354 | bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
| 1355 | seconds >
|
---|
| 1356 | bsres->pci->time.
|
---|
| 1357 | seconds) ? FALSE : FALSE;
|
---|
| 1358 | if (!cmp)
|
---|
| 1359 | Cnrs[z].ss[x].oldest = FALSE;
|
---|
| 1360 | cmp = 0;
|
---|
| 1361 | break;
|
---|
| 1362 | }
|
---|
| 1363 | else
|
---|
| 1364 | Cnrs[z].ss[x].all = FALSE;
|
---|
| 1365 | }
|
---|
[2] | 1366 | }
|
---|
[362] | 1367 | if (Cnrs[z].ss[x].unique)
|
---|
[551] | 1368 | Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].newest = Cnrs[z].ss[x].all =
|
---|
| 1369 | Cnrs[z].ss[x].largest = Cnrs[z].ss[x].smallest = FALSE;
|
---|
[748] | 1370 | DosSleep(1);
|
---|
[2] | 1371 | }
|
---|
| 1372 | DosSleep(1L);
|
---|
| 1373 | }
|
---|
| 1374 |
|
---|
[551] | 1375 | switch (action) {
|
---|
| 1376 | case IDM_SELECTBOTH:
|
---|
| 1377 | for (z = 0; z < numwindows; z++) {
|
---|
| 1378 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1379 | if (Cnrs[z].ss[x].all)
|
---|
| 1380 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1381 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1382 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1383 | }
|
---|
[748] | 1384 | DosSleep(1);
|
---|
[551] | 1385 | }
|
---|
| 1386 | break;
|
---|
| 1387 | case IDM_SELECTMORE:
|
---|
| 1388 | for (z = 0; z < numwindows; z++) {
|
---|
| 1389 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1390 | if (!Cnrs[z].ss[x].unique)
|
---|
| 1391 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1392 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1393 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1394 | }
|
---|
[748] | 1395 | DosSleep(1);
|
---|
[551] | 1396 | }
|
---|
| 1397 | break;
|
---|
| 1398 | case IDM_SELECTONE:
|
---|
| 1399 | for (z = 0; z < numwindows; z++) {
|
---|
| 1400 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1401 | if (Cnrs[z].ss[x].unique)
|
---|
| 1402 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1403 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1404 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1405 | }
|
---|
[748] | 1406 | DosSleep(1);
|
---|
[551] | 1407 | }
|
---|
| 1408 | break;
|
---|
| 1409 | case IDM_SELECTNEWER:
|
---|
| 1410 | for (z = 0; z < numwindows; z++) {
|
---|
| 1411 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1412 | if (Cnrs[z].ss[x].newest)
|
---|
| 1413 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1414 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1415 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1416 | }
|
---|
[748] | 1417 | DosSleep(1);
|
---|
[551] | 1418 | }
|
---|
| 1419 | break;
|
---|
| 1420 | case IDM_SELECTOLDER:
|
---|
| 1421 | for (z = 0; z < numwindows; z++) {
|
---|
| 1422 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1423 | if (Cnrs[z].ss[x].oldest)
|
---|
| 1424 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1425 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1426 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1427 | }
|
---|
[748] | 1428 | DosSleep(1);
|
---|
[551] | 1429 | }
|
---|
| 1430 | break;
|
---|
| 1431 | case IDM_SELECTBIGGER:
|
---|
| 1432 | for (z = 0; z < numwindows; z++) {
|
---|
| 1433 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1434 | if (Cnrs[z].ss[x].largest)
|
---|
| 1435 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1436 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1437 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1438 | }
|
---|
[748] | 1439 | DosSleep(1);
|
---|
[551] | 1440 | }
|
---|
| 1441 | break;
|
---|
| 1442 | case IDM_SELECTSMALLER:
|
---|
| 1443 | for (z = 0; z < numwindows; z++) {
|
---|
| 1444 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1445 | if (Cnrs[z].ss[x].smallest)
|
---|
| 1446 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1447 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1448 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1449 | }
|
---|
[748] | 1450 | DosSleep(1);
|
---|
[551] | 1451 | }
|
---|
| 1452 | break;
|
---|
[2] | 1453 |
|
---|
[551] | 1454 | case IDM_DESELECTBOTH:
|
---|
| 1455 | for (z = 0; z < numwindows; z++) {
|
---|
| 1456 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1457 | if (Cnrs[z].ss[x].all)
|
---|
| 1458 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1459 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1460 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1461 | }
|
---|
[748] | 1462 | DosSleep(1);
|
---|
[551] | 1463 | }
|
---|
| 1464 | break;
|
---|
| 1465 | case IDM_DESELECTMORE:
|
---|
| 1466 | for (z = 0; z < numwindows; z++) {
|
---|
| 1467 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1468 | if (!Cnrs[z].ss[x].unique)
|
---|
| 1469 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1470 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1471 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1472 | }
|
---|
[748] | 1473 | DosSleep(1);
|
---|
[551] | 1474 | }
|
---|
| 1475 | break;
|
---|
| 1476 | case IDM_DESELECTONE:
|
---|
| 1477 | for (z = 0; z < numwindows; z++) {
|
---|
| 1478 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1479 | if (Cnrs[z].ss[x].unique)
|
---|
| 1480 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1481 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1482 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1483 | }
|
---|
[748] | 1484 | DosSleep(1);
|
---|
[551] | 1485 | }
|
---|
| 1486 | break;
|
---|
| 1487 | case IDM_DESELECTNEWER:
|
---|
| 1488 | for (z = 0; z < numwindows; z++) {
|
---|
| 1489 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1490 | if (Cnrs[z].ss[x].newest)
|
---|
| 1491 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1492 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1493 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1494 | }
|
---|
[748] | 1495 | DosSleep(1);
|
---|
[551] | 1496 | }
|
---|
| 1497 | break;
|
---|
| 1498 | case IDM_DESELECTOLDER:
|
---|
| 1499 | for (z = 0; z < numwindows; z++) {
|
---|
| 1500 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1501 | if (Cnrs[z].ss[x].oldest)
|
---|
| 1502 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1503 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1504 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1505 | }
|
---|
[748] | 1506 | DosSleep(1);
|
---|
[551] | 1507 | }
|
---|
| 1508 | break;
|
---|
| 1509 | case IDM_DESELECTBIGGER:
|
---|
| 1510 | for (z = 0; z < numwindows; z++) {
|
---|
| 1511 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1512 | if (Cnrs[z].ss[x].largest)
|
---|
| 1513 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1514 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1515 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1516 | }
|
---|
[748] | 1517 | DosSleep(1);
|
---|
[551] | 1518 | }
|
---|
| 1519 | break;
|
---|
| 1520 | case IDM_DESELECTSMALLER:
|
---|
| 1521 | for (z = 0; z < numwindows; z++) {
|
---|
| 1522 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1523 | if (Cnrs[z].ss[x].smallest)
|
---|
| 1524 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1525 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1526 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1527 | }
|
---|
[748] | 1528 | DosSleep(1);
|
---|
[551] | 1529 | }
|
---|
| 1530 | break;
|
---|
[2] | 1531 | }
|
---|
| 1532 |
|
---|
[551] | 1533 | FreeCnrs(Cnrs, numwindows);
|
---|
[2] | 1534 | }
|
---|