Changeset 73
- Timestamp:
- May 23, 2001, 6:59:40 PM (24 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/winh.h
r71 r73 205 205 USHORT afAttribute); 206 206 207 BOOL XWPENTRY winhSetMenuCondCascade(HWND hwndMenu, 208 LONG lDefaultItem); 209 207 210 /* 208 211 *@@ winhRemoveMenuItem: -
trunk/src/helpers/dosh.c
r69 r73 2234 2234 if (strlen(pcszExecWithArgs) > 255) 2235 2235 arc = ERROR_INSUFFICIENT_BUFFER; 2236 else 2236 2237 { 2237 2238 CHAR szObj[CCHMAXPATH]; -
trunk/src/helpers/stringh.c
r69 r73 1152 1152 * 1153 1153 * <B>Example:</B> 1154 + strhFindAttribValue("<PAGE BLAH= "data">, "BLAH")1154 + strhFindAttribValue("<PAGE BLAH=\"data\">", "BLAH") 1155 1155 + 1156 1156 + returns ....................... ^ this address. … … 1158 1158 *@@added V0.9.0 [umoeller] 1159 1159 *@@changed V0.9.3 (2000-05-19) [umoeller]: some speed optimizations 1160 *@@changed V0.9.12 (2001-05-22) [umoeller]: fixed space bug, thanks Yuri Dario 1160 1161 */ 1161 1162 1162 1163 PSZ strhFindAttribValue(const char *pszSearchIn, const char *pszAttrib) 1164 { 1165 PSZ prc = 0; 1166 PSZ pszSearchIn2, p; 1167 ULONG cbAttrib = strlen(pszAttrib), 1168 ulLength = strlen(pszSearchIn); 1169 1170 // use alloca(), so memory is freed on function exit 1171 pszSearchIn2 = (PSZ)alloca(ulLength + 1); 1172 memcpy(pszSearchIn2, pszSearchIn, ulLength + 1); 1173 1174 // 1) find token, (space char, \n, \r, \t) 1175 p = strtok(pszSearchIn2, " \n\r\t"); 1176 while (p) 1177 { 1178 CHAR c2; 1179 PSZ pOrig; 1180 1181 // check tag name 1182 if (!strnicmp(p, pszAttrib, cbAttrib)) 1183 { 1184 // position in original string 1185 pOrig = (PSZ)pszSearchIn + (p - pszSearchIn2); 1186 1187 // yes: 1188 prc = pOrig + cbAttrib; 1189 c2 = *prc; 1190 while ( ( (c2 == ' ') 1191 || (c2 == '=') 1192 || (c2 == '\n') 1193 || (c2 == '\r') 1194 ) 1195 && (c2 != 0) 1196 ) 1197 c2 = *++prc; 1198 1199 break; 1200 } 1201 1202 p = strtok(NULL, " \n\r\t"); 1203 } 1204 1205 return (prc); 1206 } 1207 1208 /* PSZ strhFindAttribValue(const char *pszSearchIn, const char *pszAttrib) 1163 1209 { 1164 1210 PSZ prc = 0; … … 1211 1257 } 1212 1258 return (prc); 1213 } 1259 } */ 1214 1260 1215 1261 /* -
trunk/src/helpers/winh.c
r71 r73 448 448 } 449 449 return (hwndNewMenu); 450 } 451 452 /* 453 *@@ winhSetMenuCondCascade: 454 * sets the "conditional cascade" style 455 * on the specified submenu. 456 * 457 * This style must always be enabled manually 458 * because the resource compiler won't handle it. 459 * 460 * Note: Pass in the _submenu_ window handle, 461 * not the one of the parent. With lDefaultItem, 462 * specify the item ID in the submenu which is 463 * to be checked as the default item. 464 * 465 *@@added V0.9.12 (2001-05-22) [umoeller] 466 */ 467 468 BOOL winhSetMenuCondCascade(HWND hwndMenu, // in: submenu handle 469 LONG lDefaultItem) // in: item ID of new default item 470 { 471 // stolen from the Warp Toolkit WPS Guide 472 ULONG ulStyle = WinQueryWindowULong(hwndMenu, QWL_STYLE); 473 ulStyle |= MS_CONDITIONALCASCADE; 474 WinSetWindowULong(hwndMenu, QWL_STYLE, ulStyle); 475 476 // make the first item in the subfolder 477 // the default of cascading submenu */ 478 return (BOOL)(WinSendMsg(hwndMenu, 479 MM_SETDEFAULTITEMID, 480 (MPARAM)lDefaultItem, 481 0)); 450 482 } 451 483
Note:
See TracChangeset
for help on using the changeset viewer.