Skip to content
Snippets Groups Projects
Commit aebda22e authored by Jim Aston's avatar Jim Aston Committed by Alexandre Julliard
Browse files

Fixed the height of the ComboBox drop list.

parent edb77973
No related branches found
No related tags found
No related merge requests found
......@@ -153,37 +153,6 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
return 0;
}
/***********************************************************************
* CBForceDummyResize
*
* The dummy resize is used for listboxes that have a popup to trigger
* a re-arranging of the contents of the combobox and the recalculation
* of the size of the "real" control window.
*/
static void CBForceDummyResize(
LPHEADCOMBO lphc)
{
RECT windowRect;
GetWindowRect(CB_HWND(lphc), &windowRect);
/*
* We have to be careful, resizing a combobox also has the meaning that the
* dropped rect will be resized. In this case, we want to trigger a resize
* to recalculate layout but we don't want to change the dropped rectangle
* So, we add the size of the dropped rectangle to the size of the control.
* this will cancel-out in the processing of the WM_WINDOWPOSCHANGING
* message.
*/
SetWindowPos( CB_HWND(lphc),
(HWND)NULL,
0, 0,
windowRect.right - windowRect.left,
windowRect.bottom - windowRect.top +
lphc->droppedRect.bottom - lphc->droppedRect.top,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
}
/***********************************************************************
* CBGetTextAreaHeight
*
......@@ -291,6 +260,38 @@ static INT CBGetTextAreaHeight(
return iTextItemHeight;
}
/***********************************************************************
* CBForceDummyResize
*
* The dummy resize is used for listboxes that have a popup to trigger
* a re-arranging of the contents of the combobox and the recalculation
* of the size of the "real" control window.
*/
static void CBForceDummyResize(
LPHEADCOMBO lphc)
{
RECT windowRect;
int newComboHeight;
newComboHeight = CBGetTextAreaHeight(CB_HWND(lphc),lphc) + 2*COMBO_YBORDERSIZE();
GetWindowRect(CB_HWND(lphc), &windowRect);
/*
* We have to be careful, resizing a combobox also has the meaning that the
* dropped rect will be resized. In this case, we want to trigger a resize
* to recalculate layout but we don't want to change the dropped rectangle
* So, we pass the height of text area of control as the height.
* this will cancel-out in the processing of the WM_WINDOWPOSCHANGING
* message.
*/
SetWindowPos( CB_HWND(lphc),
(HWND)NULL,
0, 0,
windowRect.right - windowRect.left,
newComboHeight,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
}
/***********************************************************************
* CBCalcPlacement
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment