Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 2018 of file listbox.c.
Referenced by LISTBOX_HandleLButtonDownCombo(), and ListBoxWndProc_common().
{ INT index = LISTBOX_GetItemFromPoint( descr, x, y ); TRACE("[%p]: lbuttondown %d,%d item %d, focus item %d\n", descr->self, x, y, index, descr->focus_item); if (!descr->caret_on && (descr->in_focus)) return 0; if (!descr->in_focus) { if( !descr->lphc ) SetFocus( descr->self ); else SetFocus( (descr->lphc->hWndEdit) ? descr->lphc->hWndEdit : descr->lphc->self ); } if (index == -1) return 0; if (!descr->lphc) { if (descr->style & LBS_NOTIFY ) SendMessageW( descr->owner, WM_LBTRACKPOINT, index, MAKELPARAM( x, y ) ); } descr->captured = TRUE; SetCapture( descr->self ); if (descr->style & (LBS_EXTENDEDSEL | LBS_MULTIPLESEL)) { /* we should perhaps make sure that all items are deselected FIXME: needed for !LBS_EXTENDEDSEL, too ? if (!(keys & (MK_SHIFT|MK_CONTROL))) LISTBOX_SetSelection( descr, -1, FALSE, FALSE); */ if (!(keys & MK_SHIFT)) descr->anchor_item = index; if (keys & MK_CONTROL) { LISTBOX_SetCaretIndex( descr, index, FALSE ); LISTBOX_SetSelection( descr, index, !descr->items[index].selected, (descr->style & LBS_NOTIFY) != 0); } else { LISTBOX_MoveCaret( descr, index, FALSE ); if (descr->style & LBS_EXTENDEDSEL) { LISTBOX_SetSelection( descr, index, descr->items[index].selected, (descr->style & LBS_NOTIFY) != 0 ); } else { LISTBOX_SetSelection( descr, index, !descr->items[index].selected, (descr->style & LBS_NOTIFY) != 0 ); } } } else { descr->anchor_item = index; LISTBOX_MoveCaret( descr, index, FALSE ); LISTBOX_SetSelection( descr, index, TRUE, (descr->style & LBS_NOTIFY) != 0 ); } if (!descr->lphc) { // See rev 40864 use Ptr for 64 bit. if (GetWindowLongPtrW( descr->self, GWL_EXSTYLE ) & WS_EX_DRAGDETECT) { POINT pt; pt.x = x; pt.y = y; if (DragDetect( descr->self, pt )) SendMessageW( descr->owner, WM_BEGINDRAG, 0, 0 ); } } return 0; }