[123] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: select.c 751 2007-08-02 23:05:48Z 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
|
---|
[751] | 22 | 02 Aug 07 SHL Sync with CNRITEM mods
|
---|
[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)
|
---|
[751] | 486 | RemoveCnrItems(hwndCnr, pci, 1, CMA_FREE | CMA_INVALIDATE);
|
---|
[2] | 487 | else
|
---|
[751] | 488 | RemoveCnrItems(hwndCnr, pci, 1, CMA_FREE);
|
---|
[362] | 489 | if (attribute == CRA_CURSORED)
|
---|
[551] | 490 | break;
|
---|
| 491 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
| 492 | MPFROMSHORT(attribute));
|
---|
[2] | 493 | }
|
---|
| 494 | else
|
---|
[551] | 495 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 496 | MPFROMSHORT(attribute));
|
---|
[2] | 497 | }
|
---|
[362] | 498 | if (didone && !fSyncUpdates)
|
---|
[551] | 499 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
|
---|
| 500 | MPFROM2SHORT(0, CMA_REPOSITION));
|
---|
[2] | 501 | }
|
---|
| 502 |
|
---|
[442] | 503 | //== SetMask() Convert mask string to array of pointers to masks ==
|
---|
| 504 |
|
---|
[551] | 505 | VOID SetMask(PSZ maskstr, MASK * mask)
|
---|
[317] | 506 | {
|
---|
[442] | 507 | UINT x;
|
---|
| 508 | PSZ p;
|
---|
[2] | 509 |
|
---|
[442] | 510 | if (maskstr)
|
---|
[551] | 511 | strcpy(mask->szMask, maskstr); // Got new mask string
|
---|
[442] | 512 | // Build array of pointers
|
---|
| 513 | p = mask->szMaskCopy;
|
---|
[551] | 514 | strcpy(p, mask->szMask);
|
---|
[442] | 515 | // Allow up to 25 masks - ignore extras
|
---|
| 516 | for (x = 0; *p && x < 25; x++) {
|
---|
| 517 | mask->pszMasks[x] = p;
|
---|
[362] | 518 | while (*p && *p != ';')
|
---|
[442] | 519 | p++; // Find separator
|
---|
[362] | 520 | if (*p) {
|
---|
[442] | 521 | *p = 0; // Replace ;
|
---|
[2] | 522 | p++;
|
---|
| 523 | }
|
---|
[551] | 524 | } // for
|
---|
[442] | 525 | mask->pszMasks[x] = NULL; // Mark end
|
---|
[2] | 526 | }
|
---|
| 527 |
|
---|
[551] | 528 | VOID ExpandAll(HWND hwndCnr, BOOL expand, PCNRITEM pciParent)
|
---|
[317] | 529 | {
|
---|
[2] | 530 | PCNRITEM pci;
|
---|
| 531 |
|
---|
[362] | 532 | if (!pciParent)
|
---|
[551] | 533 | pciParent = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(NULL),
|
---|
| 534 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[362] | 535 | if (pciParent) {
|
---|
[748] | 536 | if (expand && ~pciParent->rc.flRecordAttr & CRA_EXPANDED)
|
---|
[551] | 537 | WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciParent), MPVOID);
|
---|
[362] | 538 | else if (!expand && (pciParent->rc.flRecordAttr & CRA_EXPANDED))
|
---|
[551] | 539 | WinSendMsg(hwndCnr, CM_COLLAPSETREE, MPFROMP(pciParent), MPVOID);
|
---|
| 540 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pciParent),
|
---|
| 541 | MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
|
---|
[362] | 542 | if (pci)
|
---|
[2] | 543 | DosSleep(1L);
|
---|
[748] | 544 | while (pci && (INT)pci != -1) {
|
---|
[551] | 545 | ExpandAll(hwndCnr, expand, pci);
|
---|
| 546 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
| 547 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[2] | 548 | }
|
---|
| 549 | }
|
---|
[748] | 550 | DosSleep(1);
|
---|
[2] | 551 | }
|
---|
| 552 |
|
---|
[551] | 553 | VOID InvertAll(HWND hwndCnr)
|
---|
[317] | 554 | {
|
---|
[2] | 555 | PCNRITEM pci;
|
---|
| 556 |
|
---|
[551] | 557 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
|
---|
| 558 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[748] | 559 | while (pci && (INT)pci != -1) {
|
---|
| 560 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
| 561 | if (~pci->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 562 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 563 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 564 | else
|
---|
[551] | 565 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
| 566 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 567 | }
|
---|
[551] | 568 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
| 569 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[2] | 570 | }
|
---|
| 571 | }
|
---|
| 572 |
|
---|
[204] | 573 | #pragma alloc_text (SELECT3,SpecialSelect)
|
---|
[2] | 574 | #pragma alloc_text(SELECT4,FreeCnrs,SpecialSelect2,CompSSNames,CompSSNamesB)
|
---|
| 575 |
|
---|
[551] | 576 | VOID SpecialSelect(HWND hwndCnrS, HWND hwndCnrD, INT action, BOOL reset)
|
---|
[317] | 577 | {
|
---|
[551] | 578 | PCNRITEM pciS, pciD, *pciSa = NULL, *pciDa = NULL;
|
---|
| 579 | CNRINFO cnri;
|
---|
| 580 | BOOL slow = FALSE;
|
---|
| 581 | register INT x, numD, numS;
|
---|
[2] | 582 |
|
---|
[606] | 583 |
|
---|
[362] | 584 | if (!hwndCnrS || !hwndCnrD)
|
---|
[2] | 585 | return;
|
---|
| 586 |
|
---|
[551] | 587 | memset(&cnri, 0, sizeof(CNRINFO));
|
---|
[2] | 588 | cnri.cb = sizeof(CNRINFO);
|
---|
[551] | 589 | WinSendMsg(hwndCnrD, CM_QUERYCNRINFO, MPFROMP(&cnri),
|
---|
| 590 | MPFROMLONG(sizeof(CNRINFO)));
|
---|
| 591 | numD = (INT) cnri.cRecords;
|
---|
| 592 | memset(&cnri, 0, sizeof(CNRINFO));
|
---|
[2] | 593 | cnri.cb = sizeof(CNRINFO);
|
---|
[551] | 594 | WinSendMsg(hwndCnrS, CM_QUERYCNRINFO, MPFROMP(&cnri),
|
---|
| 595 | MPFROMLONG(sizeof(CNRINFO)));
|
---|
| 596 | numS = (INT) cnri.cRecords;
|
---|
[362] | 597 | if (!numD || numS != numD) {
|
---|
[2] | 598 | saymsg(MB_ENTER,
|
---|
[551] | 599 | HWND_DESKTOP,
|
---|
| 600 | DEBUG_STRING, "numD (%lu) != numS (%lu)", numD, numS);
|
---|
[2] | 601 | return;
|
---|
| 602 | }
|
---|
[551] | 603 | pciDa = xmalloc(sizeof(PCNRITEM) * numD, pszSrcFile, __LINE__);
|
---|
[362] | 604 | if (!pciDa)
|
---|
[2] | 605 | return;
|
---|
| 606 |
|
---|
[551] | 607 | pciSa = xmalloc(sizeof(PCNRITEM) * numS, pszSrcFile, __LINE__);
|
---|
[362] | 608 | if (!pciSa) {
|
---|
| 609 | free(pciDa);
|
---|
[2] | 610 | return;
|
---|
| 611 | }
|
---|
| 612 |
|
---|
| 613 | Restart:
|
---|
| 614 |
|
---|
[551] | 615 | memset(pciDa, 0, sizeof(PCNRITEM) * numD);
|
---|
| 616 | memset(pciSa, 0, sizeof(PCNRITEM) * numS);
|
---|
[2] | 617 |
|
---|
[551] | 618 | pciD = (PCNRITEM) WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPVOID,
|
---|
| 619 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[2] | 620 | x = 0;
|
---|
[748] | 621 | while (pciD && (INT)pciD != -1 && x < numD) {
|
---|
[362] | 622 | if (reset)
|
---|
[2] | 623 | pciD->flags = 0;
|
---|
| 624 | pciDa[x] = pciD;
|
---|
| 625 | x++;
|
---|
[362] | 626 | if (!slow)
|
---|
[551] | 627 | pciD = (PCNRITEM) pciD->rc.preccNextRecord;
|
---|
[2] | 628 | else
|
---|
[551] | 629 | pciD = (PCNRITEM) WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPFROMP(pciD),
|
---|
| 630 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[362] | 631 | if (!(x % 500))
|
---|
[2] | 632 | DosSleep(1L);
|
---|
[362] | 633 | else if (!(x % 50))
|
---|
[748] | 634 | DosSleep(1);
|
---|
[2] | 635 | }
|
---|
[362] | 636 | if (numD != x) {
|
---|
| 637 | if (!slow) {
|
---|
[2] | 638 | slow = TRUE;
|
---|
| 639 | goto Restart;
|
---|
| 640 | }
|
---|
| 641 | free(pciDa);
|
---|
| 642 | free(pciSa);
|
---|
| 643 | saymsg(MB_ENTER,
|
---|
[551] | 644 | HWND_DESKTOP, DEBUG_STRING, "numD (%lu) != x (%lu)", numD, x);
|
---|
[2] | 645 | return;
|
---|
| 646 | }
|
---|
| 647 |
|
---|
[551] | 648 | pciS = (PCNRITEM) WinSendMsg(hwndCnrS, CM_QUERYRECORD, MPVOID,
|
---|
| 649 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[2] | 650 | x = 0;
|
---|
[748] | 651 | while (pciS && (INT)pciS != -1 && x < numS) {
|
---|
[362] | 652 | if (reset)
|
---|
[2] | 653 | pciS->flags = 0;
|
---|
| 654 | pciSa[x] = pciS;
|
---|
| 655 | x++;
|
---|
[362] | 656 | if (!slow)
|
---|
[551] | 657 | pciS = (PCNRITEM) pciS->rc.preccNextRecord;
|
---|
[2] | 658 | else
|
---|
[551] | 659 | pciS = (PCNRITEM) WinSendMsg(hwndCnrS, CM_QUERYRECORD, MPFROMP(pciS),
|
---|
| 660 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[362] | 661 | if (!(x % 500))
|
---|
[2] | 662 | DosSleep(1L);
|
---|
[362] | 663 | else if (!(x % 50))
|
---|
[748] | 664 | DosSleep(1);
|
---|
[2] | 665 | }
|
---|
[362] | 666 | if (numS != x) {
|
---|
| 667 | if (!slow) {
|
---|
[2] | 668 | slow = TRUE;
|
---|
| 669 | goto Restart;
|
---|
| 670 | }
|
---|
| 671 | free(pciSa);
|
---|
| 672 | free(pciDa);
|
---|
[551] | 673 | Runtime_Error(pszSrcFile, __LINE__, "numS (%lu) != x (%lu)", numS, x);
|
---|
[2] | 674 | return;
|
---|
| 675 | }
|
---|
| 676 |
|
---|
[362] | 677 | if (reset) {
|
---|
[551] | 678 | for (x = 0; x < numS; x++) {
|
---|
[748] | 679 |
|
---|
[730] | 680 | if (!*pciSa[x]->pszFileName || !*pciDa[x]->pszFileName)
|
---|
[551] | 681 | continue;
|
---|
[748] | 682 |
|
---|
[2] | 683 | pciSa[x]->flags |= CNRITEM_EXISTS;
|
---|
| 684 | pciDa[x]->flags |= CNRITEM_EXISTS;
|
---|
[362] | 685 | if (pciSa[x]->cbFile + pciSa[x]->easize >
|
---|
[551] | 686 | pciDa[x]->cbFile + pciDa[x]->easize) {
|
---|
| 687 | pciSa[x]->flags |= CNRITEM_LARGER;
|
---|
| 688 | pciDa[x]->flags |= CNRITEM_SMALLER;
|
---|
[2] | 689 | }
|
---|
[362] | 690 | else if (pciSa[x]->cbFile + pciSa[x]->easize <
|
---|
[551] | 691 | pciDa[x]->cbFile + pciDa[x]->easize) {
|
---|
| 692 | pciSa[x]->flags |= CNRITEM_SMALLER;
|
---|
| 693 | pciDa[x]->flags |= CNRITEM_LARGER;
|
---|
[2] | 694 | }
|
---|
[362] | 695 | if ((pciSa[x]->date.year > pciDa[x]->date.year) ? TRUE :
|
---|
[551] | 696 | (pciSa[x]->date.year < pciDa[x]->date.year) ? FALSE :
|
---|
| 697 | (pciSa[x]->date.month > pciDa[x]->date.month) ? TRUE :
|
---|
| 698 | (pciSa[x]->date.month < pciDa[x]->date.month) ? FALSE :
|
---|
| 699 | (pciSa[x]->date.day > pciDa[x]->date.day) ? TRUE :
|
---|
| 700 | (pciSa[x]->date.day < pciDa[x]->date.day) ? FALSE :
|
---|
| 701 | (pciSa[x]->time.hours > pciDa[x]->time.hours) ? TRUE :
|
---|
| 702 | (pciSa[x]->time.hours < pciDa[x]->time.hours) ? FALSE :
|
---|
| 703 | (pciSa[x]->time.minutes > pciDa[x]->time.minutes) ? TRUE :
|
---|
| 704 | (pciSa[x]->time.minutes < pciDa[x]->time.minutes) ? FALSE :
|
---|
| 705 | (pciSa[x]->time.seconds > pciDa[x]->time.seconds) ? TRUE :
|
---|
| 706 | (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? FALSE : FALSE) {
|
---|
| 707 | pciSa[x]->flags |= CNRITEM_NEWER;
|
---|
| 708 | pciDa[x]->flags |= CNRITEM_OLDER;
|
---|
[2] | 709 | }
|
---|
[362] | 710 | else if ((pciSa[x]->date.year < pciDa[x]->date.year) ? TRUE :
|
---|
[551] | 711 | (pciSa[x]->date.year > pciDa[x]->date.year) ? FALSE :
|
---|
| 712 | (pciSa[x]->date.month < pciDa[x]->date.month) ? TRUE :
|
---|
| 713 | (pciSa[x]->date.month > pciDa[x]->date.month) ? FALSE :
|
---|
| 714 | (pciSa[x]->date.day < pciDa[x]->date.day) ? TRUE :
|
---|
| 715 | (pciSa[x]->date.day > pciDa[x]->date.day) ? FALSE :
|
---|
| 716 | (pciSa[x]->time.hours < pciDa[x]->time.hours) ? TRUE :
|
---|
| 717 | (pciSa[x]->time.hours > pciDa[x]->time.hours) ? FALSE :
|
---|
| 718 | (pciSa[x]->time.minutes < pciDa[x]->time.minutes) ? TRUE :
|
---|
| 719 | (pciSa[x]->time.minutes > pciDa[x]->time.minutes) ? FALSE :
|
---|
| 720 | (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? TRUE :
|
---|
| 721 | (pciSa[x]->time.seconds > pciDa[x]->time.seconds) ? FALSE :
|
---|
| 722 | FALSE) {
|
---|
| 723 | pciSa[x]->flags |= CNRITEM_OLDER;
|
---|
| 724 | pciDa[x]->flags |= CNRITEM_NEWER;
|
---|
[2] | 725 | }
|
---|
[362] | 726 | if (!(x % 500))
|
---|
[551] | 727 | DosSleep(1L);
|
---|
[362] | 728 | else if (!(x % 50))
|
---|
[748] | 729 | DosSleep(1);
|
---|
[2] | 730 | }
|
---|
| 731 | }
|
---|
| 732 |
|
---|
[551] | 733 | switch (action) {
|
---|
| 734 | case IDM_SELECTIDENTICAL:
|
---|
| 735 | for (x = 0; x < numS; x++) {
|
---|
[748] | 736 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
|
---|
[730] | 737 | if (*pciSa[x]->pszFileName &&
|
---|
[748] | 738 | pciSa[x]->flags & CNRITEM_EXISTS &&
|
---|
| 739 | ~pciSa[x]->flags & CNRITEM_SMALLER &&
|
---|
| 740 | ~pciSa[x]->flags & CNRITEM_LARGER &&
|
---|
| 741 | ~pciSa[x]->flags & CNRITEM_NEWER &&
|
---|
| 742 | ~pciSa[x]->flags & CNRITEM_OLDER) {
|
---|
| 743 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 744 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 745 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[748] | 746 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 747 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 748 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 749 | }
|
---|
| 750 | if (!(x % 500))
|
---|
| 751 | DosSleep(1L);
|
---|
| 752 | else if (!(x % 50))
|
---|
[748] | 753 | DosSleep(1);
|
---|
[2] | 754 | }
|
---|
[551] | 755 | }
|
---|
| 756 | break;
|
---|
[2] | 757 |
|
---|
[551] | 758 | case IDM_SELECTSAME:
|
---|
| 759 | for (x = 0; x < numS; x++) {
|
---|
[748] | 760 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
[730] | 761 | *pciSa[x]->pszFileName &&
|
---|
[748] | 762 | pciSa[x]->flags & CNRITEM_EXISTS &&
|
---|
| 763 | ~pciSa[x]->flags & CNRITEM_SMALLER &&
|
---|
| 764 | ~pciSa[x]->flags & CNRITEM_LARGER) {
|
---|
| 765 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 766 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 767 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[748] | 768 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 769 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 770 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 771 | }
|
---|
[551] | 772 | if (!(x % 500))
|
---|
| 773 | DosSleep(1L);
|
---|
| 774 | else if (!(x % 50))
|
---|
[748] | 775 | DosSleep(1);
|
---|
[551] | 776 | }
|
---|
| 777 | break;
|
---|
[2] | 778 |
|
---|
[551] | 779 | case IDM_SELECTSAMECONTENT:
|
---|
[690] | 780 | // fixme why?
|
---|
[551] | 781 | for (x = 0; x < numS; x++) {
|
---|
| 782 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
[730] | 783 | *pciSa[x]->pszFileName &&
|
---|
| 784 | *pciDa[x]->pszFileName &&
|
---|
[551] | 785 | pciSa[x]->flags & CNRITEM_EXISTS &&
|
---|
[748] | 786 | pciDa[x]->flags & CNRITEM_EXISTS)
|
---|
| 787 | {
|
---|
[551] | 788 | FILE *fp1 = NULL;
|
---|
| 789 | FILE *fp2 = NULL;
|
---|
| 790 | BOOL gotMatch = FALSE;
|
---|
| 791 | UINT errLineNo = 0;
|
---|
| 792 | UINT compErrno = 0;
|
---|
| 793 | CHAR buf1[1024];
|
---|
| 794 | CHAR buf2[1024];
|
---|
| 795 | HAB hab = WinQueryAnchorBlock(hwndCnrS);
|
---|
[317] | 796 |
|
---|
[730] | 797 | fp1 = _fsopen(pciSa[x]->pszFileName, "rb", SH_DENYNO);
|
---|
[551] | 798 | if (!fp1) {
|
---|
| 799 | errLineNo = __LINE__;
|
---|
| 800 | compErrno = errno;
|
---|
| 801 | }
|
---|
| 802 | else {
|
---|
[730] | 803 | fp2 = _fsopen(pciDa[x]->pszFileName, "rb", SH_DENYNO);
|
---|
[551] | 804 | if (!fp2) {
|
---|
[362] | 805 | errLineNo = __LINE__;
|
---|
| 806 | compErrno = errno;
|
---|
[317] | 807 | }
|
---|
| 808 | else {
|
---|
[551] | 809 | size_t len1 = filelength(fileno(fp1));
|
---|
| 810 | size_t len2 = filelength(fileno(fp2));
|
---|
| 811 |
|
---|
| 812 | if (len1 == len2) {
|
---|
| 813 | setbuf(fp1, NULL);
|
---|
| 814 | setbuf(fp2, NULL);
|
---|
| 815 | while (WinIsWindow(hab, hwndCnrS)) {
|
---|
| 816 | size_t numread1 = fread(buf1, 1, 1024, fp1);
|
---|
| 817 | size_t numread2 = fread(buf2, 1, 1024, fp2);
|
---|
| 818 |
|
---|
| 819 | if (!numread1 || !numread2 || numread1 != numread2) {
|
---|
| 820 | if (ferror(fp1) || ferror(fp2)) {
|
---|
| 821 | errLineNo = __LINE__;
|
---|
| 822 | compErrno = errno;
|
---|
[317] | 823 | }
|
---|
[551] | 824 | else if (feof(fp1) && feof(fp2))
|
---|
| 825 | gotMatch = TRUE;
|
---|
| 826 | break;
|
---|
| 827 | }
|
---|
| 828 | else if (memcmp(buf1, buf2, numread1))
|
---|
| 829 | break;
|
---|
[690] | 830 | } // while
|
---|
| 831 | } // same len
|
---|
[551] | 832 | }
|
---|
| 833 | }
|
---|
[317] | 834 |
|
---|
[551] | 835 | if (fp1)
|
---|
| 836 | fclose(fp1);
|
---|
[317] | 837 |
|
---|
[551] | 838 | if (fp2)
|
---|
| 839 | fclose(fp2);
|
---|
[317] | 840 |
|
---|
[551] | 841 | if (errLineNo) {
|
---|
| 842 | Runtime_Error(pszSrcFile, errLineNo,
|
---|
| 843 | "error %d while comparing", compErrno);
|
---|
| 844 | }
|
---|
| 845 | if (gotMatch) {
|
---|
[748] | 846 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 847 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 848 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[748] | 849 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 850 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 851 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 852 | }
|
---|
| 853 | }
|
---|
| 854 | if (!(x % 500))
|
---|
| 855 | DosSleep(1L);
|
---|
| 856 | else if (!(x % 50))
|
---|
[748] | 857 | DosSleep(1);
|
---|
[551] | 858 | } // for records
|
---|
| 859 | break;
|
---|
[317] | 860 |
|
---|
[551] | 861 | case IDM_SELECTBOTH:
|
---|
| 862 | for (x = 0; x < numS; x++) {
|
---|
[748] | 863 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 864 | *pciSa[x]->pszFileName &&
|
---|
| 865 | pciSa[x]->flags & CNRITEM_EXISTS) {
|
---|
| 866 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 867 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 868 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[748] | 869 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 870 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 871 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 872 | }
|
---|
[551] | 873 | if (!(x % 500))
|
---|
| 874 | DosSleep(1L);
|
---|
| 875 | else if (!(x % 50))
|
---|
[748] | 876 | DosSleep(1);
|
---|
[551] | 877 | }
|
---|
| 878 | break;
|
---|
[2] | 879 |
|
---|
[551] | 880 | case IDM_SELECTONE:
|
---|
| 881 | for (x = 0; x < numS; x++) {
|
---|
[748] | 882 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 883 | *pciSa[x]->pszFileName &&
|
---|
| 884 | ~pciSa[x]->flags & CNRITEM_EXISTS)
|
---|
| 885 | {
|
---|
| 886 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 887 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 888 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 889 | }
|
---|
[748] | 890 | else if (*pciDa[x]->pszFileName &&
|
---|
| 891 | ~pciDa[x]->flags & CNRITEM_EXISTS) {
|
---|
| 892 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 893 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 894 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 895 | }
|
---|
| 896 | if (!(x % 500))
|
---|
| 897 | DosSleep(1L);
|
---|
| 898 | else if (!(x % 50))
|
---|
[748] | 899 | DosSleep(1);
|
---|
[551] | 900 | }
|
---|
| 901 | break;
|
---|
[2] | 902 |
|
---|
[551] | 903 | case IDM_SELECTBIGGER:
|
---|
| 904 | for (x = 0; x < numS; x++) {
|
---|
[748] | 905 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 906 | pciSa[x]->flags & CNRITEM_LARGER) {
|
---|
| 907 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 908 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 909 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 910 | }
|
---|
[748] | 911 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 912 | *pciDa[x]->pszFileName &&
|
---|
| 913 | pciDa[x]->flags & CNRITEM_LARGER) {
|
---|
| 914 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 915 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 916 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 917 | }
|
---|
| 918 | if (!(x % 500))
|
---|
| 919 | DosSleep(1L);
|
---|
| 920 | else if (!(x % 50))
|
---|
[748] | 921 | DosSleep(1);
|
---|
[551] | 922 | }
|
---|
| 923 | break;
|
---|
[2] | 924 |
|
---|
[551] | 925 | case IDM_SELECTSMALLER:
|
---|
| 926 | for (x = 0; x < numS; x++) {
|
---|
[748] | 927 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 928 | *pciSa[x]->pszFileName &&
|
---|
| 929 | pciSa[x]->flags & CNRITEM_SMALLER) {
|
---|
| 930 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 931 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 932 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 933 | }
|
---|
[748] | 934 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 935 | *pciDa[x]->pszFileName &&
|
---|
| 936 | pciDa[x]->flags & CNRITEM_SMALLER) {
|
---|
| 937 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 938 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 939 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 940 | }
|
---|
| 941 | if (!(x % 500))
|
---|
| 942 | DosSleep(1L);
|
---|
| 943 | else if (!(x % 50))
|
---|
[748] | 944 | DosSleep(1);
|
---|
[551] | 945 | }
|
---|
| 946 | break;
|
---|
[2] | 947 |
|
---|
[551] | 948 | case IDM_SELECTNEWER:
|
---|
| 949 | for (x = 0; x < numS; x++) {
|
---|
[748] | 950 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 951 | *pciSa[x]->pszFileName &&
|
---|
| 952 | pciSa[x]->flags & CNRITEM_NEWER) {
|
---|
| 953 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 954 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 955 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 956 | }
|
---|
[748] | 957 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 958 | *pciDa[x]->pszFileName &&
|
---|
| 959 | pciDa[x]->flags & CNRITEM_NEWER) {
|
---|
| 960 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 961 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 962 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 963 | }
|
---|
| 964 | if (!(x % 500))
|
---|
| 965 | DosSleep(1L);
|
---|
| 966 | else if (!(x % 50))
|
---|
[748] | 967 | DosSleep(1);
|
---|
[551] | 968 | }
|
---|
| 969 | break;
|
---|
[2] | 970 |
|
---|
[551] | 971 | case IDM_SELECTOLDER:
|
---|
| 972 | for (x = 0; x < numS; x++) {
|
---|
[748] | 973 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 974 | *pciSa[x]->pszFileName &&
|
---|
| 975 | pciSa[x]->flags & CNRITEM_OLDER) {
|
---|
| 976 | if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 977 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 978 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 979 | }
|
---|
[748] | 980 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 981 | *pciDa[x]->pszFileName &&
|
---|
| 982 | pciDa[x]->flags & CNRITEM_OLDER) {
|
---|
| 983 | if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
[551] | 984 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 985 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
| 986 | }
|
---|
| 987 | if (!(x % 500))
|
---|
| 988 | DosSleep(1L);
|
---|
| 989 | else if (!(x % 50))
|
---|
[748] | 990 | DosSleep(1);
|
---|
[551] | 991 | }
|
---|
| 992 | break;
|
---|
[2] | 993 |
|
---|
[551] | 994 | case IDM_DESELECTBOTH:
|
---|
| 995 | for (x = 0; x < numS; x++) {
|
---|
[748] | 996 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 997 | *pciSa[x]->pszFileName &&
|
---|
| 998 | pciSa[x]->flags & CNRITEM_EXISTS) {
|
---|
[551] | 999 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1000 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1001 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1002 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1003 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1004 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1005 | }
|
---|
[551] | 1006 | if (!(x % 500))
|
---|
| 1007 | DosSleep(1L);
|
---|
| 1008 | else if (!(x % 50))
|
---|
[748] | 1009 | DosSleep(1);
|
---|
[551] | 1010 | }
|
---|
| 1011 | break;
|
---|
[2] | 1012 |
|
---|
[551] | 1013 | case IDM_DESELECTONE:
|
---|
| 1014 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1015 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1016 | *pciSa[x]->pszFileName &&
|
---|
| 1017 | ~pciSa[x]->flags & CNRITEM_EXISTS) {
|
---|
[551] | 1018 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1019 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1020 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1021 | }
|
---|
[748] | 1022 | else if (*pciDa[x]->pszFileName &&
|
---|
| 1023 | ~pciDa[x]->flags & CNRITEM_EXISTS) {
|
---|
[551] | 1024 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1025 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1026 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1027 | }
|
---|
| 1028 | if (!(x % 500))
|
---|
| 1029 | DosSleep(1L);
|
---|
| 1030 | else if (!(x % 50))
|
---|
[748] | 1031 | DosSleep(1);
|
---|
[551] | 1032 | }
|
---|
| 1033 | break;
|
---|
[2] | 1034 |
|
---|
[551] | 1035 | case IDM_DESELECTBIGGER:
|
---|
| 1036 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1037 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1038 | *pciSa[x]->pszFileName &&
|
---|
| 1039 | pciSa[x]->flags & CNRITEM_LARGER) {
|
---|
[551] | 1040 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1041 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1042 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1043 | }
|
---|
[748] | 1044 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1045 | *pciDa[x]->pszFileName &&
|
---|
| 1046 | pciDa[x]->flags & CNRITEM_LARGER) {
|
---|
[551] | 1047 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1048 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1049 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1050 | }
|
---|
| 1051 | if (!(x % 500))
|
---|
| 1052 | DosSleep(1L);
|
---|
| 1053 | else if (!(x % 50))
|
---|
[748] | 1054 | DosSleep(1);
|
---|
[551] | 1055 | }
|
---|
| 1056 | break;
|
---|
[2] | 1057 |
|
---|
[551] | 1058 | case IDM_DESELECTSMALLER:
|
---|
| 1059 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1060 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1061 | *pciSa[x]->pszFileName &&
|
---|
| 1062 | pciSa[x]->flags & CNRITEM_SMALLER) {
|
---|
[551] | 1063 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1064 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1065 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1066 | }
|
---|
[748] | 1067 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1068 | *pciDa[x]->pszFileName &&
|
---|
| 1069 | pciDa[x]->flags & CNRITEM_SMALLER) {
|
---|
[551] | 1070 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1071 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1072 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1073 | }
|
---|
| 1074 | if (!(x % 500))
|
---|
| 1075 | DosSleep(1L);
|
---|
| 1076 | else if (!(x % 50))
|
---|
[748] | 1077 | DosSleep(1);
|
---|
[551] | 1078 | }
|
---|
| 1079 | break;
|
---|
[2] | 1080 |
|
---|
[551] | 1081 | case IDM_DESELECTNEWER:
|
---|
| 1082 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1083 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1084 | *pciSa[x]->pszFileName &&
|
---|
| 1085 | pciSa[x]->flags & CNRITEM_NEWER) {
|
---|
[551] | 1086 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1087 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1088 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1089 | }
|
---|
[748] | 1090 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1091 | *pciDa[x]->pszFileName &&
|
---|
| 1092 | pciDa[x]->flags & CNRITEM_NEWER) {
|
---|
[551] | 1093 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1094 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1095 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1096 | }
|
---|
| 1097 | if (!(x % 500))
|
---|
| 1098 | DosSleep(1L);
|
---|
| 1099 | else if (!(x % 50))
|
---|
[748] | 1100 | DosSleep(1);
|
---|
[551] | 1101 | }
|
---|
| 1102 | break;
|
---|
[2] | 1103 |
|
---|
[551] | 1104 | case IDM_DESELECTOLDER:
|
---|
| 1105 | for (x = 0; x < numS; x++) {
|
---|
[748] | 1106 | if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1107 | *pciSa[x]->pszFileName &&
|
---|
| 1108 | pciSa[x]->flags & CNRITEM_OLDER) {
|
---|
[551] | 1109 | if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1110 | WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
|
---|
| 1111 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1112 | }
|
---|
[748] | 1113 | else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1114 | *pciDa[x]->pszFileName &&
|
---|
| 1115 | pciDa[x]->flags & CNRITEM_OLDER) {
|
---|
[551] | 1116 | if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
|
---|
| 1117 | WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
|
---|
| 1118 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
| 1119 | }
|
---|
| 1120 | if (!(x % 500))
|
---|
| 1121 | DosSleep(1L);
|
---|
| 1122 | else if (!(x % 50))
|
---|
[748] | 1123 | DosSleep(1);
|
---|
[551] | 1124 | }
|
---|
| 1125 | break;
|
---|
[2] | 1126 |
|
---|
[551] | 1127 | default:
|
---|
| 1128 | break;
|
---|
[2] | 1129 | }
|
---|
| 1130 |
|
---|
[362] | 1131 | if (reset) {
|
---|
| 1132 | while (numS) {
|
---|
[551] | 1133 | WinSendMsg(hwndCnrS, CM_INVALIDATERECORD,
|
---|
| 1134 | MPFROMP(pciSa), MPFROM2SHORT((min(numS, 65535)), 0));
|
---|
[748] | 1135 | DosSleep(1);
|
---|
[551] | 1136 | WinSendMsg(hwndCnrD, CM_INVALIDATERECORD,
|
---|
| 1137 | MPFROMP(pciDa), MPFROM2SHORT((min(numD, 65535)), 0));
|
---|
| 1138 | numS -= min(numS, 65535);
|
---|
[362] | 1139 | if (numS)
|
---|
[748] | 1140 | DosSleep(1);
|
---|
[2] | 1141 | }
|
---|
| 1142 | }
|
---|
| 1143 |
|
---|
| 1144 | free(pciSa);
|
---|
| 1145 | free(pciDa);
|
---|
| 1146 | DosPostEventSem(CompactSem);
|
---|
| 1147 | }
|
---|
| 1148 |
|
---|
[551] | 1149 | struct SS
|
---|
| 1150 | {
|
---|
| 1151 | PCNRITEM pci;
|
---|
| 1152 | BOOL unique, all, smallest, largest, newest, oldest;
|
---|
[2] | 1153 | };
|
---|
| 1154 |
|
---|
[551] | 1155 | struct Cnr
|
---|
| 1156 | {
|
---|
| 1157 | HWND hwndCnr;
|
---|
| 1158 | ULONG numfiles;
|
---|
[2] | 1159 | struct SS *ss;
|
---|
| 1160 | };
|
---|
| 1161 |
|
---|
[551] | 1162 | static int CompSSNamesB(const void *s1, const void *s2)
|
---|
[317] | 1163 | {
|
---|
[2] | 1164 | struct SS *ss2 = (struct SS *)s2;
|
---|
| 1165 |
|
---|
[748] | 1166 | return stricmp((PSZ)s1, ss2->pci->pszFileName);
|
---|
[2] | 1167 | }
|
---|
| 1168 |
|
---|
[551] | 1169 | static int CompSSNames(const void *s1, const void *s2)
|
---|
[317] | 1170 | {
|
---|
[2] | 1171 | struct SS *ss1 = (struct SS *)s1;
|
---|
| 1172 | struct SS *ss2 = (struct SS *)s2;
|
---|
| 1173 |
|
---|
[551] | 1174 | return stricmp(ss1->pci->pszFileName, ss2->pci->pszFileName);
|
---|
[2] | 1175 | }
|
---|
| 1176 |
|
---|
[551] | 1177 | VOID FreeCnrs(struct Cnr * Cnrs, INT numw)
|
---|
[317] | 1178 | {
|
---|
[2] | 1179 | register INT z;
|
---|
| 1180 |
|
---|
[551] | 1181 | for (z = 0; z < numw; z++) {
|
---|
[362] | 1182 | if (Cnrs[z].ss)
|
---|
[2] | 1183 | free(Cnrs[z].ss);
|
---|
| 1184 | }
|
---|
| 1185 | free(Cnrs);
|
---|
| 1186 | DosPostEventSem(CompactSem);
|
---|
| 1187 | }
|
---|
| 1188 |
|
---|
[551] | 1189 | VOID SpecialSelect2(HWND hwndParent, INT action)
|
---|
[317] | 1190 | {
|
---|
[551] | 1191 | PCNRITEM pci;
|
---|
| 1192 | HENUM henum;
|
---|
| 1193 | HWND hwnd;
|
---|
| 1194 | register INT numwindows = 0, w, x, z, cmp;
|
---|
| 1195 | struct Cnr *Cnrs = NULL;
|
---|
| 1196 | struct SS *bsres;
|
---|
[2] | 1197 |
|
---|
[362] | 1198 | if (!hwndParent)
|
---|
[2] | 1199 | return;
|
---|
| 1200 |
|
---|
| 1201 | /* count directory containers, build array of hwnds */
|
---|
| 1202 | henum = WinBeginEnumWindows(hwndParent);
|
---|
[362] | 1203 | while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE) {
|
---|
[551] | 1204 | if (WinWindowFromID(WinWindowFromID(hwnd, FID_CLIENT), DIR_CNR)) {
|
---|
| 1205 | Cnrs =
|
---|
| 1206 | xrealloc(Cnrs, (numwindows + 1) * sizeof(struct Cnr), pszSrcFile,
|
---|
| 1207 | __LINE__);
|
---|
[362] | 1208 | if (!Cnrs) {
|
---|
[551] | 1209 | Notify(GetPString(IDS_OUTOFMEMORY));
|
---|
| 1210 | return;
|
---|
[2] | 1211 | }
|
---|
[551] | 1212 | memset(&Cnrs[numwindows], 0, sizeof(struct Cnr));
|
---|
[2] | 1213 | Cnrs[numwindows].hwndCnr = WinWindowFromID(WinWindowFromID(hwnd,
|
---|
[551] | 1214 | FID_CLIENT),
|
---|
| 1215 | DIR_CNR);
|
---|
[2] | 1216 | numwindows++;
|
---|
| 1217 | }
|
---|
| 1218 | }
|
---|
| 1219 | WinEndEnumWindows(henum);
|
---|
[362] | 1220 | if (numwindows < 2) {
|
---|
[551] | 1221 | FreeCnrs(Cnrs, numwindows);
|
---|
[362] | 1222 | Runtime_Error(pszSrcFile, __LINE__, "expected two windows");
|
---|
[2] | 1223 | Notify(GetPString(IDS_COMPSEL2ORMORETEXT));
|
---|
| 1224 | return;
|
---|
| 1225 | }
|
---|
[362] | 1226 | if (numwindows > 4) {
|
---|
[2] | 1227 | WinSendMsg(Cnrs[0].
|
---|
[551] | 1228 | hwndCnr,
|
---|
| 1229 | UM_NOTIFY, MPFROMP(GetPString(IDS_BUILDINGLISTSTEXT)), MPVOID);
|
---|
[748] | 1230 | DosSleep(1);
|
---|
[2] | 1231 | }
|
---|
| 1232 |
|
---|
| 1233 | /* count records, build array of pointers to records */
|
---|
[551] | 1234 | for (z = 0; z < numwindows; z++) {
|
---|
| 1235 | pci = (PCNRITEM) WinSendMsg(Cnrs[z].hwndCnr,
|
---|
| 1236 | CM_QUERYRECORD,
|
---|
| 1237 | MPVOID,
|
---|
| 1238 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
[2] | 1239 | x = 0;
|
---|
[748] | 1240 | while (pci && (INT)pci != -1) {
|
---|
| 1241 | if (~pci->rc.flRecordAttr & CRA_FILTERED &&
|
---|
| 1242 | ~pci->attrFile & FILE_DIRECTORY) {
|
---|
[551] | 1243 | Cnrs[z].ss =
|
---|
| 1244 | xrealloc(Cnrs[z].ss, (x + 1) * sizeof(struct SS), pszSrcFile,
|
---|
| 1245 | __LINE__);
|
---|
| 1246 | if (!Cnrs[z].ss) {
|
---|
| 1247 | FreeCnrs(Cnrs, numwindows);
|
---|
| 1248 | Notify(GetPString(IDS_OUTOFMEMORY));
|
---|
| 1249 | return;
|
---|
| 1250 | }
|
---|
| 1251 | memset(&Cnrs[z].ss[x], 0, sizeof(struct SS));
|
---|
| 1252 | Cnrs[z].ss[x].pci = pci;
|
---|
| 1253 | x++;
|
---|
[2] | 1254 | }
|
---|
[551] | 1255 | pci = (PCNRITEM) WinSendMsg(Cnrs[z].hwndCnr,
|
---|
| 1256 | CM_QUERYRECORD,
|
---|
| 1257 | MPFROMP(pci),
|
---|
| 1258 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[2] | 1259 | }
|
---|
[748] | 1260 | DosSleep(1);
|
---|
[2] | 1261 | Cnrs[z].numfiles = x;
|
---|
[362] | 1262 | if (Cnrs[z].numfiles)
|
---|
[551] | 1263 | qsort(Cnrs[z].ss, Cnrs[z].numfiles, sizeof(struct SS), CompSSNames);
|
---|
[2] | 1264 | }
|
---|
| 1265 |
|
---|
[551] | 1266 | for (z = 0; z < numwindows; z++) {
|
---|
| 1267 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
[2] | 1268 | Cnrs[z].ss[x].all = Cnrs[z].ss[x].unique = Cnrs[z].ss[x].newest =
|
---|
[551] | 1269 | Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].smallest =
|
---|
| 1270 | Cnrs[z].ss[x].largest = TRUE;
|
---|
| 1271 | for (w = 0; w < numwindows; w++) {
|
---|
| 1272 | if (w != z && Cnrs[w].numfiles) {
|
---|
| 1273 | bsres = (struct SS *)bsearch(Cnrs[z].ss[x].pci->pszFileName,
|
---|
| 1274 | Cnrs[w].ss, Cnrs[w].numfiles,
|
---|
| 1275 | sizeof(struct SS), CompSSNamesB);
|
---|
| 1276 | if (bsres) {
|
---|
| 1277 | Cnrs[z].ss[x].unique = FALSE;
|
---|
| 1278 | if (Cnrs[z].ss[x].pci->cbFile + Cnrs[z].ss[x].pci->easize >
|
---|
| 1279 | bsres->pci->cbFile + bsres->pci->easize)
|
---|
| 1280 | Cnrs[z].ss[x].smallest = FALSE;
|
---|
| 1281 | if (Cnrs[z].ss[x].pci->cbFile + Cnrs[z].ss[x].pci->easize <
|
---|
| 1282 | bsres->pci->cbFile + bsres->pci->easize)
|
---|
| 1283 | Cnrs[z].ss[x].largest = FALSE;
|
---|
| 1284 | cmp =
|
---|
| 1285 | (Cnrs[z].ss[x].pci->date.year >
|
---|
| 1286 | bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year <
|
---|
| 1287 | bsres->pci->date.
|
---|
| 1288 | year) ? FALSE : (Cnrs[z].
|
---|
| 1289 | ss[x].pci->
|
---|
| 1290 | date.month >
|
---|
| 1291 | bsres->pci->
|
---|
| 1292 | date.
|
---|
| 1293 | month) ? TRUE
|
---|
| 1294 | : (Cnrs[z].ss[x].pci->date.month <
|
---|
| 1295 | bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.
|
---|
| 1296 | day >
|
---|
| 1297 | bsres->pci->date.
|
---|
| 1298 | day) ? TRUE : (Cnrs[z].
|
---|
| 1299 | ss[x].pci->
|
---|
| 1300 | date.day <
|
---|
| 1301 | bsres->
|
---|
| 1302 | pci->date.
|
---|
| 1303 | day) ?
|
---|
| 1304 | FALSE : (Cnrs[z].ss[x].pci->time.hours >
|
---|
| 1305 | bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->
|
---|
| 1306 | time.hours <
|
---|
| 1307 | bsres->pci->time.
|
---|
| 1308 | hours) ? FALSE
|
---|
| 1309 | : (Cnrs[z].ss[x].pci->time.minutes >
|
---|
| 1310 | bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
| 1311 | minutes <
|
---|
| 1312 | bsres->pci->time.
|
---|
| 1313 | minutes) ? FALSE
|
---|
| 1314 | : (Cnrs[z].ss[x].pci->time.seconds >
|
---|
| 1315 | bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
| 1316 | seconds <
|
---|
| 1317 | bsres->pci->time.
|
---|
| 1318 | seconds) ? FALSE : FALSE;
|
---|
| 1319 | if (!cmp)
|
---|
| 1320 | Cnrs[z].ss[x].newest = FALSE;
|
---|
| 1321 | cmp =
|
---|
| 1322 | (Cnrs[z].ss[x].pci->date.year <
|
---|
| 1323 | bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year >
|
---|
| 1324 | bsres->pci->date.
|
---|
| 1325 | year) ? FALSE : (Cnrs[z].
|
---|
| 1326 | ss[x].pci->
|
---|
| 1327 | date.month <
|
---|
| 1328 | bsres->pci->
|
---|
| 1329 | date.
|
---|
| 1330 | month) ? TRUE
|
---|
| 1331 | : (Cnrs[z].ss[x].pci->date.month >
|
---|
| 1332 | bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.
|
---|
| 1333 | day <
|
---|
| 1334 | bsres->pci->date.
|
---|
| 1335 | day) ? TRUE : (Cnrs[z].
|
---|
| 1336 | ss[x].pci->
|
---|
| 1337 | date.day >
|
---|
| 1338 | bsres->
|
---|
| 1339 | pci->date.
|
---|
| 1340 | day) ?
|
---|
| 1341 | FALSE : (Cnrs[z].ss[x].pci->time.hours <
|
---|
| 1342 | bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->
|
---|
| 1343 | time.hours >
|
---|
| 1344 | bsres->pci->time.
|
---|
| 1345 | hours) ? FALSE
|
---|
| 1346 | : (Cnrs[z].ss[x].pci->time.minutes <
|
---|
| 1347 | bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
| 1348 | minutes >
|
---|
| 1349 | bsres->pci->time.
|
---|
| 1350 | minutes) ? FALSE
|
---|
| 1351 | : (Cnrs[z].ss[x].pci->time.seconds <
|
---|
| 1352 | bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
| 1353 | seconds >
|
---|
| 1354 | bsres->pci->time.
|
---|
| 1355 | seconds) ? FALSE : FALSE;
|
---|
| 1356 | if (!cmp)
|
---|
| 1357 | Cnrs[z].ss[x].oldest = FALSE;
|
---|
| 1358 | cmp = 0;
|
---|
| 1359 | break;
|
---|
| 1360 | }
|
---|
| 1361 | else
|
---|
| 1362 | Cnrs[z].ss[x].all = FALSE;
|
---|
| 1363 | }
|
---|
[2] | 1364 | }
|
---|
[362] | 1365 | if (Cnrs[z].ss[x].unique)
|
---|
[551] | 1366 | Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].newest = Cnrs[z].ss[x].all =
|
---|
| 1367 | Cnrs[z].ss[x].largest = Cnrs[z].ss[x].smallest = FALSE;
|
---|
[748] | 1368 | DosSleep(1);
|
---|
[2] | 1369 | }
|
---|
| 1370 | DosSleep(1L);
|
---|
| 1371 | }
|
---|
| 1372 |
|
---|
[551] | 1373 | switch (action) {
|
---|
| 1374 | case IDM_SELECTBOTH:
|
---|
| 1375 | for (z = 0; z < numwindows; z++) {
|
---|
| 1376 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1377 | if (Cnrs[z].ss[x].all)
|
---|
| 1378 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1379 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1380 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1381 | }
|
---|
[748] | 1382 | DosSleep(1);
|
---|
[551] | 1383 | }
|
---|
| 1384 | break;
|
---|
| 1385 | case IDM_SELECTMORE:
|
---|
| 1386 | for (z = 0; z < numwindows; z++) {
|
---|
| 1387 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1388 | if (!Cnrs[z].ss[x].unique)
|
---|
| 1389 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1390 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1391 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1392 | }
|
---|
[748] | 1393 | DosSleep(1);
|
---|
[551] | 1394 | }
|
---|
| 1395 | break;
|
---|
| 1396 | case IDM_SELECTONE:
|
---|
| 1397 | for (z = 0; z < numwindows; z++) {
|
---|
| 1398 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1399 | if (Cnrs[z].ss[x].unique)
|
---|
| 1400 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1401 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1402 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1403 | }
|
---|
[748] | 1404 | DosSleep(1);
|
---|
[551] | 1405 | }
|
---|
| 1406 | break;
|
---|
| 1407 | case IDM_SELECTNEWER:
|
---|
| 1408 | for (z = 0; z < numwindows; z++) {
|
---|
| 1409 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1410 | if (Cnrs[z].ss[x].newest)
|
---|
| 1411 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1412 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1413 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1414 | }
|
---|
[748] | 1415 | DosSleep(1);
|
---|
[551] | 1416 | }
|
---|
| 1417 | break;
|
---|
| 1418 | case IDM_SELECTOLDER:
|
---|
| 1419 | for (z = 0; z < numwindows; z++) {
|
---|
| 1420 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1421 | if (Cnrs[z].ss[x].oldest)
|
---|
| 1422 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1423 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1424 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1425 | }
|
---|
[748] | 1426 | DosSleep(1);
|
---|
[551] | 1427 | }
|
---|
| 1428 | break;
|
---|
| 1429 | case IDM_SELECTBIGGER:
|
---|
| 1430 | for (z = 0; z < numwindows; z++) {
|
---|
| 1431 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1432 | if (Cnrs[z].ss[x].largest)
|
---|
| 1433 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1434 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1435 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1436 | }
|
---|
[748] | 1437 | DosSleep(1);
|
---|
[551] | 1438 | }
|
---|
| 1439 | break;
|
---|
| 1440 | case IDM_SELECTSMALLER:
|
---|
| 1441 | for (z = 0; z < numwindows; z++) {
|
---|
| 1442 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1443 | if (Cnrs[z].ss[x].smallest)
|
---|
| 1444 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1445 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1446 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
[2] | 1447 | }
|
---|
[748] | 1448 | DosSleep(1);
|
---|
[551] | 1449 | }
|
---|
| 1450 | break;
|
---|
[2] | 1451 |
|
---|
[551] | 1452 | case IDM_DESELECTBOTH:
|
---|
| 1453 | for (z = 0; z < numwindows; z++) {
|
---|
| 1454 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1455 | if (Cnrs[z].ss[x].all)
|
---|
| 1456 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1457 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1458 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1459 | }
|
---|
[748] | 1460 | DosSleep(1);
|
---|
[551] | 1461 | }
|
---|
| 1462 | break;
|
---|
| 1463 | case IDM_DESELECTMORE:
|
---|
| 1464 | for (z = 0; z < numwindows; z++) {
|
---|
| 1465 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1466 | if (!Cnrs[z].ss[x].unique)
|
---|
| 1467 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1468 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1469 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1470 | }
|
---|
[748] | 1471 | DosSleep(1);
|
---|
[551] | 1472 | }
|
---|
| 1473 | break;
|
---|
| 1474 | case IDM_DESELECTONE:
|
---|
| 1475 | for (z = 0; z < numwindows; z++) {
|
---|
| 1476 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1477 | if (Cnrs[z].ss[x].unique)
|
---|
| 1478 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1479 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1480 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1481 | }
|
---|
[748] | 1482 | DosSleep(1);
|
---|
[551] | 1483 | }
|
---|
| 1484 | break;
|
---|
| 1485 | case IDM_DESELECTNEWER:
|
---|
| 1486 | for (z = 0; z < numwindows; z++) {
|
---|
| 1487 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1488 | if (Cnrs[z].ss[x].newest)
|
---|
| 1489 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1490 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1491 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1492 | }
|
---|
[748] | 1493 | DosSleep(1);
|
---|
[551] | 1494 | }
|
---|
| 1495 | break;
|
---|
| 1496 | case IDM_DESELECTOLDER:
|
---|
| 1497 | for (z = 0; z < numwindows; z++) {
|
---|
| 1498 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1499 | if (Cnrs[z].ss[x].oldest)
|
---|
| 1500 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1501 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1502 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1503 | }
|
---|
[748] | 1504 | DosSleep(1);
|
---|
[551] | 1505 | }
|
---|
| 1506 | break;
|
---|
| 1507 | case IDM_DESELECTBIGGER:
|
---|
| 1508 | for (z = 0; z < numwindows; z++) {
|
---|
| 1509 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1510 | if (Cnrs[z].ss[x].largest)
|
---|
| 1511 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1512 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1513 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1514 | }
|
---|
[748] | 1515 | DosSleep(1);
|
---|
[551] | 1516 | }
|
---|
| 1517 | break;
|
---|
| 1518 | case IDM_DESELECTSMALLER:
|
---|
| 1519 | for (z = 0; z < numwindows; z++) {
|
---|
| 1520 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
| 1521 | if (Cnrs[z].ss[x].smallest)
|
---|
| 1522 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
| 1523 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
| 1524 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
[2] | 1525 | }
|
---|
[748] | 1526 | DosSleep(1);
|
---|
[551] | 1527 | }
|
---|
| 1528 | break;
|
---|
[2] | 1529 | }
|
---|
| 1530 |
|
---|
[551] | 1531 | FreeCnrs(Cnrs, numwindows);
|
---|
[2] | 1532 | }
|
---|