< prev index next >
src/java.desktop/windows/native/libawt/windows/awt_List.cpp
Print this page
@@ -476,22 +476,29 @@
}
MsgRouting AwtList::HandleEvent(MSG *msg, BOOL synthetic)
{
if (IsFocusingMouseMessage(msg)) {
+ LONG count = GetCount();
+ if (count > 0) {
LONG item = static_cast<LONG>(SendListMessage(LB_ITEMFROMPOINT, 0, msg->lParam));
- if (item != LB_ERR) {
+ item = LOWORD(item);
+ if (SendListMessage(LB_GETTOPINDEX, 0, 0) > item) {
+ item = (count / max_index) * max_index + item + 1;
+ }
+ if (item < count) {
if (isMultiSelect) {
if (IsItemSelected(item)) {
Deselect(item);
} else {
Select(item);
}
} else {
Select(item);
}
}
+ }
delete msg;
return mrConsume;
}
if (msg->message == WM_KEYDOWN && msg->wParam == VK_RETURN) {
WmNotify(LBN_DBLCLK);
< prev index next >