Changeset 146 for trunk/src/helpers/dialog.c
- Timestamp:
- Mar 6, 2002, 6:34:48 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/dialog.c
r142 r146 109 109 POINTL ptlTotalOfs; 110 110 111 LINKLIST llControls; // linked list of all PCOLUMNDEF structs,112 // in the order in which windows were113 // created111 PLINKLIST pllControls; // linked list of HWNDs in the order 112 // in which controls were created; 113 // ptr can be NULL 114 114 115 115 PCSZ pcszControlsFont; // from dlghCreateDlg … … 910 910 pcszFont); 911 911 912 lstAppendItem(&pDlgData->llControls, 913 pColumnDef); 912 // append window that was created 913 // V0.9.18 (2002-03-03) [umoeller] 914 if (pDlgData->pllControls) 915 lstAppendItem(pDlgData->pllControls, 916 (PVOID)pColumnDef->hwndControl); 914 917 915 918 // if this is the first control with WS_TABSTOP, … … 1455 1458 * 1456 1459 *@@added V0.9.15 (2001-08-26) [umoeller] 1460 *@@changed V0.9.18 (2002-03-03) [umoeller]: aded pllWindows 1457 1461 */ 1458 1462 1459 1463 static APIRET Dlg0_Init(PDLGPRIVATE *ppDlgData, 1460 PCSZ pcszControlsFont) 1464 PCSZ pcszControlsFont, 1465 PLINKLIST pllControls) 1461 1466 { 1462 1467 PDLGPRIVATE pDlgData; … … 1465 1470 ZERO(pDlgData); 1466 1471 lstInit(&pDlgData->llTables, FALSE); 1467 lstInit(&pDlgData->llControls, FALSE); 1472 1473 if (pllControls) 1474 pDlgData->pllControls = pllControls; 1468 1475 1469 1476 pDlgData->pcszControlsFont = pcszControlsFont; … … 1756 1763 1757 1764 lstClear(&pDlgData->llTables); 1758 lstClear(&pDlgData->llControls);1759 1765 1760 1766 free(pDlgData); … … 2040 2046 2041 2047 if (!(arc = Dlg0_Init(&pDlgData, 2042 pcszControlsFont))) 2048 pcszControlsFont, 2049 NULL))) 2043 2050 { 2044 2051 if (!(arc = Dlg1_ParseTables(pDlgData, … … 2204 2211 * except that the frame is already created. 2205 2212 * 2206 * -- DFFL_RESIZEFRAME: hwndDlg should be resized so 2207 * that it will properly surround the controls. 2208 * 2209 * This can only be used in conjunction with 2210 * DFFL_RESIZEFRAME. 2213 * If pszlClient is specified, it receives the required 2214 * size of the client to surround all controls properly. 2215 * You can then use dlghResizeFrame to resize the frame 2216 * with a bit of spacing, if desired. 2211 2217 * 2212 2218 *@@added V0.9.16 (2001-09-29) [umoeller] 2219 *@@changed V0.9.18 (2002-03-03) [umoeller]: added pszlClient, fixed output 2213 2220 */ 2214 2221 … … 2217 2224 ULONG cDlgItems, // in: array item count (NOT array size) 2218 2225 PCSZ pcszControlsFont, // in: font for ctls with CTL_COMMON_FONT 2219 ULONG flFlags) // in: DFFL_* flags 2226 ULONG flFlags, // in: DFFL_* flags 2227 PSIZEL pszlClient, // out: size of all controls (ptr can be NULL) 2228 PVOID *ppllControls) // out: new LINKLIST receiving HWNDs of created controls (ptr can be NULL) 2220 2229 { 2221 2230 APIRET arc = NO_ERROR; … … 2224 2233 2225 2234 PDLGPRIVATE pDlgData = NULL; 2235 PLINKLIST pllControls = NULL; 2226 2236 2227 2237 /* … … 2230 2240 */ 2231 2241 2242 if (ppllControls) 2243 pllControls = *(PLINKLIST*)ppllControls = lstCreate(FALSE); 2244 2232 2245 if (!(arc = Dlg0_Init(&pDlgData, 2233 pcszControlsFont))) 2246 pcszControlsFont, 2247 pllControls))) 2234 2248 { 2235 2249 if (!(arc = Dlg1_ParseTables(pDlgData, … … 2237 2251 cDlgItems))) 2238 2252 { 2253 HWND hwndFocusItem; 2254 2239 2255 /* 2240 2256 * 2) create empty dialog frame … … 2242 2258 */ 2243 2259 2244 HWND hwndFocusItem = NULLHANDLE;2245 SIZEL szlClient = {0};2246 RECTL rclClient;2247 2248 2260 pDlgData->hwndDlg = hwndDlg; 2249 2261 … … 2255 2267 Dlg2_CalcSizes(pDlgData); 2256 2268 2257 // WinSubclassWindow(hwndDlg, pfnwpDialogProc); 2258 2259 /* 2260 * 4) compute size of dialog client from total 2261 * size of all controls 2262 */ 2263 2264 if (flFlags & DFFL_RESIZEFRAME) 2269 if (pszlClient) 2265 2270 { 2266 // calculate the frame size from the client size 2267 rclClient.xLeft = 10; 2268 rclClient.yBottom = 10; 2269 rclClient.xRight = szlClient.cx + 2 * SPACING; 2270 rclClient.yTop = szlClient.cy + 2 * SPACING; 2271 WinCalcFrameRect(hwndDlg, 2272 &rclClient, 2273 FALSE); // frame from client 2274 2275 WinSetWindowPos(hwndDlg, 2276 0, 2277 10, 2278 10, 2279 rclClient.xRight, 2280 rclClient.yTop, 2281 SWP_MOVE | SWP_SIZE | SWP_NOADJUST); 2271 pszlClient->cx = pDlgData->szlClient.cx + 2 * SPACING; 2272 pszlClient->cy = pDlgData->szlClient.cy + 2 * SPACING; 2282 2273 } 2283 2274 … … 2303 2294 2304 2295 return (arc); 2296 } 2297 2298 /* 2299 *@@ dlghResizeFrame: 2300 * 2301 *@@added V0.9.18 (2002-03-03) [umoeller] 2302 */ 2303 2304 VOID dlghResizeFrame(HWND hwndDlg, 2305 PSIZEL pszlClient) 2306 { 2307 // calculate the frame size from the client size 2308 RECTL rclClient; 2309 rclClient.xLeft = 10; 2310 rclClient.yBottom = 10; 2311 rclClient.xRight = pszlClient->cx; 2312 rclClient.yTop = pszlClient->cy; 2313 WinCalcFrameRect(hwndDlg, 2314 &rclClient, 2315 FALSE); // frame from client 2316 2317 WinSetWindowPos(hwndDlg, 2318 0, 2319 10, 2320 10, 2321 rclClient.xRight, 2322 rclClient.yTop, 2323 SWP_MOVE | SWP_SIZE | SWP_NOADJUST); 2305 2324 } 2306 2325
Note:
See TracChangeset
for help on using the changeset viewer.