Changeset 111 for trunk/src/helpers/comctl.c
- Timestamp:
- Oct 18, 2001, 11:06:02 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/comctl.c
r91 r111 677 677 *@@changed V0.9.0 [umoeller]: exported gpihIcon2Bitmap function to gpih.c 678 678 *@@changed V0.9.0 [umoeller]: fixed paint errors when SM_SETHANDLE had NULL argument in mp1 679 *@@changed V0.9.16 (2001-10-15) [umoeller]: now centering icon in static properly 680 *@@changed V0.9.16 (2001-10-15) [umoeller]: this always used the presparam colors of the parent instead of its own ones 679 681 */ 680 682 … … 683 685 PANIMATIONDATA pa = (PANIMATIONDATA)WinQueryWindowULong(hwndStatic, QWL_USER); 684 686 // animation data which was stored in window words 687 685 688 PFNWP OldStaticProc = NULL; 686 689 MRESULT mrc = NULL; … … 726 729 727 730 LONG lBkgndColor 728 = winhQueryPresColor(WinQueryWindow(hwndStatic, QW_PARENT),731 /* = winhQueryPresColor(WinQueryWindow(hwndStatic, QW_PARENT), 729 732 PP_BACKGROUNDCOLOR, 730 733 FALSE, 734 SYSCLR_DIALOGBACKGROUND); */ 735 // fixed this... V0.9.16 (2001-10-15) [umoeller] 736 = winhQueryPresColor(hwndStatic, 737 PP_BACKGROUNDCOLOR, 738 TRUE, 731 739 SYSCLR_DIALOGBACKGROUND); 732 740 … … 792 800 793 801 if (pa->hptr) 802 { 803 // center the icon in the bitmap 804 // V0.9.16 (2001-10-15) [umoeller] 805 POINTL ptlOfs; 806 ptlOfs.x = ( (pa->rclIcon.xRight - pa->rclIcon.xLeft) 807 - pa->lIconSize 808 ) / 2; 809 ptlOfs.y = ( (pa->rclIcon.yTop - pa->rclIcon.yBottom) 810 - pa->lIconSize 811 ) / 2; 812 794 813 // paint icon into bitmap 795 814 gpihIcon2Bitmap(hpsMem, 796 815 pa->hptr, 797 816 lBkgndColor, 798 WinQuerySysValue(HWND_DESKTOP, SV_CXICON)); 817 &ptlOfs, 818 pa->lIconSize); 819 } 799 820 800 821 } // end if (pa->ulFlags & ANF_ICON) … … 933 954 934 955 /* 956 *@@ CreateAnimationData: 957 * 958 *@@added V0.9.16 (2001-10-15) [umoeller] 959 */ 960 961 PANIMATIONDATA CreateAnimationData(HWND hwndStatic, 962 USHORT cAnimations) 963 { 964 PANIMATIONDATA pa = NULL; 965 966 if (cAnimations >= 1) 967 { 968 // create the ANIMATIONDATA structure, 969 // initialize some fields, 970 // and store it in QWL_USER of the static control 971 ULONG cbStruct = sizeof(ANIMATIONDATA) 972 + ((cAnimations - 1) * sizeof(HPOINTER)); 973 974 if (pa = (PANIMATIONDATA)malloc(cbStruct)) 975 { 976 memset(pa, 0, cbStruct); 977 978 WinSetWindowULong(hwndStatic, QWL_USER, (ULONG)pa); 979 980 pa->hab = WinQueryAnchorBlock(hwndStatic); 981 WinQueryWindowRect(hwndStatic, &pa->rclIcon); 982 pa->OldStaticProc = WinSubclassWindow(hwndStatic, ctl_fnwpBitmapStatic); 983 pa->lIconSize = WinQuerySysValue(HWND_DESKTOP, SV_CXICON); 984 } 985 } 986 987 return (pa); 988 } 989 990 /* 935 991 *@@ ctlPrepareStaticIcon: 936 992 * turns a static control into one which properly … … 971 1027 // this must be at least 1 972 1028 { 973 PANIMATIONDATA pa = NULL; 974 PFNWP OldStaticProc = WinSubclassWindow(hwndStatic, ctl_fnwpBitmapStatic); 975 if (OldStaticProc) 1029 PANIMATIONDATA pa; 1030 1031 if (pa = CreateAnimationData(hwndStatic, 1032 usAnimCount)) 976 1033 { 977 // create the ANIMATIONDATA structure,978 // initialize some fields,979 // and store it in QWL_USER of the static control980 ULONG cbStruct = sizeof(ANIMATIONDATA)981 + ((usAnimCount-1) * sizeof(HPOINTER));982 pa = (PANIMATIONDATA)malloc(cbStruct);983 memset(pa, 0, cbStruct);984 985 1034 // switch static to icon mode 986 1035 pa->ulFlags = ANF_ICON; 987 pa->OldStaticProc = OldStaticProc;988 WinQueryWindowRect(hwndStatic, &(pa->rclIcon));989 pa->hab = WinQueryAnchorBlock(hwndStatic);990 991 WinSetWindowULong(hwndStatic, QWL_USER, (ULONG)pa);992 1036 } 1037 993 1038 return (pa); 994 1039 } … … 1057 1102 paNew->usAniCurrent = 0; 1058 1103 paNew->usAniCount = usAnimCount; 1059 memcpy(&(paNew->ahptrAniIcons), pahptr, 1060 (usAnimCount * sizeof(HPOINTER))); 1061 1062 if (fStartAnimation) { 1104 memcpy(&paNew->ahptrAniIcons, 1105 pahptr, 1106 (usAnimCount * sizeof(HPOINTER))); 1107 1108 if (fStartAnimation) 1109 { 1063 1110 WinStartTimer(WinQueryAnchorBlock(hwndStatic), hwndStatic, 1064 1111 1, ulDelay); … … 1155 1202 * 1156 1203 *@@added V0.9.0 [umoeller] 1204 *@@changed V0.9.16 (2001-10-15) [umoeller]: some cleanup 1157 1205 */ 1158 1206 … … 1160 1208 BOOL fPreserveProportions) 1161 1209 { 1162 PANIMATIONDATA pa = NULL;1163 PFNWP OldStaticProc = WinSubclassWindow(hwndStatic, ctl_fnwpBitmapStatic); 1164 if ( OldStaticProc)1210 PANIMATIONDATA pa; 1211 1212 if (pa = CreateAnimationData(hwndStatic, 1)) 1165 1213 { 1166 // create the ANIMATIONDATA structure,1167 // initialize some fields,1168 // and store it in QWL_USER of the static control1169 ULONG cbStruct = sizeof(ANIMATIONDATA);1170 pa = (PANIMATIONDATA)malloc(cbStruct);1171 memset(pa, 0, cbStruct);1172 1173 1214 // switch static to bitmap mode 1174 1215 pa->ulFlags = ANF_BITMAP; 1175 1216 if (fPreserveProportions) 1176 1217 pa->ulFlags |= ANF_PROPORTIONAL; 1177 1178 pa->OldStaticProc = OldStaticProc;1179 WinQueryWindowRect(hwndStatic, &(pa->rclIcon));1180 pa->hab = WinQueryAnchorBlock(hwndStatic);1181 1182 WinSetWindowULong(hwndStatic, QWL_USER, (ULONG)pa);1183 1218 } 1219 1184 1220 return (pa); 1185 1221 }
Note:
See TracChangeset
for help on using the changeset viewer.