Fixed initial content area size on uiWindows.

This commit is contained in:
Pietro Gagliardi 2015-04-13 00:44:27 -04:00
parent 83792ddf80
commit 0616d0342a
1 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,8 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA
case WM_WINDOWPOSCHANGED:
if ((wp->flags & SWP_NOSIZE) != 0)
break;
// fall through
case msgUpdateChild:
if (GetClientRect(w->hwnd, &r) == 0)
logLastError("error getting window client rect for resize in uiWindowWndProc()");
contenthwnd = uiParentHWND(w->content);
@ -160,7 +162,9 @@ void uiWindowOnClosing(uiWindow *w, int (*f)(uiWindow *, void *), void *data)
void uiWindowSetChild(uiWindow *w, uiControl *c)
{
uiParentSetChild(w->content, c);
uiParentUpdate(w->content);
// don't call uiParentUpdate(); instead, synthesize a resize
// otherwise, we'll have a 0x0 content area at first
SendMessageW(w->hwnd, msgUpdateChild, 0, 0);
}
int uiWindowMargined(uiWindow *w)