Better CB_SETCURSEL message handling.
This commit is contained in:
parent
dbf2bf00bc
commit
311d329cb8
|
@ -8,7 +8,8 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "windows.h"
|
||||
#include "winuser.h"
|
||||
#include "wine/winuser16.h"
|
||||
#include "sysmetrics.h"
|
||||
#include "win.h"
|
||||
#include "spy.h"
|
||||
|
@ -1545,7 +1546,15 @@ LRESULT WINAPI ComboWndProc( HWND32 hwnd, UINT32 message,
|
|||
case CB_SETCURSEL16:
|
||||
wParam = (INT32)(INT16)wParam;
|
||||
case CB_SETCURSEL32:
|
||||
return SendMessage32A( lphc->hWndLBox, LB_SETCURSEL32, wParam, 0);
|
||||
lParam = SendMessage32A( lphc->hWndLBox, LB_SETCURSEL32, wParam, 0);
|
||||
if( lphc->wState & CBF_SELCHANGE )
|
||||
{
|
||||
/* no LBN_SELCHANGE in this case, update manually */
|
||||
|
||||
CBPaintText( lphc, 0 );
|
||||
lphc->wState &= ~CBF_SELCHANGE;
|
||||
}
|
||||
return lParam;
|
||||
|
||||
case CB_GETLBTEXT16:
|
||||
wParam = (INT32)(INT16)wParam;
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "windows.h"
|
||||
#include "wine/winuser16.h"
|
||||
#include "winuser.h"
|
||||
#include "winerror.h"
|
||||
#include "drive.h"
|
||||
#include "heap.h"
|
||||
|
@ -1231,6 +1232,9 @@ static LRESULT LISTBOX_SetSelection( WND *wnd, LB_DESCR *descr, INT32 index,
|
|||
if (index != -1) LISTBOX_RepaintItem( wnd, descr, index, ODA_SELECT );
|
||||
if (send_notify) SEND_NOTIFICATION( wnd, descr,
|
||||
(index != -1) ? LBN_SELCHANGE : LBN_SELCANCEL );
|
||||
else
|
||||
if( descr->lphc ) /* set selection change flag for parent combo */
|
||||
descr->lphc->wState |= CBF_SELCHANGE;
|
||||
}
|
||||
return LB_OKAY;
|
||||
}
|
||||
|
@ -2281,7 +2285,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
|
|||
/* fall through */
|
||||
case LB_SETCURSEL32:
|
||||
if (wParam != -1) LISTBOX_MakeItemVisible( wnd, descr, wParam, TRUE );
|
||||
return LISTBOX_SetSelection( wnd, descr, wParam, TRUE, (descr->lphc != NULL) );
|
||||
return LISTBOX_SetSelection( wnd, descr, wParam, TRUE, FALSE );
|
||||
|
||||
case LB_GETSELCOUNT16:
|
||||
case LB_GETSELCOUNT32:
|
||||
|
@ -2584,6 +2588,11 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg,
|
|||
}
|
||||
return LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
||||
|
||||
case LB_SETCURSEL16:
|
||||
case LB_SETCURSEL32:
|
||||
lRet = ListBoxWndProc( hwnd, msg, wParam, lParam );
|
||||
return (lRet == LB_ERR) ? lRet : descr->selected_item;
|
||||
|
||||
case WM_NCDESTROY:
|
||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||
lphc->hWndLBox = 0;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#define CBF_NORESIZE 0x0080
|
||||
#define CBF_NOTIFY 0x0100
|
||||
#define CBF_NOREDRAW 0x0200
|
||||
#define CBF_SELCHANGE 0x0400
|
||||
#define CBF_EUI 0x8000
|
||||
|
||||
/* Combo state struct */
|
||||
|
|
Loading…
Reference in New Issue