mirror of
https://github.com/reactos/reactos.git
synced 2025-05-29 22:18:13 +00:00
[COMCTL32] Combobox Implement logic for set and get dropdown height CORE-15833
by import of Wine commit
313c63e194
merged from current Wine head.
Thanks to patches author Fabian Maurer
and also Doug Lyons for tests and adding initial the merge-patch.
This commit is contained in:
parent
05886b83e9
commit
e3e173ffaa
2 changed files with 24 additions and 20 deletions
|
@ -18,10 +18,6 @@
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*
|
*
|
||||||
* TODO:
|
|
||||||
* - ComboBox_[GS]etMinVisible()
|
|
||||||
* - CB_GETMINVISIBLE, CB_SETMINVISIBLE
|
|
||||||
* - CB_SETTOPINDEX
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
@ -459,6 +455,11 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
|
||||||
*/
|
*/
|
||||||
lphc->wState |= CBF_MEASUREITEM;
|
lphc->wState |= CBF_MEASUREITEM;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Per default the comctl32 version of combo shows up to 30 items
|
||||||
|
*/
|
||||||
|
lphc->visibleItems = 30;
|
||||||
|
|
||||||
/* M$ IE 3.01 actually creates (and rapidly destroys) an ownerless combobox */
|
/* M$ IE 3.01 actually creates (and rapidly destroys) an ownerless combobox */
|
||||||
|
|
||||||
if( lphc->owner || !(style & WS_VISIBLE) )
|
if( lphc->owner || !(style & WS_VISIBLE) )
|
||||||
|
@ -1010,23 +1011,18 @@ static void CBDropDown( LPHEADCOMBO lphc )
|
||||||
|
|
||||||
if (nItems > 0)
|
if (nItems > 0)
|
||||||
{
|
{
|
||||||
int nHeight;
|
int nIHeight = (int)SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, 0, 0);
|
||||||
int nIHeight;
|
|
||||||
|
|
||||||
nIHeight = (int)SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, 0, 0);
|
if (lphc->dwStyle & CBS_NOINTEGRALHEIGHT)
|
||||||
|
{
|
||||||
nHeight = nIHeight*nItems;
|
nDroppedHeight -= 1;
|
||||||
|
}
|
||||||
if (nHeight < nDroppedHeight - COMBO_YBORDERSIZE())
|
else
|
||||||
nDroppedHeight = nHeight + COMBO_YBORDERSIZE();
|
{
|
||||||
|
if (nItems > lphc->visibleItems)
|
||||||
if (nDroppedHeight < nHeight)
|
nItems = lphc->visibleItems;
|
||||||
{
|
nDroppedHeight = nItems * nIHeight + COMBO_YBORDERSIZE();
|
||||||
if (nItems < 5)
|
}
|
||||||
nDroppedHeight = (nItems+1)*nIHeight;
|
|
||||||
else if (nDroppedHeight < 6*nIHeight)
|
|
||||||
nDroppedHeight = 6*nIHeight;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r.left = rect.left;
|
r.left = rect.left;
|
||||||
|
@ -2135,6 +2131,13 @@ static LRESULT CALLBACK COMBO_WindowProc( HWND hwnd, UINT message, WPARAM wParam
|
||||||
return SendMessageW(lphc->hWndEdit, EM_LIMITTEXT, wParam, lParam);
|
return SendMessageW(lphc->hWndEdit, EM_LIMITTEXT, wParam, lParam);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
case CB_GETMINVISIBLE:
|
||||||
|
return lphc->visibleItems;
|
||||||
|
|
||||||
|
case CB_SETMINVISIBLE:
|
||||||
|
lphc->visibleItems = (INT)wParam;
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (message >= WM_USER)
|
if (message >= WM_USER)
|
||||||
WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n", message - WM_USER, wParam, lParam );
|
WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n", message - WM_USER, wParam, lParam );
|
||||||
|
|
|
@ -147,6 +147,7 @@ typedef struct
|
||||||
INT fixedOwnerDrawHeight;
|
INT fixedOwnerDrawHeight;
|
||||||
INT droppedWidth; /* last two are not used unless set */
|
INT droppedWidth; /* last two are not used unless set */
|
||||||
INT editHeight; /* explicitly */
|
INT editHeight; /* explicitly */
|
||||||
|
INT visibleItems;
|
||||||
} HEADCOMBO, *LPHEADCOMBO;
|
} HEADCOMBO, *LPHEADCOMBO;
|
||||||
|
|
||||||
extern BOOL COMBO_FlipListbox(HEADCOMBO *lphc, BOOL ok, BOOL bRedrawButton) DECLSPEC_HIDDEN;
|
extern BOOL COMBO_FlipListbox(HEADCOMBO *lphc, BOOL ok, BOOL bRedrawButton) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in a new issue