Commit d3cc4dcd authored by Lauri Tulmin's avatar Lauri Tulmin Committed by Alexandre Julliard

Fixes to the handling of LBS_EXTENDEDSEL style, with tests.

parent 63522122
......@@ -2010,11 +2010,16 @@ static LRESULT LISTBOX_HandleLButtonDown( LB_DESCR *descr, DWORD keys, INT x, IN
{
LISTBOX_MoveCaret( descr, index, FALSE );
if (descr->style & LBS_MULTIPLESEL)
if (descr->style & LBS_EXTENDEDSEL)
{
LISTBOX_SetSelection( descr, index,
(!(descr->style & LBS_MULTIPLESEL) ||
!descr->items[index].selected),
descr->items[index].selected,
(descr->style & LBS_NOTIFY) != 0 );
}
else
{
LISTBOX_SetSelection( descr, index,
!descr->items[index].selected,
(descr->style & LBS_NOTIFY) != 0 );
}
}
......
......@@ -181,6 +181,26 @@ START_TEST(listbox)
{LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0},
{ 1, 1, 1, LB_ERR}, {0,0,0,0},
{ 2, 2, 2, LB_ERR}, {0,0,0,0}};
const struct listbox_test ES =
{{LBS_EXTENDEDSEL},
{ 0, LB_ERR, 0, 0}, {0,0,0,0},
{ 1, 1, 1, 1}, {0,0,0,0},
{ 2, 2, 2, 1}, {0,0,0,0}};
const struct listbox_test ES_NS =
{{LBS_EXTENDEDSEL | LBS_NOSEL},
{LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0},
{ 1, 1, 1, LB_ERR}, {0,0,0,0},
{ 2, 2, 2, LB_ERR}, {0,0,0,0}};
const struct listbox_test EMS =
{{LBS_EXTENDEDSEL | LBS_MULTIPLESEL},
{ 0, LB_ERR, 0, 0}, {0,0,0,0},
{ 1, 1, 1, 1}, {0,0,0,0},
{ 2, 2, 2, 1}, {0,0,0,0}};
const struct listbox_test EMS_NS =
{{LBS_EXTENDEDSEL | LBS_MULTIPLESEL | LBS_NOSEL},
{LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0},
{ 1, 1, 1, LB_ERR}, {0,0,0,0},
{ 2, 2, 2, LB_ERR}, {0,0,0,0}};
trace (" Testing single selection...\n");
check (SS);
......@@ -190,6 +210,14 @@ START_TEST(listbox)
check (MS);
trace (" ... with NOSEL\n");
check (MS_NS);
trace (" Testing extended selection...\n");
check (ES);
trace (" ... with NOSEL\n");
check (ES_NS);
trace (" Testing extended and multiple selection...\n");
check (EMS);
trace (" ... with NOSEL\n");
check (EMS_NS);
check_item_height();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment