1 |
|
---|
2 | /***********************************************************************
|
---|
3 |
|
---|
4 | $Id: select.c 1212 2008-09-13 06:52:38Z jbs $
|
---|
5 |
|
---|
6 | Container item selection support routines
|
---|
7 |
|
---|
8 | Copyright (c) 1993-98 M. Kimes
|
---|
9 | Copyright (c) 2004, 2008 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 | 06 Apr 07 GKY Work around PM DragInfo and DrgFreeDISH limits
|
---|
19 | 19 Apr 07 SHL Sync with NumItemsToUnhilite mods
|
---|
20 | 12 May 07 SHL Use dcd->ulItemsToUnHilite
|
---|
21 | 14 Jun 07 SHL SelectAll: make odd expression go away
|
---|
22 | 02 Aug 07 SHL Sync with CNRITEM mods
|
---|
23 | 04 Aug 07 SHL Use Runtime_Error
|
---|
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
|
---|
27 | 14 Aug 07 SHL Revert ExpandAll DosSleep to 0
|
---|
28 | 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
|
---|
29 | 26 Aug 07 GKY DosSleep(1) in loops changed to (0)
|
---|
30 | 12 Jan 08 SHL Localize SpecialSelect in comp.c
|
---|
31 | 29 Feb 08 GKY Use xfree where appropriate
|
---|
32 |
|
---|
33 | ***********************************************************************/
|
---|
34 |
|
---|
35 | #include <stdlib.h>
|
---|
36 | #include <string.h>
|
---|
37 | #include <share.h>
|
---|
38 | #include <io.h>
|
---|
39 |
|
---|
40 | #define INCL_DOS
|
---|
41 | #define INCL_WIN
|
---|
42 | #define INCL_LONGLONG
|
---|
43 |
|
---|
44 | #include "fm3dll.h"
|
---|
45 | #include "notebook.h" // Data declaration(s)
|
---|
46 | #include "newview.h" // Data declarations
|
---|
47 | #include "fm3str.h"
|
---|
48 | #include "filldir.h" // RemoveCnrItems
|
---|
49 | #include "makelist.h" // AddToList
|
---|
50 | #include "errutil.h" // Dos_Error...
|
---|
51 | #include "strutil.h" // GetPString
|
---|
52 | #include "select.h"
|
---|
53 | #include "valid.h" // TestCDates
|
---|
54 | #include "misc.h" // CurrentRecord
|
---|
55 | #include "findrec.h" // FindCnrRecord
|
---|
56 | #include "notify.h" // Notify
|
---|
57 | #include "literal.h" // wildcard
|
---|
58 | #include "wrappers.h" // xrealloc
|
---|
59 | #include "strips.h" // bstrip
|
---|
60 | #include "stristr.h" // findstring
|
---|
61 | #include "fortify.h"
|
---|
62 |
|
---|
63 | static PSZ pszSrcFile = __FILE__;
|
---|
64 |
|
---|
65 | VOID UnHilite(HWND hwndCnr, BOOL all, CHAR *** list, ULONG ulItemsToUnHilite)
|
---|
66 | {
|
---|
67 | PCNRITEM pci;
|
---|
68 | UINT numfiles = 0, numalloc = 0;
|
---|
69 | UINT x = 0;
|
---|
70 | INT attribute = CRA_CURSORED;
|
---|
71 |
|
---|
72 | if (all && list && *list) {
|
---|
73 | FreeList(*list);
|
---|
74 | *list = NULL;
|
---|
75 | }
|
---|
76 | pci = (PCNRITEM) CurrentRecord(hwndCnr);
|
---|
77 | if (pci && (INT)pci != -1) {
|
---|
78 | if (pci->rc.flRecordAttr & CRA_SELECTED) {
|
---|
79 | attribute = CRA_SELECTED;
|
---|
80 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
81 | MPFROMSHORT(attribute));
|
---|
82 | }
|
---|
83 | while (pci && (INT)pci != -1) {
|
---|
84 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
85 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
86 | if (!all)
|
---|
87 | break;
|
---|
88 | // Count is one extra to ensure non-zero elsewhere
|
---|
89 | // x is 0 based index
|
---|
90 | if (x + 2 == ulItemsToUnHilite)
|
---|
91 | break;
|
---|
92 | if (list)
|
---|
93 | AddToList(pci->pszFileName, list, &numfiles, &numalloc);
|
---|
94 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
|
---|
95 | MPFROMP(pci), MPFROMSHORT(CRA_SELECTED));
|
---|
96 | x++;
|
---|
97 | }
|
---|
98 | }
|
---|
99 | }
|
---|
100 |
|
---|
101 | VOID SelectList(HWND hwndCnr, BOOL partial, BOOL deselect, BOOL clearfirst,
|
---|
102 | PCNRITEM pciParent, PSZ filename, CHAR ** list)
|
---|
103 | {
|
---|
104 |
|
---|
105 | PCNRITEM pci;
|
---|
106 | register INT x;
|
---|
107 | BOOL foundone = FALSE;
|
---|
108 | ULONG errs = 0;
|
---|
109 |
|
---|
110 | if (clearfirst && !deselect)
|
---|
111 | UnHilite(hwndCnr, TRUE, NULL, 0);
|
---|
112 | if (list && list[0]) {
|
---|
113 | for (x = 0; list[x]; x++) {
|
---|
114 | pci = FindCnrRecord(hwndCnr,
|
---|
115 | list[x], pciParent, partial, partial, TRUE);
|
---|
116 | if (pci) {
|
---|
117 | WinSendMsg(hwndCnr,
|
---|
118 | CM_SETRECORDEMPHASIS,
|
---|
119 | MPFROMP(pci),
|
---|
120 | MPFROM2SHORT((SHORT) ((deselect) ? FALSE : TRUE),
|
---|
121 | CRA_SELECTED));
|
---|
122 | foundone = TRUE;
|
---|
123 | }
|
---|
124 | }
|
---|
125 | if (!foundone)
|
---|
126 | Runtime_Error(pszSrcFile, __LINE__, "select failed");
|
---|
127 | }
|
---|
128 | else if (filename && *filename) {
|
---|
129 |
|
---|
130 | FILE *fp;
|
---|
131 | CHAR input[1024], *p;
|
---|
132 |
|
---|
133 | fp = _fsopen(filename, "r", SH_DENYNO);
|
---|
134 | if (fp) {
|
---|
135 | while (!feof(fp)) {
|
---|
136 | if (!xfgets_bstripcr(input, sizeof(input), fp, pszSrcFile, __LINE__))
|
---|
137 | break;
|
---|
138 | if (*input == '\"') {
|
---|
139 | memmove(input, input + 1, strlen(input) + 1);
|
---|
140 | lstrip(input);
|
---|
141 | p = strchr(input, '\"');
|
---|
142 | if (p)
|
---|
143 | *p = 0;
|
---|
144 | rstrip(input);
|
---|
145 | }
|
---|
146 | else {
|
---|
147 | p = strchr(input, ' ');
|
---|
148 | if (p)
|
---|
149 | *p = 0;
|
---|
150 | }
|
---|
151 | /* input now contains name of file to select */
|
---|
152 | pci = FindCnrRecord(hwndCnr,
|
---|
153 | input, pciParent, partial, partial, TRUE);
|
---|
154 | if (pci) /* found it? */
|
---|
155 | WinSendMsg(hwndCnr,
|
---|
156 | CM_SETRECORDEMPHASIS,
|
---|
157 | MPFROMP(pci),
|
---|
158 | MPFROM2SHORT((SHORT) ((deselect) ? FALSE : TRUE),
|
---|
159 | CRA_SELECTED));
|
---|
160 | else
|
---|
161 | errs++;
|
---|
162 | if (errs > 50) { /* prevent runaway on bad file */
|
---|
163 |
|
---|
164 | APIRET ret;
|
---|
165 |
|
---|
166 | ret = saymsg(MB_YESNO,
|
---|
167 | hwndCnr,
|
---|
168 | GetPString(IDS_POSSIBLEERRORTEXT),
|
---|
169 | GetPString(IDS_MAYNOTBELISTTEXT), filename);
|
---|
170 | if (ret == MBID_NO)
|
---|
171 | break;
|
---|
172 | errs = 0;
|
---|
173 | }
|
---|
174 | }
|
---|
175 | fclose(fp);
|
---|
176 | }
|
---|
177 | }
|
---|
178 | }
|
---|
179 |
|
---|
180 | VOID SelectAll(HWND hwndCnr, BOOL files, BOOL dirs, PSZ maskstr,
|
---|
181 | PSZ text, BOOL is_arc)
|
---|
182 | {
|
---|
183 |
|
---|
184 | PCNRITEM pci;
|
---|
185 | BOOL markit;
|
---|
186 | PSZ file;
|
---|
187 | PSZ pszToMatch;
|
---|
188 | MASK Mask;
|
---|
189 | INT x;
|
---|
190 | ULONG textlen = 0;
|
---|
191 |
|
---|
192 | if (text)
|
---|
193 | textlen = strlen(text);
|
---|
194 | memset(&Mask, 0, sizeof(Mask));
|
---|
195 | if (maskstr)
|
---|
196 | SetMask(maskstr, &Mask);
|
---|
197 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
|
---|
198 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
199 | while (pci && (INT)pci != -1) {
|
---|
200 |
|
---|
201 | markit = FALSE;
|
---|
202 |
|
---|
203 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
204 | if (!is_arc) {
|
---|
205 | if (files && ~pci->attrFile & FILE_DIRECTORY)
|
---|
206 | markit = TRUE;
|
---|
207 | if (dirs && pci->attrFile & FILE_DIRECTORY)
|
---|
208 | markit = TRUE;
|
---|
209 | }
|
---|
210 | else
|
---|
211 | markit = TRUE;
|
---|
212 | if (maskstr && *maskstr && markit) {
|
---|
213 | markit = FALSE;
|
---|
214 | // Point a filename part
|
---|
215 | file = strrchr(pci->pszFileName, '\\');
|
---|
216 | if (!file)
|
---|
217 | file = strrchr(pci->pszFileName, ':');
|
---|
218 | if (file)
|
---|
219 | file++;
|
---|
220 | else
|
---|
221 | file = pci->pszFileName;
|
---|
222 | for (x = 0; Mask.pszMasks[x]; x++) {
|
---|
223 | if (*Mask.pszMasks[x]) {
|
---|
224 | if ((strchr(Mask.pszMasks[x], '\\') ||
|
---|
225 | strchr(Mask.pszMasks[x], ':')))
|
---|
226 | pszToMatch = pci->pszFileName;
|
---|
227 | else
|
---|
228 | pszToMatch = file;
|
---|
229 | if (*Mask.pszMasks[x] != '/') {
|
---|
230 | if (wildcard(pszToMatch, Mask.pszMasks[x], FALSE)) {
|
---|
231 | markit = TRUE;
|
---|
232 | }
|
---|
233 | }
|
---|
234 | else {
|
---|
235 | if (wildcard(pszToMatch, Mask.pszMasks[x] + 1, FALSE)) {
|
---|
236 | markit = FALSE;
|
---|
237 | break;
|
---|
238 | }
|
---|
239 | }
|
---|
240 | }
|
---|
241 | } // for
|
---|
242 | }
|
---|
243 | }
|
---|
244 |
|
---|
245 | if (markit && text && *text) {
|
---|
246 | if (~pci->attrFile & FILE_DIRECTORY) {
|
---|
247 | PSZ input;
|
---|
248 | markit = FALSE;
|
---|
249 | input = xmalloc(65537, pszSrcFile, __LINE__);
|
---|
250 | if (input) {
|
---|
251 | ULONG pos;
|
---|
252 | LONG len;
|
---|
253 | FILE *inputFile;
|
---|
254 |
|
---|
255 | if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
|
---|
256 | pos = ftell(inputFile);
|
---|
257 | while (!feof(inputFile)) {
|
---|
258 | if (pos)
|
---|
259 | fseek(inputFile, pos - 256, SEEK_SET);
|
---|
260 | len = fread(input, 1, 65536, inputFile);
|
---|
261 | if (len >= 0) {
|
---|
262 | if (findstring(text, textlen, input, len, FALSE)) {
|
---|
263 | markit = TRUE;
|
---|
264 | break;
|
---|
265 | }
|
---|
266 | }
|
---|
267 | else
|
---|
268 | break;
|
---|
269 | } // while
|
---|
270 | fclose(inputFile);
|
---|
271 | }
|
---|
272 | free(input);
|
---|
273 | DosSleep(1);
|
---|
274 | }
|
---|
275 | }
|
---|
276 | else
|
---|
277 | markit = FALSE;
|
---|
278 | }
|
---|
279 |
|
---|
280 | if (markit)
|
---|
281 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
282 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
283 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
284 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
285 | } // while
|
---|
286 | }
|
---|
287 |
|
---|
288 | VOID DeselectAll(HWND hwndCnr, BOOL files, BOOL dirs, PSZ maskstr,
|
---|
289 | PSZ text, BOOL is_arc)
|
---|
290 | {
|
---|
291 | PCNRITEM pci;
|
---|
292 | BOOL unmarkit;
|
---|
293 | PSZ file;
|
---|
294 | PSZ pszToMatch;
|
---|
295 | MASK Mask;
|
---|
296 | register INT x;
|
---|
297 | ULONG textlen = 0;
|
---|
298 |
|
---|
299 | if (text)
|
---|
300 | textlen = strlen(text);
|
---|
301 | memset(&Mask, 0, sizeof(Mask));
|
---|
302 | if (maskstr && *maskstr)
|
---|
303 | SetMask(maskstr, &Mask);
|
---|
304 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
|
---|
305 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
306 | while (pci && (INT)pci != -1) {
|
---|
307 | unmarkit = FALSE;
|
---|
308 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
309 | if (!is_arc) {
|
---|
310 | if (files && ~pci->attrFile & FILE_DIRECTORY)
|
---|
311 | unmarkit = TRUE;
|
---|
312 | if (dirs && (pci->attrFile & FILE_DIRECTORY))
|
---|
313 | unmarkit = TRUE;
|
---|
314 | }
|
---|
315 | else
|
---|
316 | unmarkit = TRUE;
|
---|
317 | if (maskstr && *maskstr && unmarkit) {
|
---|
318 | unmarkit = FALSE;
|
---|
319 | file = strrchr(pci->pszFileName, '\\');
|
---|
320 | if (!file)
|
---|
321 | file = strrchr(pci->pszFileName, ':');
|
---|
322 | if (file)
|
---|
323 | file++;
|
---|
324 | else
|
---|
325 | file = pci->pszFileName;
|
---|
326 | for (x = 0; Mask.pszMasks[x]; x++) {
|
---|
327 | if (*Mask.pszMasks[x]) {
|
---|
328 | if (strchr(Mask.pszMasks[x], '\\') ||
|
---|
329 | strchr(Mask.pszMasks[x], ':'))
|
---|
330 | pszToMatch = pci->pszFileName;
|
---|
331 | else
|
---|
332 | pszToMatch = file;
|
---|
333 | if (*Mask.pszMasks[x] != '/') {
|
---|
334 | if (wildcard(pszToMatch, Mask.pszMasks[x], FALSE))
|
---|
335 | unmarkit = TRUE;
|
---|
336 | }
|
---|
337 | else {
|
---|
338 | if (wildcard(pszToMatch, Mask.pszMasks[x] + 1, FALSE)) {
|
---|
339 | unmarkit = FALSE;
|
---|
340 | break;
|
---|
341 | }
|
---|
342 | }
|
---|
343 | }
|
---|
344 | }
|
---|
345 | }
|
---|
346 | }
|
---|
347 |
|
---|
348 | if (unmarkit && text && *text) {
|
---|
349 | if (~pci->attrFile & FILE_DIRECTORY) {
|
---|
350 | PSZ input;
|
---|
351 | unmarkit = FALSE;
|
---|
352 | input = xmalloc(65537, pszSrcFile, __LINE__);
|
---|
353 | if (input) {
|
---|
354 | ULONG pos;
|
---|
355 | LONG len;
|
---|
356 | FILE *inputFile;
|
---|
357 |
|
---|
358 | if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
|
---|
359 | pos = ftell(inputFile);
|
---|
360 | while (!feof(inputFile)) {
|
---|
361 | if (pos)
|
---|
362 | fseek(inputFile, pos - 256, SEEK_SET);
|
---|
363 | len = fread(input, 1, 65536, inputFile);
|
---|
364 | if (len >= 0) {
|
---|
365 | if (findstring(text, textlen, input, len, FALSE)) {
|
---|
366 | unmarkit = TRUE;
|
---|
367 | break;
|
---|
368 | }
|
---|
369 | }
|
---|
370 | else
|
---|
371 | break;
|
---|
372 | } // while
|
---|
373 | fclose(inputFile);
|
---|
374 | }
|
---|
375 | free(input);
|
---|
376 | DosSleep(1);
|
---|
377 | }
|
---|
378 | }
|
---|
379 | else
|
---|
380 | unmarkit = FALSE;
|
---|
381 | }
|
---|
382 |
|
---|
383 | if (unmarkit)
|
---|
384 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, pci,
|
---|
385 | MPFROM2SHORT(FALSE, CRA_SELECTED | CRA_CURSORED |
|
---|
386 | CRA_INUSE | CRA_SOURCE));
|
---|
387 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
388 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
389 | }
|
---|
390 | }
|
---|
391 |
|
---|
392 | VOID Deselect(HWND hwndCnr)
|
---|
393 | {
|
---|
394 | PCNRITEM pcil;
|
---|
395 |
|
---|
396 | pcil = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
|
---|
397 | MPFROMLONG(CMA_FIRST),
|
---|
398 | MPFROMSHORT(CRA_SELECTED));
|
---|
399 | while (pcil && (INT)pcil != -1) {
|
---|
400 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pcil),
|
---|
401 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
402 | pcil = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pcil),
|
---|
403 | MPFROMSHORT(CRA_SELECTED));
|
---|
404 | }
|
---|
405 | }
|
---|
406 |
|
---|
407 | //=== HideAll() Hide all selected records ===
|
---|
408 |
|
---|
409 | VOID HideAll(HWND hwndCnr)
|
---|
410 | {
|
---|
411 | PCNRITEM pci, pciH;
|
---|
412 | INT attribute = CRA_CURSORED;
|
---|
413 | CNRINFO cnri;
|
---|
414 | BOOL didone = FALSE;
|
---|
415 |
|
---|
416 | memset(&cnri, 0, sizeof(CNRINFO));
|
---|
417 | cnri.cb = sizeof(CNRINFO);
|
---|
418 | WinSendMsg(hwndCnr, CM_QUERYCNRINFO, MPFROMP(&cnri),
|
---|
419 | MPFROMLONG(sizeof(CNRINFO)));
|
---|
420 | pci = (PCNRITEM) CurrentRecord(hwndCnr);
|
---|
421 | if (pci && (INT)pci != -1) {
|
---|
422 | if (pci->rc.flRecordAttr & CRA_SELECTED) {
|
---|
423 | attribute = CRA_SELECTED;
|
---|
424 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
425 | MPFROMSHORT(attribute));
|
---|
426 | }
|
---|
427 | }
|
---|
428 | while (pci && (INT)pci != -1) {
|
---|
429 | pciH = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
|
---|
430 | MPFROMSHORT(attribute));
|
---|
431 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
432 | MPFROM2SHORT(FALSE, CRA_CURSORED | CRA_SELECTED |
|
---|
433 | CRA_INUSE | CRA_SOURCE));
|
---|
434 | pci->rc.flRecordAttr |= CRA_FILTERED;
|
---|
435 | didone = TRUE;
|
---|
436 | if (fSyncUpdates) {
|
---|
437 | if (cnri.flWindowAttr & CV_DETAIL)
|
---|
438 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
|
---|
439 | MPFROM2SHORT(0, CMA_REPOSITION | CMA_ERASE));
|
---|
440 | else
|
---|
441 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPFROMP(&pci),
|
---|
442 | MPFROM2SHORT(1, CMA_REPOSITION | CMA_ERASE));
|
---|
443 | }
|
---|
444 | pci = pciH;
|
---|
445 | }
|
---|
446 | if (didone && !fSyncUpdates)
|
---|
447 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
|
---|
448 | MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION));
|
---|
449 | }
|
---|
450 |
|
---|
451 | VOID MarkAll(HWND hwndCnr, BOOL quitit, BOOL target, BOOL source)
|
---|
452 | {
|
---|
453 | PCNRITEM pci;
|
---|
454 | INT attribute = CRA_CURSORED;
|
---|
455 |
|
---|
456 | if (quitit)
|
---|
457 | attribute = target ? CRA_TARGET : source ? CRA_SOURCE : CRA_INUSE;
|
---|
458 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
|
---|
459 | MPFROMLONG(CMA_FIRST), MPFROMSHORT(attribute));
|
---|
460 | if (pci && (INT)pci != -1) {
|
---|
461 | if (attribute == CRA_CURSORED) {
|
---|
462 | if (pci->rc.flRecordAttr & CRA_SELECTED) {
|
---|
463 | attribute = CRA_SELECTED;
|
---|
464 | pci =
|
---|
465 | WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
466 | MPFROMSHORT(attribute));
|
---|
467 | }
|
---|
468 | }
|
---|
469 | }
|
---|
470 | while (pci && (INT)pci != -1) {
|
---|
471 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
472 | MPFROM2SHORT(!quitit,
|
---|
473 | target ? CRA_TARGET : source ? CRA_SOURCE :
|
---|
474 | CRA_INUSE));
|
---|
475 | pci =
|
---|
476 | WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
|
---|
477 | MPFROMSHORT(attribute));
|
---|
478 | }
|
---|
479 | }
|
---|
480 |
|
---|
481 | VOID RemoveAll(HWND hwndCnr, ULONGLONG * pullTotalBytes,
|
---|
482 | ULONG * pulTotalFiles)
|
---|
483 | {
|
---|
484 | PCNRITEM pci;
|
---|
485 | INT attribute = CRA_CURSORED;
|
---|
486 | BOOL didone = FALSE;
|
---|
487 |
|
---|
488 | pci = (PCNRITEM) CurrentRecord(hwndCnr);
|
---|
489 | if (pci && (INT)pci != -1) {
|
---|
490 | if (pci->rc.flRecordAttr & CRA_SELECTED) {
|
---|
491 | attribute = CRA_SELECTED;
|
---|
492 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
493 | MPFROMSHORT(attribute));
|
---|
494 | }
|
---|
495 | }
|
---|
496 | while (pci && (INT)pci != -1) {
|
---|
497 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
498 | didone = TRUE;
|
---|
499 | if (pulTotalFiles)
|
---|
500 | *pulTotalFiles -= 1;
|
---|
501 | if (pullTotalBytes)
|
---|
502 | *pullTotalBytes -= (pci->cbFile + pci->easize);
|
---|
503 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
504 | MPFROM2SHORT(0, CRA_SELECTED));
|
---|
505 | if (fSyncUpdates)
|
---|
506 | RemoveCnrItems(hwndCnr, pci, 1, CMA_FREE | CMA_INVALIDATE);
|
---|
507 | else
|
---|
508 | RemoveCnrItems(hwndCnr, pci, 1, CMA_FREE);
|
---|
509 | if (attribute == CRA_CURSORED)
|
---|
510 | break;
|
---|
511 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
|
---|
512 | MPFROMSHORT(attribute));
|
---|
513 | }
|
---|
514 | else
|
---|
515 | pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
|
---|
516 | MPFROMSHORT(attribute));
|
---|
517 | }
|
---|
518 | if (didone && !fSyncUpdates)
|
---|
519 | WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
|
---|
520 | MPFROM2SHORT(0, CMA_REPOSITION));
|
---|
521 | }
|
---|
522 |
|
---|
523 | //== SetMask() Convert mask string to array of pointers to masks ==
|
---|
524 |
|
---|
525 | VOID SetMask(PSZ maskstr, MASK * mask)
|
---|
526 | {
|
---|
527 | UINT x;
|
---|
528 | PSZ p;
|
---|
529 |
|
---|
530 | if (maskstr)
|
---|
531 | strcpy(mask->szMask, maskstr); // Got new mask string
|
---|
532 | // Build array of pointers
|
---|
533 | p = mask->szMaskCopy;
|
---|
534 | strcpy(p, mask->szMask);
|
---|
535 | // Allow up to 25 masks - ignore extras
|
---|
536 | for (x = 0; *p && x < 25; x++) {
|
---|
537 | mask->pszMasks[x] = p;
|
---|
538 | while (*p && *p != ';')
|
---|
539 | p++; // Find separator
|
---|
540 | if (*p) {
|
---|
541 | *p = 0; // Replace ;
|
---|
542 | p++;
|
---|
543 | }
|
---|
544 | } // for
|
---|
545 | mask->pszMasks[x] = NULL; // Mark end
|
---|
546 | }
|
---|
547 |
|
---|
548 | VOID ExpandAll(HWND hwndCnr, BOOL expand, PCNRITEM pciParent)
|
---|
549 | {
|
---|
550 | PCNRITEM pci;
|
---|
551 |
|
---|
552 | if (!pciParent)
|
---|
553 | pciParent = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(NULL),
|
---|
554 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
555 | if (pciParent) {
|
---|
556 | if (expand && ~pciParent->rc.flRecordAttr & CRA_EXPANDED)
|
---|
557 | WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciParent), MPVOID);
|
---|
558 | else if (!expand && (pciParent->rc.flRecordAttr & CRA_EXPANDED))
|
---|
559 | WinSendMsg(hwndCnr, CM_COLLAPSETREE, MPFROMP(pciParent), MPVOID);
|
---|
560 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pciParent),
|
---|
561 | MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
|
---|
562 | if (pci)
|
---|
563 | DosSleep(0);
|
---|
564 | while (pci && (INT)pci != -1) {
|
---|
565 | ExpandAll(hwndCnr, expand, pci);
|
---|
566 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
567 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
568 | }
|
---|
569 | }
|
---|
570 | DosSleep(0);
|
---|
571 | }
|
---|
572 |
|
---|
573 | VOID InvertAll(HWND hwndCnr)
|
---|
574 | {
|
---|
575 | PCNRITEM pci;
|
---|
576 |
|
---|
577 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
|
---|
578 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
579 | while (pci && (INT)pci != -1) {
|
---|
580 | if (~pci->rc.flRecordAttr & CRA_FILTERED) {
|
---|
581 | if (~pci->rc.flRecordAttr & CRA_SELECTED)
|
---|
582 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
583 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
584 | else
|
---|
585 | WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
|
---|
586 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
587 | }
|
---|
588 | pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
|
---|
589 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
590 | }
|
---|
591 | }
|
---|
592 |
|
---|
593 | struct SS
|
---|
594 | {
|
---|
595 | PCNRITEM pci;
|
---|
596 | BOOL unique, all, smallest, largest, newest, oldest;
|
---|
597 | };
|
---|
598 |
|
---|
599 | struct Cnr
|
---|
600 | {
|
---|
601 | HWND hwndCnr;
|
---|
602 | ULONG numfiles;
|
---|
603 | struct SS *ss;
|
---|
604 | };
|
---|
605 |
|
---|
606 | static int CompSSNamesB(const void *s1, const void *s2)
|
---|
607 | {
|
---|
608 | struct SS *ss2 = (struct SS *)s2;
|
---|
609 |
|
---|
610 | return stricmp((PSZ)s1, ss2->pci->pszFileName);
|
---|
611 | }
|
---|
612 |
|
---|
613 | static int CompSSNames(const void *s1, const void *s2)
|
---|
614 | {
|
---|
615 | struct SS *ss1 = (struct SS *)s1;
|
---|
616 | struct SS *ss2 = (struct SS *)s2;
|
---|
617 |
|
---|
618 | return stricmp(ss1->pci->pszFileName, ss2->pci->pszFileName);
|
---|
619 | }
|
---|
620 |
|
---|
621 | VOID FreeCnrs(struct Cnr * Cnrs, INT numw)
|
---|
622 | {
|
---|
623 | register INT z;
|
---|
624 |
|
---|
625 | for (z = 0; z < numw; z++) {
|
---|
626 | xfree(Cnrs[z].ss, pszSrcFile, __LINE__);
|
---|
627 | }
|
---|
628 | xfree(Cnrs, pszSrcFile, __LINE__);
|
---|
629 | DosPostEventSem(CompactSem);
|
---|
630 | }
|
---|
631 |
|
---|
632 | /**
|
---|
633 | * Do select actions for single container
|
---|
634 | *
|
---|
635 | */
|
---|
636 |
|
---|
637 | VOID SpecialSelect2(HWND hwndParent, INT action)
|
---|
638 | {
|
---|
639 | PCNRITEM pci;
|
---|
640 | HENUM henum;
|
---|
641 | HWND hwnd;
|
---|
642 | INT numwindows = 0, w, x, z, cmp = 0;
|
---|
643 | struct Cnr *Cnrs = NULL;
|
---|
644 | struct SS *bsres;
|
---|
645 |
|
---|
646 | if (!hwndParent)
|
---|
647 | return;
|
---|
648 |
|
---|
649 | /* count directory containers, build array of hwnds */
|
---|
650 | henum = WinBeginEnumWindows(hwndParent);
|
---|
651 | while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE) {
|
---|
652 | if (WinWindowFromID(WinWindowFromID(hwnd, FID_CLIENT), DIR_CNR)) {
|
---|
653 | Cnrs =
|
---|
654 | xrealloc(Cnrs, (numwindows + 1) * sizeof(struct Cnr), pszSrcFile,
|
---|
655 | __LINE__);
|
---|
656 | if (!Cnrs) {
|
---|
657 | Notify(GetPString(IDS_OUTOFMEMORY));
|
---|
658 | return;
|
---|
659 | }
|
---|
660 | memset(&Cnrs[numwindows], 0, sizeof(struct Cnr));
|
---|
661 | Cnrs[numwindows].hwndCnr = WinWindowFromID(WinWindowFromID(hwnd,
|
---|
662 | FID_CLIENT),
|
---|
663 | DIR_CNR);
|
---|
664 | numwindows++;
|
---|
665 | }
|
---|
666 | }
|
---|
667 | WinEndEnumWindows(henum);
|
---|
668 | if (numwindows < 2) {
|
---|
669 | FreeCnrs(Cnrs, numwindows);
|
---|
670 | Runtime_Error(pszSrcFile, __LINE__, "expected two windows");
|
---|
671 | Notify(GetPString(IDS_COMPSEL2ORMORETEXT));
|
---|
672 | return;
|
---|
673 | }
|
---|
674 | if (numwindows > 4) {
|
---|
675 | WinSendMsg(Cnrs[0].
|
---|
676 | hwndCnr,
|
---|
677 | UM_NOTIFY, MPFROMP(GetPString(IDS_BUILDINGLISTSTEXT)), MPVOID);
|
---|
678 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
679 | }
|
---|
680 |
|
---|
681 | /* count records, build array of pointers to records */
|
---|
682 | for (z = 0; z < numwindows; z++) {
|
---|
683 | pci = (PCNRITEM) WinSendMsg(Cnrs[z].hwndCnr,
|
---|
684 | CM_QUERYRECORD,
|
---|
685 | MPVOID,
|
---|
686 | MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
|
---|
687 | x = 0;
|
---|
688 | while (pci && (INT)pci != -1) {
|
---|
689 | if (~pci->rc.flRecordAttr & CRA_FILTERED &&
|
---|
690 | ~pci->attrFile & FILE_DIRECTORY) {
|
---|
691 | Cnrs[z].ss =
|
---|
692 | xrealloc(Cnrs[z].ss, (x + 1) * sizeof(struct SS), pszSrcFile,
|
---|
693 | __LINE__);
|
---|
694 | if (!Cnrs[z].ss) {
|
---|
695 | FreeCnrs(Cnrs, numwindows);
|
---|
696 | Notify(GetPString(IDS_OUTOFMEMORY));
|
---|
697 | return;
|
---|
698 | }
|
---|
699 | memset(&Cnrs[z].ss[x], 0, sizeof(struct SS));
|
---|
700 | Cnrs[z].ss[x].pci = pci;
|
---|
701 | x++;
|
---|
702 | }
|
---|
703 | pci = (PCNRITEM) WinSendMsg(Cnrs[z].hwndCnr,
|
---|
704 | CM_QUERYRECORD,
|
---|
705 | MPFROMP(pci),
|
---|
706 | MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
707 | }
|
---|
708 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
709 | Cnrs[z].numfiles = x;
|
---|
710 | if (Cnrs[z].numfiles)
|
---|
711 | qsort(Cnrs[z].ss, Cnrs[z].numfiles, sizeof(struct SS), CompSSNames);
|
---|
712 | }
|
---|
713 |
|
---|
714 | for (z = 0; z < numwindows; z++) {
|
---|
715 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
716 | Cnrs[z].ss[x].all = Cnrs[z].ss[x].unique = Cnrs[z].ss[x].newest =
|
---|
717 | Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].smallest =
|
---|
718 | Cnrs[z].ss[x].largest = TRUE;
|
---|
719 | for (w = 0; w < numwindows; w++) {
|
---|
720 | if (w != z && Cnrs[w].numfiles) {
|
---|
721 | bsres = (struct SS *)bsearch(Cnrs[z].ss[x].pci->pszFileName,
|
---|
722 | Cnrs[w].ss, Cnrs[w].numfiles,
|
---|
723 | sizeof(struct SS), CompSSNamesB);
|
---|
724 | if (bsres) {
|
---|
725 | Cnrs[z].ss[x].unique = FALSE;
|
---|
726 | if (Cnrs[z].ss[x].pci->cbFile + Cnrs[z].ss[x].pci->easize >
|
---|
727 | bsres->pci->cbFile + bsres->pci->easize)
|
---|
728 | Cnrs[z].ss[x].smallest = FALSE;
|
---|
729 | if (Cnrs[z].ss[x].pci->cbFile + Cnrs[z].ss[x].pci->easize <
|
---|
730 | bsres->pci->cbFile + bsres->pci->easize)
|
---|
731 | Cnrs[z].ss[x].largest = FALSE;
|
---|
732 | cmp = TestCDates(&bsres->pci->date, &bsres->pci->time,
|
---|
733 | &Cnrs[z].ss[x].pci->date, &Cnrs[z].ss[x].pci->time);
|
---|
734 | /*(Cnrs[z].ss[x].pci->date.year >
|
---|
735 | bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year <
|
---|
736 | bsres->pci->date.
|
---|
737 | year) ? FALSE : (Cnrs[z].
|
---|
738 | ss[x].pci->
|
---|
739 | date.month >
|
---|
740 | bsres->pci->
|
---|
741 | date.
|
---|
742 | month) ? TRUE
|
---|
743 | : (Cnrs[z].ss[x].pci->date.month <
|
---|
744 | bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.
|
---|
745 | day >
|
---|
746 | bsres->pci->date.
|
---|
747 | day) ? TRUE : (Cnrs[z].
|
---|
748 | ss[x].pci->
|
---|
749 | date.day <
|
---|
750 | bsres->
|
---|
751 | pci->date.
|
---|
752 | day) ?
|
---|
753 | FALSE : (Cnrs[z].ss[x].pci->time.hours >
|
---|
754 | bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->
|
---|
755 | time.hours <
|
---|
756 | bsres->pci->time.
|
---|
757 | hours) ? FALSE
|
---|
758 | : (Cnrs[z].ss[x].pci->time.minutes >
|
---|
759 | bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
760 | minutes <
|
---|
761 | bsres->pci->time.
|
---|
762 | minutes) ? FALSE
|
---|
763 | : (Cnrs[z].ss[x].pci->time.seconds >
|
---|
764 | bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
765 | seconds <
|
---|
766 | bsres->pci->time.
|
---|
767 | seconds) ? FALSE : FALSE;*/
|
---|
768 | if (cmp != 1)
|
---|
769 | Cnrs[z].ss[x].newest = FALSE;
|
---|
770 | /*cmp =
|
---|
771 | (Cnrs[z].ss[x].pci->date.year <
|
---|
772 | bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year >
|
---|
773 | bsres->pci->date.
|
---|
774 | year) ? FALSE : (Cnrs[z].
|
---|
775 | ss[x].pci->
|
---|
776 | date.month <
|
---|
777 | bsres->pci->
|
---|
778 | date.
|
---|
779 | month) ? TRUE
|
---|
780 | : (Cnrs[z].ss[x].pci->date.month >
|
---|
781 | bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.
|
---|
782 | day <
|
---|
783 | bsres->pci->date.
|
---|
784 | day) ? TRUE : (Cnrs[z].
|
---|
785 | ss[x].pci->
|
---|
786 | date.day >
|
---|
787 | bsres->
|
---|
788 | pci->date.
|
---|
789 | day) ?
|
---|
790 | FALSE : (Cnrs[z].ss[x].pci->time.hours <
|
---|
791 | bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->
|
---|
792 | time.hours >
|
---|
793 | bsres->pci->time.
|
---|
794 | hours) ? FALSE
|
---|
795 | : (Cnrs[z].ss[x].pci->time.minutes <
|
---|
796 | bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
797 | minutes >
|
---|
798 | bsres->pci->time.
|
---|
799 | minutes) ? FALSE
|
---|
800 | : (Cnrs[z].ss[x].pci->time.seconds <
|
---|
801 | bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.
|
---|
802 | seconds >
|
---|
803 | bsres->pci->time.
|
---|
804 | seconds) ? FALSE : FALSE;*/
|
---|
805 | if (cmp != -1)
|
---|
806 | Cnrs[z].ss[x].oldest = FALSE;
|
---|
807 | cmp = 0;
|
---|
808 | break;
|
---|
809 | }
|
---|
810 | else
|
---|
811 | Cnrs[z].ss[x].all = FALSE;
|
---|
812 | }
|
---|
813 | }
|
---|
814 | if (Cnrs[z].ss[x].unique)
|
---|
815 | Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].newest = Cnrs[z].ss[x].all =
|
---|
816 | Cnrs[z].ss[x].largest = Cnrs[z].ss[x].smallest = FALSE;
|
---|
817 | DosSleep(1);
|
---|
818 | }
|
---|
819 | DosSleep(1);
|
---|
820 | }
|
---|
821 |
|
---|
822 | switch (action) {
|
---|
823 | case IDM_SELECTBOTH:
|
---|
824 | for (z = 0; z < numwindows; z++) {
|
---|
825 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
826 | if (Cnrs[z].ss[x].all)
|
---|
827 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
828 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
829 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
830 | }
|
---|
831 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
832 | }
|
---|
833 | break;
|
---|
834 | case IDM_SELECTMORE:
|
---|
835 | for (z = 0; z < numwindows; z++) {
|
---|
836 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
837 | if (!Cnrs[z].ss[x].unique)
|
---|
838 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
839 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
840 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
841 | }
|
---|
842 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
843 | }
|
---|
844 | break;
|
---|
845 | case IDM_SELECTONE:
|
---|
846 | for (z = 0; z < numwindows; z++) {
|
---|
847 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
848 | if (Cnrs[z].ss[x].unique)
|
---|
849 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
850 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
851 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
852 | }
|
---|
853 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
854 | }
|
---|
855 | break;
|
---|
856 | case IDM_SELECTNEWER:
|
---|
857 | for (z = 0; z < numwindows; z++) {
|
---|
858 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
859 | if (Cnrs[z].ss[x].newest)
|
---|
860 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
861 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
862 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
863 | }
|
---|
864 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
865 | }
|
---|
866 | break;
|
---|
867 | case IDM_SELECTOLDER:
|
---|
868 | for (z = 0; z < numwindows; z++) {
|
---|
869 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
870 | if (Cnrs[z].ss[x].oldest)
|
---|
871 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
872 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
873 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
874 | }
|
---|
875 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
876 | }
|
---|
877 | break;
|
---|
878 | case IDM_SELECTBIGGER:
|
---|
879 | for (z = 0; z < numwindows; z++) {
|
---|
880 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
881 | if (Cnrs[z].ss[x].largest)
|
---|
882 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
883 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
884 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
885 | }
|
---|
886 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
887 | }
|
---|
888 | break;
|
---|
889 | case IDM_SELECTSMALLER:
|
---|
890 | for (z = 0; z < numwindows; z++) {
|
---|
891 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
892 | if (Cnrs[z].ss[x].smallest)
|
---|
893 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
894 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
895 | MPFROM2SHORT(TRUE, CRA_SELECTED));
|
---|
896 | }
|
---|
897 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
898 | }
|
---|
899 | break;
|
---|
900 |
|
---|
901 | case IDM_DESELECTBOTH:
|
---|
902 | for (z = 0; z < numwindows; z++) {
|
---|
903 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
904 | if (Cnrs[z].ss[x].all)
|
---|
905 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
906 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
907 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
908 | }
|
---|
909 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
910 | }
|
---|
911 | break;
|
---|
912 | case IDM_DESELECTMORE:
|
---|
913 | for (z = 0; z < numwindows; z++) {
|
---|
914 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
915 | if (!Cnrs[z].ss[x].unique)
|
---|
916 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
917 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
918 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
919 | }
|
---|
920 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
921 | }
|
---|
922 | break;
|
---|
923 | case IDM_DESELECTONE:
|
---|
924 | for (z = 0; z < numwindows; z++) {
|
---|
925 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
926 | if (Cnrs[z].ss[x].unique)
|
---|
927 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
928 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
929 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
930 | }
|
---|
931 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
932 | }
|
---|
933 | break;
|
---|
934 | case IDM_DESELECTNEWER:
|
---|
935 | for (z = 0; z < numwindows; z++) {
|
---|
936 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
937 | if (Cnrs[z].ss[x].newest)
|
---|
938 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
939 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
940 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
941 | }
|
---|
942 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
943 | }
|
---|
944 | break;
|
---|
945 | case IDM_DESELECTOLDER:
|
---|
946 | for (z = 0; z < numwindows; z++) {
|
---|
947 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
948 | if (Cnrs[z].ss[x].oldest)
|
---|
949 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
950 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
951 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
952 | }
|
---|
953 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
954 | }
|
---|
955 | break;
|
---|
956 | case IDM_DESELECTBIGGER:
|
---|
957 | for (z = 0; z < numwindows; z++) {
|
---|
958 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
959 | if (Cnrs[z].ss[x].largest)
|
---|
960 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
961 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
962 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
963 | }
|
---|
964 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
965 | }
|
---|
966 | break;
|
---|
967 | case IDM_DESELECTSMALLER:
|
---|
968 | for (z = 0; z < numwindows; z++) {
|
---|
969 | for (x = 0; x < Cnrs[z].numfiles; x++) {
|
---|
970 | if (Cnrs[z].ss[x].smallest)
|
---|
971 | WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
|
---|
972 | MPFROMP(Cnrs[z].ss[x].pci),
|
---|
973 | MPFROM2SHORT(FALSE, CRA_SELECTED));
|
---|
974 | }
|
---|
975 | DosSleep(0); //26 Aug 07 GKY 1
|
---|
976 | }
|
---|
977 | break;
|
---|
978 | }
|
---|
979 |
|
---|
980 | FreeCnrs(Cnrs, numwindows);
|
---|
981 | }
|
---|
982 |
|
---|
983 | #pragma alloc_text(SELECT,UnHilite,SelectAll,DeselectAll,MarkAll,SetMask)
|
---|
984 | #pragma alloc_text(SELECT,SelectList)
|
---|
985 | #pragma alloc_text(SELECT1,Deselect,HideAll,RemoveAll,ExpandAll,InvertAll)
|
---|
986 | #pragma alloc_text(SELECT4,FreeCnrs,SpecialSelect2,CompSSNames,CompSSNamesB)
|
---|