comctl32/listbox: Scroll to specified caret index.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
832b748b06
commit
1a25f47d59
|
@ -1462,18 +1462,22 @@ static void LISTBOX_MakeItemVisible( LB_DESCR *descr, INT index, BOOL fully )
|
|||
*/
|
||||
static LRESULT LISTBOX_SetCaretIndex( LB_DESCR *descr, INT index, BOOL fully_visible )
|
||||
{
|
||||
INT oldfocus = descr->focus_item;
|
||||
BOOL focus_changed = descr->focus_item != index;
|
||||
|
||||
TRACE("old focus %d, index %d\n", oldfocus, index);
|
||||
TRACE("old focus %d, index %d\n", descr->focus_item, index);
|
||||
|
||||
if (descr->style & LBS_NOSEL) return LB_ERR;
|
||||
if ((index < 0) || (index >= descr->nb_items)) return LB_ERR;
|
||||
if (index == oldfocus) return LB_OKAY;
|
||||
|
||||
if (focus_changed)
|
||||
{
|
||||
LISTBOX_DrawFocusRect( descr, FALSE );
|
||||
descr->focus_item = index;
|
||||
}
|
||||
|
||||
LISTBOX_MakeItemVisible( descr, index, fully_visible );
|
||||
|
||||
if (focus_changed)
|
||||
LISTBOX_DrawFocusRect( descr, TRUE );
|
||||
|
||||
return LB_OKAY;
|
||||
|
|
Loading…
Reference in New Issue