Commit 14a6c98f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/pager: Don't block window size changes.

parent 948dd848
......@@ -388,34 +388,6 @@ PAGER_SetPos(PAGER_INFO* infoPtr, INT newPos, BOOL fromBtnPress)
return 0;
}
static LRESULT
PAGER_WindowPosChanging(PAGER_INFO* infoPtr, WINDOWPOS *winpos)
{
if ((infoPtr->dwStyle & CCS_NORESIZE) && !(winpos->flags & SWP_NOSIZE))
{
/* don't let the app resize the nonscrollable dimension of a control
* that was created with CCS_NORESIZE style
* (i.e. height for a horizontal pager, or width for a vertical one) */
/* except if the current dimension is 0 and app is setting for
* first time, then save amount as dimension. - GA 8/01 */
if (infoPtr->dwStyle & PGS_HORZ)
if (!infoPtr->nHeight && winpos->cy)
infoPtr->nHeight = winpos->cy;
else
winpos->cy = infoPtr->nHeight;
else
if (!infoPtr->nWidth && winpos->cx)
infoPtr->nWidth = winpos->cx;
else
winpos->cx = infoPtr->nWidth;
return 0;
}
return DefWindowProcW (infoPtr->hwndSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM)winpos);
}
/******************************************************************
* For the PGM_RECALCSIZE message (but not the other uses in *
* this module), the native control does only the following: *
......@@ -1096,9 +1068,6 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NCPAINT:
return PAGER_NCPaint (infoPtr, (HRGN)wParam);
case WM_WINDOWPOSCHANGING:
return PAGER_WindowPosChanging (infoPtr, (WINDOWPOS*)lParam);
case WM_STYLECHANGED:
return PAGER_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
......
......@@ -170,7 +170,7 @@ static HWND create_pager_control( DWORD style )
static void test_pager(void)
{
HWND pager, child;
RECT rect;
RECT rect, rect2;
pager = create_pager_control( PGS_HORZ );
if (!pager)
......@@ -204,6 +204,29 @@ static void test_pager(void)
ok_sequence(sequences, PAGER_SEQ_INDEX, set_pos_seq, "set pos", TRUE);
DestroyWindow( pager );
/* Test if resizing works */
pager = create_pager_control( CCS_NORESIZE );
ok(pager != NULL, "failed to create pager control\n");
GetWindowRect( pager, &rect );
MoveWindow( pager, 0, 0, 200, 100, TRUE );
GetWindowRect( pager, &rect2 );
ok(rect2.right - rect2.left > rect.right - rect.left, "expected pager window to resize, %s\n",
wine_dbgstr_rect( &rect2 ));
DestroyWindow( pager );
pager = create_pager_control( CCS_NORESIZE | PGS_HORZ );
ok(pager != NULL, "failed to create pager control\n");
GetWindowRect( pager, &rect );
MoveWindow( pager, 0, 0, 100, 200, TRUE );
GetWindowRect( pager, &rect2 );
ok(rect2.bottom - rect2.top > rect.bottom - rect.top, "expected pager window to resize, %s\n",
wine_dbgstr_rect( &rect2 ));
DestroyWindow( pager );
}
START_TEST(pager)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment