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