Author: jimtabor
Date: Sun Jun 2 20:47:12 2013
New Revision: 59157
URL:
http://svn.reactos.org/svn/reactos?rev=59157&view=rev
Log:
[User32]
- Sync port to 1.5.31.
Modified:
trunk/reactos/win32ss/user/user32/controls/combo.c
Modified: trunk/reactos/win32ss/user/user32/controls/combo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/contro…
==============================================================================
--- trunk/reactos/win32ss/user/user32/controls/combo.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/controls/combo.c [iso-8859-1] Sun Jun 2 20:47:12
2013
@@ -1042,17 +1042,23 @@
}
}
+ r.left = rect.left;
+ r.top = rect.bottom;
+ r.right = r.left + lphc->droppedRect.right - lphc->droppedRect.left;
+ r.bottom = r.top + nDroppedHeight;
+
/*If height of dropped rectangle gets beyond a screen size it should go up, otherwise
down.*/
monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
mon_info.cbSize = sizeof(mon_info);
GetMonitorInfoW( monitor, &mon_info );
- if( (rect.bottom + nDroppedHeight) >= mon_info.rcWork.bottom )
- rect.bottom = rect.top - nDroppedHeight;
-
- SetWindowPos( lphc->hWndLBox, HWND_TOPMOST, rect.left, rect.bottom,
- lphc->droppedRect.right - lphc->droppedRect.left,
- nDroppedHeight,
+ if (r.bottom > mon_info.rcWork.bottom )
+ {
+ r.top = max( rect.top - nDroppedHeight, mon_info.rcWork.top );
+ r.bottom = min( r.top + nDroppedHeight, mon_info.rcWork.bottom );
+ }
+ //// ReactOS : Use HWND_TOPMOST See Bug 5705 or CORE-5186....
+ SetWindowPos( lphc->hWndLBox, HWND_TOPMOST, r.left, r.top, r.right - r.left,
r.bottom - r.top,
SWP_NOACTIVATE | SWP_SHOWWINDOW);
@@ -1506,7 +1512,7 @@
/***********************************************************************
* COMBO_Size
*/
-static void COMBO_Size( LPHEADCOMBO lphc, LPARAM lParam )
+static void COMBO_Size( LPHEADCOMBO lphc )
{
/*
* Those controls are always the same height. So we have to make sure
@@ -1514,8 +1520,12 @@
*/
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
{
- int newComboHeight;
-
+ int newComboHeight, curComboHeight, curComboWidth;
+ RECT rc;
+
+ GetWindowRect(lphc->self, &rc);
+ curComboHeight = rc.bottom - rc.top;
+ curComboWidth = rc.right - rc.left;
newComboHeight = CBGetTextAreaHeight(lphc->self, lphc) + 2*COMBO_YBORDERSIZE();
/*
@@ -1526,18 +1536,18 @@
* the actual control, for example, to do the layout of a dialog that is
* resized, the height of the dropdown is not changed.
*/
- if( HIWORD(lParam) > newComboHeight )
+ if( curComboHeight > newComboHeight )
{
TRACE("oldComboHeight=%d, newComboHeight=%d, oldDropBottom=%d,
oldDropTop=%d\n",
- HIWORD(lParam), newComboHeight, lphc->droppedRect.bottom,
+ curComboHeight, newComboHeight, lphc->droppedRect.bottom,
lphc->droppedRect.top);
- lphc->droppedRect.bottom = lphc->droppedRect.top + HIWORD(lParam) -
newComboHeight;
+ lphc->droppedRect.bottom = lphc->droppedRect.top + curComboHeight -
newComboHeight;
}
/*
* Restore original height
*/
- if( HIWORD(lParam) != newComboHeight )
- SetWindowPos(lphc->self, 0, 0, 0, LOWORD(lParam), newComboHeight,
+ if( curComboHeight != newComboHeight )
+ SetWindowPos(lphc->self, 0, 0, 0, curComboWidth, newComboHeight,
SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOREDRAW);
}
@@ -1885,7 +1895,7 @@
}
case WM_SIZE:
if( lphc->hWndLBox &&
- !(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc, lParam );
+ !(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
return TRUE;
case WM_SETFONT:
COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam );