Changeset 985 for trunk/dll/dirsize.c
- Timestamp:
- Mar 1, 2008, 2:37:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dirsize.c
r959 r985 31 31 13 Aug 07 SHL Move #pragma alloc_text to end for OpenWatcom compat 32 32 26 Aug 07 GKY DosSleep(1) in loops changed to (0) 33 29 Feb 08 GKY Use xfree where appropriate 34 29 Feb 08 GKY Add presparams & update appearence of "Sizes" dialog 33 35 34 36 ***********************************************************************/ … … 150 152 strlen(pszFileName) < 4) { 151 153 if (*pchStopFlag) { 152 free(pffbArray);154 xfree(pffbArray); 153 155 return FALSE; 154 156 } … … 157 159 if (!pci) { 158 160 Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, "CM_ALLOCRECORD"); 159 free(pffbArray);161 xfree(pffbArray); 160 162 return FALSE; 161 163 } … … 173 175 else { 174 176 // No match 175 free(pffbArray);177 xfree(pffbArray); 176 178 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 177 179 GetPString(IDS_CANTFINDDIRTEXT), pszFileName); … … 216 218 ri.fInvalidateRecord = TRUE; 217 219 if (!WinSendMsg(hwndCnr, CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) { 218 free(pffbArray);220 xfree(pffbArray); 219 221 return FALSE; 220 222 } … … 278 280 } 279 281 280 free(pffbArray);282 xfree(pffbArray); 281 283 282 284 pci->cbFile = ullCurDirBytes; … … 456 458 PostMsg(WinQueryWindow(hwndCnr, QW_PARENT), 457 459 UM_CONTAINER_FILLED, MPVOID, MPVOID); 458 free(dirsize);460 xfree(dirsize); 459 461 } 460 462 … … 483 485 { 484 486 CHAR s[CCHMAXPATH + 81]; 485 487 RestorePresParams(hwnd, "DirSizes"); 486 488 sprintf(s, GetPString(IDS_DIRSIZETITLETEXT), pState->szDirName); 487 489 WinSetWindowText(hwnd, s); 490 } 491 { 492 SWP swp; 493 ULONG size = sizeof(SWP); 494 495 PrfQueryProfileData(fmprof, FM3Str, "DirSizes.Position", (PVOID) &swp, &size); 496 WinSetWindowPos(hwnd, 497 HWND_TOP, 498 swp.x, 499 swp.y, 500 swp.cx, 501 swp.cy, 502 swp.fl); 488 503 } 489 504 { … … 502 517 Runtime_Error(pszSrcFile, __LINE__, 503 518 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 504 free(dirsize);519 xfree(dirsize); 505 520 WinDismissDlg(hwnd, 0); 506 521 break; … … 614 629 return 0; 615 630 631 case WM_PRESPARAMCHANGED: 632 PresParamChanged(hwnd, "DirSizes", mp1, mp2); 633 break; 634 616 635 case WM_DRAWITEM: 617 636 if (mp2) { … … 638 657 p = strchr(pci->pszFileName, '\r'); 639 658 if (p) { 640 // draw text 641 if (!pci->cbFile) // no size 659 // draw text 660 if (*(pci->pszLongName + 1) == 1) // is root record 661 GpiSetColor(oi->hps, CLR_DARKRED); 662 else if (!pci->cbFile) // no size 642 663 GpiSetColor(oi->hps, CLR_DARKGRAY); 643 664 else if (!pci->easize) // no size below … … 654 675 pci->pszFileName, TXTBOX_COUNT, aptl); 655 676 boxHeight = aptl[TXTBOX_TOPRIGHT].y - aptl[TXTBOX_BOTTOMRIGHT].y; 656 boxHeight -= 6;677 boxHeight -= 4; 657 678 658 679 // Calculate nominal baseline of graph box … … 662 683 // Place text above graph box with a bit of whitespace between 663 684 ptl.x = oi->rclItem.xLeft; 664 ptl.y = yBottom + boxHeight + 8; // 03 Aug 07 SHL685 ptl.y = yBottom + boxHeight + 6; // 03 Aug 07 SHL 665 686 // GpiMove(oi->hps, &ptl); 666 687 GpiCharStringAt(oi->hps, &ptl, strlen(pci->pszFileName), … … 676 697 ptl.y = yBottom + 2; 677 698 GpiMove(oi->hps, &ptl); 678 ptl.x = oi->rclItem.xLeft + 101;699 ptl.x = oi->rclItem.xLeft + 201; 679 700 ptl.y = yBottom + boxHeight; 680 701 GpiBox(oi->hps, DRO_OUTLINE, &ptl, 0, 0); … … 684 705 ptl.y = yBottom + 3; 685 706 GpiMove(oi->hps, &ptl); 686 ptl.x = oi->rclItem.xLeft + 100;707 ptl.x = oi->rclItem.xLeft + 200; 687 708 ptl.y = yBottom + boxHeight - 1; 688 709 GpiBox(oi->hps, DRO_OUTLINEFILL, &ptl, 0, 0); … … 693 714 ptl.y = yBottom + 3; 694 715 GpiMove(oi->hps, &ptl); 695 ptl.x = oi->rclItem.xLeft + 100;716 ptl.x = oi->rclItem.xLeft + 200; 696 717 GpiLine(oi->hps, &ptl); 697 718 ptl.y = yBottom + boxHeight - 1; … … 710 731 ptl.y = yBottom + boxHeight; 711 732 GpiMove(oi->hps, &ptl); 712 ptl.x = oi->rclItem.xLeft + 103;733 ptl.x = oi->rclItem.xLeft + 203; 713 734 GpiLine(oi->hps, &ptl); 714 735 ptl.y = yBottom + boxHeight - 2; … … 727 748 else 728 749 GpiSetColor(oi->hps, CLR_RED); 729 ptl.x = oi->rclItem.xLeft + 1;750 ptl.x = oi->rclItem.xLeft + 2; 730 751 ptl.y = yBottom + 3; 731 752 GpiMove(oi->hps, &ptl); 732 ptl.x = oi->rclItem.xLeft + pci->flags ;753 ptl.x = oi->rclItem.xLeft + pci->flags * 2; 733 754 ptl.y = yBottom + boxHeight - 1; 734 755 GpiBox(oi->hps, DRO_OUTLINEFILL, &ptl, 0, 0); … … 750 771 GpiMove(oi->hps, &ptl); 751 772 } 752 ptl.x = oi->rclItem.xLeft + pci->flags ;773 ptl.x = oi->rclItem.xLeft + pci->flags * 2; 753 774 GpiLine(oi->hps, &ptl); 754 775 if (*(pci->pszLongName + 1) != 1) { … … 757 778 ptl.y = yBottom + 3; 758 779 GpiMove(oi->hps, &ptl); 759 ptl.x = oi->rclItem.xLeft + pci->flags ;780 ptl.x = oi->rclItem.xLeft + pci->flags * 2; 760 781 GpiLine(oi->hps, &ptl); 761 782 } … … 765 786 GpiSetColor(oi->hps, CLR_WHITE); 766 787 clr = CLR_WHITE; 767 for (x = 1; x < 10; x++) {768 if (clr == CLR_WHITE && x * 10 > pci->flags ) {788 for (x = 1; x < 20; x++) { 789 if (clr == CLR_WHITE && x * 10 > pci->flags * 2) { 769 790 clr = CLR_BLACK; 770 791 GpiSetColor(oi->hps, CLR_BLACK); … … 775 796 switch (x) { 776 797 case 1: 777 case 3: 798 case 3: 799 case 5: 778 800 case 7: 779 case 9: 801 case 9: 802 case 11: 803 case 13: 804 case 15: 805 case 17: 806 case 19: 780 807 ptl.y -= 1; 781 808 break; 782 case 5:809 case 10: 783 810 ptl.y -= 4; 784 811 break; … … 786 813 case 4: 787 814 case 6: 788 case 8: 815 case 8: 816 case 12: 817 case 14: 818 case 16: 819 case 18: 789 820 ptl.y -= 2; 790 821 break; … … 943 974 case DID_OK: 944 975 case DID_CANCEL: 976 { 977 SWP swp; 978 ULONG size = sizeof(SWP); 979 980 WinQueryWindowPos(hwnd, &swp); 981 PrfWriteProfileData(fmprof, FM3Str, "DirSizes.Position", (PVOID) &swp, 982 size); 983 } 945 984 pState = INSTDATA(hwnd); 946 985 if (!pState) … … 973 1012 WinDestroyPointer(pState->hptr); 974 1013 DosSleep(16); //05 Aug 07 GKY 33 975 free(pState); // Let's hope no one is still looking1014 xfree(pState); // Let's hope no one is still looking 976 1015 } 977 1016 DosPostEventSem(CompactSem);
Note:
See TracChangeset
for help on using the changeset viewer.