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