comparison win/dw.c @ 1487:5e4ced521696

Changed auto-size behavior on Windows... if no window size is set on a window... It will now automatically size the window based on the packing information... instead of letting windows pick a default size... Auto positioning is unchanged.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 24 Dec 2011 15:18:00 +0000
parents 1794caee0758
children ac43d9a9eee7
comparison
equal deleted inserted replaced
1486:5cfbf2715eec 1487:5e4ced521696
3924 * Parameters: 3924 * Parameters:
3925 * handle: The window handle to make visible. 3925 * handle: The window handle to make visible.
3926 */ 3926 */
3927 int API dw_window_show(HWND handle) 3927 int API dw_window_show(HWND handle)
3928 { 3928 {
3929 int rc = ShowWindow(handle, SW_SHOW); 3929 int rc;
3930 RECT rect;
3931
3932 GetClientRect(handle, &rect);
3933
3934 /* If the client area is 0x0 then call the autosize routine */
3935 if((rect.bottom - rect.top) == 0 || (rect.right - rect.left) == 0)
3936 dw_window_set_size(handle, 0, 0);
3937
3938 rc = ShowWindow(handle, SW_SHOW);
3930 SetFocus(handle); 3939 SetFocus(handle);
3931 _initial_focus(handle); 3940 _initial_focus(handle);
3932 return rc; 3941 return rc;
3933 } 3942 }
3934 3943
4604 if(flStyle & DW_FCF_TASKLIST) 4613 if(flStyle & DW_FCF_TASKLIST)
4605 { 4614 {
4606 ULONG newflags = (flStyle | WS_CLIPCHILDREN) & ~DW_FCF_TASKLIST; 4615 ULONG newflags = (flStyle | WS_CLIPCHILDREN) & ~DW_FCF_TASKLIST;
4607 4616
4608 hwndframe = CreateWindowEx(flStyleEx, ClassName, title, newflags, CW_USEDEFAULT, CW_USEDEFAULT, 4617 hwndframe = CreateWindowEx(flStyleEx, ClassName, title, newflags, CW_USEDEFAULT, CW_USEDEFAULT,
4609 CW_USEDEFAULT, CW_USEDEFAULT, hwndOwner, NULL, DWInstance, NULL); 4618 0, 0, hwndOwner, NULL, DWInstance, NULL);
4610 } 4619 }
4611 else 4620 else
4612 { 4621 {
4613 flStyleEx |= WS_EX_TOOLWINDOW; 4622 flStyleEx |= WS_EX_TOOLWINDOW;
4614 4623
4615 hwndframe = CreateWindowEx(flStyleEx, ClassName, title, flStyle | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, 4624 hwndframe = CreateWindowEx(flStyleEx, ClassName, title, flStyle | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT,
4616 CW_USEDEFAULT, CW_USEDEFAULT, hwndOwner, NULL, DWInstance, NULL); 4625 0, 0, hwndOwner, NULL, DWInstance, NULL);
4617 } 4626 }
4618 SetWindowLongPtr(hwndframe, GWLP_USERDATA, (LONG_PTR)newbox); 4627 SetWindowLongPtr(hwndframe, GWLP_USERDATA, (LONG_PTR)newbox);
4619 4628
4620 if(hwndOwner) 4629 if(hwndOwner)
4621 SetParent(hwndframe, hwndOwner); 4630 SetParent(hwndframe, hwndOwner);